diff --git a/static/index.html b/static/index.html index eb152df..d105040 100644 --- a/static/index.html +++ b/static/index.html @@ -416,6 +416,10 @@ .asset-item .ai-icon.cat-Other { background: #1a1b26; } .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; } + .asset-item .ai-location-line { font-size: 12px; color: var(--text2); margin-top: 1px; display: flex; gap: 4px; flex-wrap: wrap; } + .asset-item .ai-location-line .tag { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; } + .asset-item .ai-building { font-size: 12px; color: var(--text1); margin-top: 2px; } .asset-item .ai-address { font-size: 12px; color: var(--text2); margin-top: 2px; } .asset-item .ai-location { font-size: 13px; color: var(--text1); font-weight: 500; margin-top: 3px; } .asset-item .ai-meta { font-size: 12px; color: var(--text2); margin-top: 3px; } @@ -2431,7 +2435,14 @@ try { const asset = await api(`/api/assets/search?machine_id=${encodeURIComponent(machineId)}`); - showScannedAsset(asset); + // Asset exists — go directly to its detail view + showToast(`${esc(asset.name)} — showing details`, false); + // Auto-checkin if GPS available (background, non-blocking) + if (AppState.gpsLat != null) { + doAutoCheckin(asset.id); + } + switchTab('tabAssets'); + viewAsset(asset.id); } catch (e) { if (e.message === 'Asset not found' || e.message.includes('404')) { showNewAssetForm(machineId); @@ -2498,7 +2509,12 @@ function showNewAssetForm(machineId) { currentScannedMachineId = machineId; - setScanStatus('Machine ID not in database — create asset below', 'error'); + switchTab('tabAddAsset'); + // Defer status update so it runs after async startScanning completes + setTimeout(() => { + setScanStatus('Machine ID not in database — create asset below', 'error'); + }, 50); + document.getElementById('newMachineId').value = machineId; document.getElementById('newName').value = ''; @@ -3702,9 +3718,7 @@