Polish DHCP inactive time display
This commit is contained in:
+20
-2
@@ -1226,7 +1226,7 @@
|
||||
|
||||
function wifiRateCells(row) {
|
||||
if (row?.band === 'LAN') {
|
||||
return `<td colspan="2">${escapeHtml(wifiCellValue(row, 'tx_bitrate'))}</td>`;
|
||||
return `<td colspan="2" class="lan-link-speed">${escapeHtml(wifiCellValue(row, 'tx_bitrate'))}</td>`;
|
||||
}
|
||||
|
||||
return `${wifiMetricCell(row, 'tx_bitrate')}${wifiMetricCell(row, 'rx_bitrate')}`;
|
||||
@@ -1354,6 +1354,24 @@
|
||||
return formatDhms(parseWifiDurationSeconds(value)) || value;
|
||||
}
|
||||
|
||||
function wifiInactiveTime(value) {
|
||||
const text = String(value ?? '').trim();
|
||||
if (text === '' || text.toUpperCase() === 'N/A' || text === '-') {
|
||||
return '-';
|
||||
}
|
||||
|
||||
const msMatch = text.match(/^(\d+(?:\.\d+)?)\s*ms$/i);
|
||||
if (msMatch) {
|
||||
const ms = Number(msMatch[1]);
|
||||
if (Number.isFinite(ms) && ms <= 1000) {
|
||||
return `${Math.round(ms)} ms`;
|
||||
}
|
||||
return formatDhms(ms / 1000) || text;
|
||||
}
|
||||
|
||||
return formatDhms(parseWifiDurationSeconds(text)) || text;
|
||||
}
|
||||
|
||||
function wifiCellValue(row, key) {
|
||||
const value = row?.[key];
|
||||
const text = String(value ?? '').trim();
|
||||
@@ -1440,7 +1458,7 @@
|
||||
${wifiMetricCell(row, 'signal')}
|
||||
${wifiRateCells(row)}
|
||||
${td(wifiConnectedCellValue(row))}
|
||||
${td(wifiCellValue(row, 'inactive_time'))}
|
||||
${td(wifiInactiveTime(row.inactive_time))}
|
||||
</tr>
|
||||
`).join('')
|
||||
: `<tr><td colspan="9">${escapeHtml(t('noWifiClients'))}</td></tr>`;
|
||||
|
||||
Reference in New Issue
Block a user