14.04.2026 Update

This commit is contained in:
2026-04-15 11:38:26 +03:00
parent 6aa0349f5d
commit f50d79fab3
45 changed files with 5645 additions and 751 deletions

View File

@@ -279,15 +279,19 @@ function renderRules() {
const el = document.createElement('div');
el.className = 'rule-item';
el.innerHTML = `
<span class="rule-num">${i + 1}</span>
<div class="rule-info">
<span class="rule-type">${esc(type)}</span>
<span class="rule-value">${esc(value || (type === 'MATCH' ? '*' : ''))}</span>
<span class="rule-target">${esc(target)}</span>
${flags ? `<span class="rule-flags">${esc(flags)}</span>` : ''}
<span class="rule-value">${esc(value || (type === 'MATCH' ? '' : ''))}</span>
</div>
<div style="display:flex;gap:4px">
<button class="btn btn-danger btn-sm" data-delete-rule="${i}">✕</button>
</div>`;
<div class="rule-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="13" height="13"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
</div>
<span class="rule-target">${esc(target)}</span>
${flags ? `<span class="rule-flags">${esc(flags)}</span>` : ''}
<button class="btn-icon btn-icon-danger rule-del" data-delete-rule="${i}" title="Удалить">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><path d="M18 6L6 18M6 6l12 12"/></svg>
</button>`;
list.appendChild(el);
});
}
@@ -1893,6 +1897,7 @@ document.getElementById('clearLogsBtn').addEventListener('click', () => {
const DA = {
ws: null,
memWs: null,
trafficUp: 0,
trafficDown: 0,
totalUp: 0,
@@ -1941,6 +1946,10 @@ function closeDashWS() {
try { DA.ws.close(); } catch(e) {}
DA.ws = null;
}
if (DA.memWs) {
try { DA.memWs.close(); } catch(e) {}
DA.memWs = null;
}
}
function openDashWS() {
@@ -1960,6 +1969,19 @@ function openDashWS() {
ws.onclose = () => { DA.ws = null; };
DA.ws = ws;
} catch(e) {}
const memUrl = proto + '//' + location.host + '/api/mihomo/ws/memory';
try {
const ws = new WebSocket(memUrl);
ws.onmessage = (e) => {
try {
const d = JSON.parse(e.data);
DA.memory = d.inuse || 0;
} catch(err) {}
};
ws.onerror = () => {};
ws.onclose = () => { DA.memWs = null; };
DA.memWs = ws;
} catch(e) {}
}
let dashTrafficInterval = null;