주변 와이파이 표기와 스크롤 정리
This commit is contained in:
+15
-13
@@ -1346,7 +1346,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const errors = Array.isArray(scan.errors) ? scan.errors : [];
|
||||
const observedMode = scan.observed_mode === 'all' ? t('wifiScanObservedAll') : `${scan.observed_hours || '-'}h`;
|
||||
const status = scan.enabled === false
|
||||
? `${t('wifiScanDisabledWithHistory')} · ${observedMode}`
|
||||
@@ -1361,7 +1360,7 @@
|
||||
const bandRows = networks.filter(row => row.band === band);
|
||||
return `
|
||||
<section class="wifi-scan-band" data-band="${attr(band)}">
|
||||
<h3>${escapeHtml(band)} <span>${bandRows.length}${scan.total_found ? ` / ${scan.total_found}` : ''}</span></h3>
|
||||
<h3>${escapeHtml(band)} <span>${bandRows.length}${state.lang === 'ko' ? '개' : ''}</span></h3>
|
||||
<div class="table-wrap compact">
|
||||
<table class="wifi-scan-table">
|
||||
<thead><tr><th>${escapeHtml(t('ssid'))}</th><th>BSSID</th><th>${escapeHtml(t('channel'))}</th><th>${escapeHtml(t('signal'))}</th><th>${escapeHtml(t('security'))}</th><th>${escapeHtml(t('observed'))}</th><th>WiFi</th><th>폭</th><th>속도</th><th>기능</th></tr></thead>
|
||||
@@ -1388,16 +1387,10 @@
|
||||
`;
|
||||
}).join('');
|
||||
|
||||
const errorHtml = errors.length
|
||||
? `<div class="wifi-scan-errors">${errors.map(row => `<div><strong>${escapeHtml(row.band || row.iface || '-')}</strong> ${escapeHtml(row.reason || '-')}</div>`).join('')}</div>`
|
||||
: '';
|
||||
|
||||
els.wifiScan.innerHTML = `
|
||||
<div class="wifi-scan-head">
|
||||
<h3>${escapeHtml(t('wifiScan'))}</h3>
|
||||
<span>${status}</span>
|
||||
</div>
|
||||
${errorHtml}
|
||||
<div class="wifi-scan-grid">${groups}</div>
|
||||
`;
|
||||
requestAnimationFrame(() => {
|
||||
@@ -1413,14 +1406,23 @@
|
||||
|
||||
function wifiObservedText(row) {
|
||||
if (row?.observed_source === 'live') {
|
||||
return row.last_seen_ms === null || row.last_seen_ms === undefined
|
||||
? '방금'
|
||||
: `방금 (${row.last_seen_ms}ms)`;
|
||||
return row?.last_seen_at ? `${timeAgo(secondsSinceLocalTime(row.last_seen_at))} · ${row.last_seen_at}` : '방금';
|
||||
}
|
||||
if (row?.last_seen_at) {
|
||||
return `${timeAgo(secondsSinceLocalTime(row.last_seen_at))} · ${row.last_seen_at}`;
|
||||
}
|
||||
if (row?.observed_age_seconds !== null && row?.observed_age_seconds !== undefined) {
|
||||
return `${timeAgo(row.observed_age_seconds)} · ${row.last_seen_at || '-'}`;
|
||||
return `${timeAgo(row.observed_age_seconds)} · -`;
|
||||
}
|
||||
return row?.last_seen_at || '-';
|
||||
return '-';
|
||||
}
|
||||
|
||||
function secondsSinceLocalTime(value) {
|
||||
const text = String(value || '').trim();
|
||||
if (!text) return 0;
|
||||
const parsed = new Date(text.includes('T') ? text : text.replace(' ', 'T'));
|
||||
if (Number.isNaN(parsed.getTime())) return 0;
|
||||
return Math.max(0, Math.floor((Date.now() - parsed.getTime()) / 1000));
|
||||
}
|
||||
|
||||
function wifiStandardText(row) {
|
||||
|
||||
Reference in New Issue
Block a user