-
-
${this.escapeHtml(b.Name)}
-
${b.UUID || b.NamespaceId || 'No UUID'}
+ container.innerHTML = this.beacons.map(b => {
+ const minorInfo = b.Minor ? ` (Minor: ${b.Minor})` : '';
+ return `
+
+
+
${this.escapeHtml(b.Name)}${minorInfo}
+
${b.UUID || 'No UUID'}
+
+
+
+
+
-
-
-
-
-
- `).join('');
+ `;
+ }).join('');
},
// Load service points list
@@ -1879,9 +1882,9 @@ const Portal = {
this.showBeaconModal(beaconId);
},
- // Delete beacon
- async deleteBeacon(beaconId) {
- if (!confirm('Are you sure you want to deactivate this beacon?')) return;
+ // Delete beacon (removes BeaconMinor from service point)
+ async deleteBeacon(servicePointId) {
+ if (!confirm('Are you sure you want to remove this beacon?')) return;
try {
const response = await fetch(`${this.config.apiBaseUrl}/beacons/delete.cfm`, {
@@ -1891,19 +1894,19 @@ const Portal = {
'X-User-Token': this.config.token,
'X-Business-ID': this.config.businessId
},
- body: JSON.stringify({ BeaconID: beaconId })
+ body: JSON.stringify({ ServicePointID: servicePointId })
});
const data = await response.json();
if (data.OK) {
- this.toast('Beacon deactivated', 'success');
+ this.toast('Beacon removed', 'success');
await this.loadBeacons();
} else {
- this.toast(data.ERROR || 'Failed to delete beacon', 'error');
+ this.toast(data.ERROR || 'Failed to remove beacon', 'error');
}
} catch (err) {
- console.error('[Portal] Error deleting beacon:', err);
- this.toast('Error deleting beacon', 'error');
+ console.error('[Portal] Error removing beacon:', err);
+ this.toast('Error removing beacon', 'error');
}
},
diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html
index 4c60bb6..80567ea 100644
--- a/portal/setup-wizard.html
+++ b/portal/setup-wizard.html
@@ -2509,6 +2509,110 @@
}
}
+ function showAddModifierForm() {
+ // Initialize modifiers array if needed
+ if (!config.extractedData.modifiers) {
+ config.extractedData.modifiers = [];
+ }
+
+ addMessage('ai', `
+
+ `);
+ }
+
+ function addModifierOption() {
+ const container = document.getElementById('newModOptions');
+ const row = document.createElement('div');
+ row.className = 'modifier-option-row';
+ row.innerHTML = \`
+
+
+
+ \`;
+ container.appendChild(row);
+ }
+
+ function removeModifierOption(btn) {
+ const row = btn.closest('.modifier-option-row');
+ const container = document.getElementById('newModOptions');
+ if (container.children.length > 1) {
+ row.remove();
+ }
+ }
+
+ function saveCurrentModifier() {
+ const name = document.getElementById('newModName').value.trim();
+ if (!name) {
+ alert('Please enter a modifier name');
+ return false;
+ }
+
+ const required = document.getElementById('newModRequired').checked;
+ const optionRows = document.querySelectorAll('#newModOptions .modifier-option-row');
+ const options = [];
+
+ optionRows.forEach(row => {
+ const optName = row.querySelector('.option-name').value.trim();
+ const optPrice = parseFloat(row.querySelector('.option-price').value) || 0;
+ if (optName) {
+ options.push({ name: optName, price: optPrice });
+ }
+ });
+
+ if (options.length === 0) {
+ alert('Please add at least one option');
+ return false;
+ }
+
+ config.extractedData.modifiers.push({
+ name: name,
+ required: required,
+ options: options,
+ appliesTo: 'uncertain'
+ });
+
+ return true;
+ }
+
+ function saveModifierAndAddAnother() {
+ if (saveCurrentModifier()) {
+ showAddModifierForm();
+ }
+ }
+
+ function saveModifierAndContinue() {
+ if (saveCurrentModifier()) {
+ showItemsStep();
+ }
+ }
+
function confirmModifiers() {
const list = document.getElementById('modifiersList');
const templates = list.querySelectorAll('.modifier-template');