diff --git a/server.py b/server.py
index 4159309..7088820 100644
--- a/server.py
+++ b/server.py
@@ -342,8 +342,9 @@ def _seed_if_empty(conn: sqlite3.Connection, table: str, columns: tuple, rows: l
def _seed_data(conn: sqlite3.Connection):
"""Insert default seed data for lookup tables."""
_seed_if_empty(conn, "categories", ("name", "icon"), [
- ("Furniture", "๐ช"), ("Appliances", "๐"),
- ("Utensils & Serveware", "๐ฝ๏ธ"), ("Equipment", "โ๏ธ"), ("Other", "๐ฆ"),
+ ("Bev", "๐ฅค"), ("Snack", "๐ฟ"),
+ ("Food", "๐"), ("Equipment", "๐ง"),
+ ("Appliances", "๐"), ("Other", "๐ฆ"),
])
_seed_if_empty(conn, "key_names", ("name",), [
("MK500",), ("Green Dot",), ("Red Key",), ("Blue Key",),
diff --git a/static/index.html b/static/index.html
index 962833e..cbfb95e 100644
--- a/static/index.html
+++ b/static/index.html
@@ -423,11 +423,13 @@
width: 64px; padding: 0 4px;
}
.asset-item .ai-icon .cat-icon-img { width: 32px; height: 32px; object-fit: contain; }
- .asset-item .ai-icon.cat-Furniture { background: #1a2e2a; }
+ .asset-item .ai-icon.cat-Bev { background: #0a3a65; }
+ .asset-item .ai-icon.cat-Snack { background: #3a2a10; }
+ .asset-item .ai-icon.cat-Food { background: #3a1a0a; }
+ .asset-item .ai-icon.cat-Equipment { background: #1a1a2e; }
.asset-item .ai-icon.cat-Appliances { background: #1a2a3e; }
- .asset-item .ai-icon.cat-Utensils---Serveware { background: #2a2510; }
- .asset-item .ai-icon.cat-Equipment { background: #2a1a2e; }
.asset-item .ai-icon.cat-Other { background: #1a1b26; }
+ .asset-item .ai-icon.cat-unmapped { background: #2a0a0a; }
.asset-item .ai-info { flex: 1; min-width: 0; }
.asset-item .ai-name { font-weight: 600; font-size: 15px; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asset-item .ai-company { font-weight: 600; font-size: 14px; line-height: 1.3; }
@@ -2557,7 +2559,7 @@
const el = document.getElementById('scanResult');
el.style.display = 'block';
el.innerHTML = `
-
${esc(asset.name)}
+ ${categoryInfo(asset.category).icon}${esc(asset.name)}
${esc(asset.machine_id)} ยท ${esc(catLabel(asset.category))} ยท
@@ -2853,9 +2855,10 @@
const asset = await api('/api/assets/search?machine_id=' + encodeURIComponent(machineId));
// Asset found โ update OCR result with asset info
const el = document.getElementById('ocrResult');
+ const oci = categoryInfo(asset.category);
el.innerHTML = `
${esc(asset.machine_id)} โ
-
${esc(asset.name)}
+
${oci.icon}${esc(asset.name)}
${esc(catLabel(asset.category))} ยท ${esc(asset.status)}
`;
setOcrStatus('Asset found!', 'success');
@@ -3141,17 +3144,21 @@
const CATEGORY_MAP = {
'Bev': { icon: '๐ฅค', color: '#0a7ab5' },
'Snack': { icon: '๐ฟ', color: '#c97d0e' },
- 'Food': { icon: '๐', color: '#b15a0a' },
- 'Other': { icon: '๐ฆ', color: '#6b7280' },
- 'Snack/bev': { icon: '๐ฅค๐ฟ', color: '#9b59b6', label: 'Snack & Bev', wide: true },
- 'Snack/food': { icon: '๐๐ฟ', color: '#9b59b6', label: 'Snack & Food', wide: true },
- 'Food': { icon: '๐', color: '#d35400' },
+ 'Food': { icon: '๐', color: '#e67e22' },
'Equipment': { icon: '๐ง', color: '#2c3e50' },
- 'Furniture': { icon: '๐ช', color: '#8e44ad' },
'Appliances': { icon: '๐', color: '#3b82f6' },
- 'Unknown': { icon: 'โ', color: '#6b7280' },
- 'GF Bev': { icon: '๐ฅค', color: '#0a7ab5' },
+ 'Other': { icon: '๐ฆ', color: '#6b7280' },
};
+ const CATEGORY_UNMAPPED_ICON = 'โ';
+ const CATEGORY_UNMAPPED_COLOR = '#b91c1c';
+ const CATEGORY_FALLBACK_ICON = '๐ฆ'; // null/missing category
+
+ function categoryInfo(cat) {
+ if (!cat) return { icon: CATEGORY_FALLBACK_ICON, color: '#6b7280', mapped: false };
+ const e = CATEGORY_MAP[cat];
+ if (e) return { icon: e.icon, color: e.color, mapped: true, wide: e.wide };
+ return { icon: CATEGORY_UNMAPPED_ICON, color: CATEGORY_UNMAPPED_COLOR, mapped: false };
+ }
const PARK_ICONS = {'magic-kingdom':'๐ฐ','epcot':'๐','hollywood-studios':'๐ฌ','animal-kingdom':'๐ฟ','disney-springs':'๐๏ธ','resort':'๐จ','office':'๐ข','other':'๐'};
const PARK_NAMES = {'magic-kingdom':'Magic Kingdom','epcot':'Epcot','hollywood-studios':'Hollywood Studios','animal-kingdom':'Animal Kingdom','disney-springs':'Disney Springs','resort':'Resort','office':'Office','other':'Other'};
@@ -3694,13 +3701,10 @@
return;
}
el.innerHTML = assets.filter(a => a.status !== 'retired').map(a => {
- const catEntry = CATEGORY_MAP[a.category];
- const icon = catEntry ? catEntry.icon : (a.category ? a.category.charAt(0).toUpperCase() : '๐ฆ');
- const catColor = catEntry ? catEntry.color : '#1a1b26';
- const iconWide = catEntry && catEntry.wide ? ' ai-icon-wide' : '';
+ const ci = categoryInfo(a.category);
return `
-
${icon}
+
${ci.icon}
${renderAssetCardContent(a)}