mirror of
https://github.com/andrey271192/Keenetic-Split-DNS.git
synced 2026-09-21 12:02:01 +00:00
fix: audit corrections
Fix YAML section parsing and upstream ID extraction in compile-config, detect-lan shell syntax, lighttpd CGI modules, API reload path, install idempotency, and dashboard log display. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
22
www/app.js
22
www/app.js
@@ -66,6 +66,23 @@
|
||||
document.getElementById('stat-url').textContent = s.url || '—';
|
||||
document.getElementById('topbar-sub').textContent = s.url ? s.url.replace('http://', '') + ' · lighttpd + CGI' : 'Keenetic Split DNS';
|
||||
if (s.web_port) document.getElementById('sidebar-port').textContent = s.web_port;
|
||||
const logEl = document.getElementById('log-container');
|
||||
if (logEl) {
|
||||
const lines = Array.isArray(s.logs) ? s.logs : [];
|
||||
if (lines.length) {
|
||||
logEl.innerHTML = lines
|
||||
.map((msg) => {
|
||||
const m = String(msg);
|
||||
const time = m.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/);
|
||||
return `<motion class="log-line"><span class="log-time">${esc(time ? time[1] : '—')}</span> ${esc(time ? m.slice(time[1].length).trim() : m)}</div>`;
|
||||
})
|
||||
.join('');
|
||||
} else if (s.last_apply) {
|
||||
logEl.innerHTML = `<motion class="log-line"><span class="log-time">—</span> ${esc(s.last_apply)}</motion>`;
|
||||
} else {
|
||||
logEl.innerHTML = '<div class="log-line"><span class="log-time">—</span> Журнал пуст — нажмите «Применить»</motion>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDomains() {
|
||||
@@ -221,6 +238,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('btn-add-upstream')?.addEventListener('click', () => {
|
||||
toast('Профили upstream задаются в config.yaml → upstreams');
|
||||
document.querySelector('.nav-item[data-tab="settings"]')?.click();
|
||||
});
|
||||
|
||||
document.getElementById('btn-export-domains')?.addEventListener('click', () => {
|
||||
const text = state.domains.map((x) => x.domain).join('\n');
|
||||
const a = document.createElement('a');
|
||||
|
||||
Reference in New Issue
Block a user