v0.1.8
This commit is contained in:
1 parent
b6e8ddb9c7
commit
818cae8592
12 files changed
+253
-33
No files matched your search
+10
-1
@@ -715,10 +715,19 @@
|
||||
['autodiscover.enabled', T('Włączony', 'Enabled'), 'bool'], ['autodiscover.require_auth', T('Wymagaj poprawnego hasła', 'Require valid password'), 'bool'],
|
||||
['autodiscover.server_url', T('Publiczny URL ActiveSync', 'Public ActiveSync URL'), 'text', { wide: true, ph: 'https://mail.example.com/Microsoft-Server-ActiveSync', help: T('Adres przekazywany telefonom. Puste = z nagłówka Host żądania (zwykle autodiscover.<domena>, co bywa błędne).', 'Address handed to phones. Empty = from the Host header of the request (usually autodiscover.<domain>, which is often wrong).') }],
|
||||
['autodiscover.domains', T('Domeny e-mail', 'E-mail domains'), 'list', { ph: 'example.com\nexample.org https://mail.example.org/Microsoft-Server-ActiveSync', help: T('Jedna domena na linię, opcjonalnie z własnym adresem ActiveSync po spacji (domyślnie: Publiczny URL powyżej). Gdy lista nie jest pusta, żądania dla innych domen są odrzucane (pusta = wszystkie domeny). Zapisz zmiany przed uruchomieniem diagnostyki.', 'One domain per line, optionally followed by its own ActiveSync URL after a space (default: the Public URL above). When the list is not empty, requests for other domains are refused (empty = all domains). Save before running diagnostics.') }],
|
||||
], `<div class="diag-bar"><button class="outline" id="diag-all">${T('Uruchom diagnostykę wszystkich domen', 'Run diagnostics for all domains')}</button><span class="fine" id="diag-hint"></span></div><div id="diag-out"></div>`),
|
||||
], `<div class="diag-bar"><button class="outline" id="diag-all">${T('Uruchom diagnostykę wszystkich domen', 'Run diagnostics for all domains')}</button><span class="fine" id="diag-hint"></span></div><div id="diag-out"></div><h3 class="sub-h">${T('Ostatnie żądania Autodiscover', 'Recent Autodiscover requests')}</h3><div class="diag-bar"><button class="outline" id="trace-refresh">${T('Odśwież', 'Refresh')}</button><span class="fine">${T('Nagłówki (bez haseł), treść żądania i odpowiedzi - do diagnozy telefonów. Ostatnie 30, tylko w pamięci.', 'Headers (no passwords), request and response bodies - for debugging phones. Last 30, memory only.')}</span></div><div id="trace-out"></div>`),
|
||||
{ bind: (form) => {
|
||||
const doms = (S.settings.autodiscover.domains || []).filter(Boolean).map((e) => e.trim().split(/[\s=]+/)[0].toLowerCase().replace(/\.$/, ''));
|
||||
const out = $('#diag-out', form);
|
||||
const traceOut = $('#trace-out', form);
|
||||
const loadTrace = async () => {
|
||||
try {
|
||||
const rows = await api('GET', '/api/autodiscover/trace');
|
||||
traceOut.innerHTML = rows.length ? rows.map((r) => `<details class="trace"><summary><span class="pill ${r.http === 200 ? 'ok' : 'warn'}">${r.http}</span> ${esc(new Date(r.ts * 1000).toLocaleTimeString())} ${esc(r.method)} ${esc(r.path)} <span class="fine">${esc(r.host)} - ${esc(r.ip)} - ${T('login', 'login')}: ${esc(r.typed_user || '-')} - ${r.ms} ms</span></summary><pre class="code">${esc(r.request_headers.join('\n'))}</pre><pre class="code">${esc(r.request_body || '(empty body)')}</pre><pre class="code">${esc(r.response_body)}</pre></details>`).join('') : `<div class="fine">${T('Brak żądań od ostatniego startu.', 'No requests since the last start.')}</div>`;
|
||||
} catch (err) { traceOut.innerHTML = `<div class="result bad">${esc(err.message)}</div>`; }
|
||||
};
|
||||
$('#trace-refresh', form).addEventListener('click', loadTrace);
|
||||
loadTrace();
|
||||
$('#diag-hint', form).textContent = doms.length ? doms.map((d) => '@' + d).join(' ') : T('Dodaj domeny i zapisz, aby uruchomić diagnostykę.', 'Add domains and save to run diagnostics.');
|
||||
$('#diag-all', form).disabled = !doms.length;
|
||||
$('#diag-all', form).addEventListener('click', async (e) => {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>ActivePush</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
||||
<style>
|
||||
:root { color-scheme: dark; --bg: #131615; --line: #323a34; }
|
||||
@media (prefers-color-scheme: light) { :root { color-scheme: light; --bg: #f2f4ee; --line: #cbd3c7; } }
|
||||
* { box-sizing: border-box; }
|
||||
html, body { height: 100%; margin: 0; }
|
||||
body { background: var(--bg); display: flex; align-items: center; justify-content: center; }
|
||||
.mark { display: block; width: 128px; height: 128px; border: 1px solid var(--line); border-radius: 28px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<svg class="mark" viewBox="0 0 64 64" role="img" aria-label="ActivePush"><rect width="64" height="64" fill="#1b1f1d"/><text x="32" y="41" text-anchor="middle" font-family="ui-monospace, SFMono-Regular, Consolas, monospace" font-size="24" font-weight="700" fill="#f69b74">a<tspan fill="#cfe0ac">/</tspan>p</text></svg>
|
||||
</body>
|
||||
</html>
|
||||
@@ -368,3 +368,6 @@ td.wrap { white-space: normal; max-width: 420px; }
|
||||
.sub-h { margin: 16px 0 6px; font-size: 13px; }
|
||||
pre.code { margin: 0 0 8px; padding: 9px 11px; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-control); font: 11px/1.55 var(--mono); overflow-x: auto; white-space: pre; user-select: all; }
|
||||
td.mono-cell { font-family: var(--mono); font-size: 11px; }
|
||||
details.trace { border-top: 1px solid var(--line); padding: 6px 0; }
|
||||
details.trace summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
details.trace pre.code { max-height: 260px; overflow: auto; margin: 6px 0; }
|
||||
Reference in new issue
Block a user