Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
1d7f931d
Commit
1d7f931d
authored
Mar 13, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web-api: two-column layout — gateways left, IPs/routes/whois right
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
c3468ac8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
route-web-api.py
router/route-web-api.py
+23
-18
No files found.
router/route-web-api.py
View file @
1d7f931d
...
...
@@ -780,6 +780,9 @@ HTML_PAGE = """\
.check-gw.block { background: #f8d7da; color: #721c24; }
.check-gw.proxy { background: #d1d5db; color: #6b7280; }
.check-gw.other { background: #fff3cd; color: #856404; }
.check-columns { display: flex; gap: 16px; margin-top: 8px; }
.check-col { flex: 1; min-width: 0; }
.check-col .check-section { margin-top: 0; }
.check-section { margin-top: 8px; }
.check-section-title { font-weight: 600; font-size: 0.85em; color: #666; margin-bottom: 4px; }
.check-ips { font-family: monospace; font-size: 0.85em; color: #333; }
...
...
@@ -1109,7 +1112,13 @@ function renderCheck(data) {
const container = $('check-gateways');
container.textContent = '';
// 1. Gateways (IPv4 + IPv6) — first, only when checks data present (domain mode)
// Two-column row: left = gateways, right = whois
const cols = mkDiv('check-columns');
const colGw = mkDiv('check-col');
colGw.id = 'check-col-gw';
const colInfo = mkDiv('check-col');
// Left column: Gateways (domain mode only, file_url mode fills via SSE)
if (data.checks && Object.keys(data.checks).length) {
const thr = data.throttle || {};
const spd = data.speed || {};
...
...
@@ -1143,38 +1152,32 @@ function renderCheck(data) {
}
}
gsec.appendChild(gwrap);
container.appendChild(gsec);
// Throttle detection
// Throttle detection
inline
if (Object.keys(thr).length) {
const tsec = mkDiv('check-section');
const slowGws = Object.entries(thr).filter(([,v]) => v.throttled);
if (slowGws.length) {
t
sec.appendChild(mkDiv('check-section-title', '
\\
u0417
\\
u0430
\\
u043c
\\
u0435
\\
u0434
\\
u043b
\\
u0435
\\
u043d
\\
u0438
\\
u0435 (
\\
u0422
\\
u0421
\\
u041f
\\
u0423)'));
g
sec.appendChild(mkDiv('check-section-title', '
\\
u0417
\\
u0430
\\
u043c
\\
u0435
\\
u0434
\\
u043b
\\
u0435
\\
u043d
\\
u0438
\\
u0435 (
\\
u0422
\\
u0421
\\
u041f
\\
u0423)'));
for (const [gw, info] of slowGws) {
const msg = gw + ': ' + info.asset + '
\\
u2014 ' + info.size + '
\\
u0431
\\
u0430
\\
u0439
\\
u0442
\\
u0437
\\
u0430 ' + info.time + '
\\
u0441';
const el = mkDiv('check-route', msg);
el.style.background = '#f8d7da';
el.style.color = '#721c24';
t
sec.appendChild(el);
g
sec.appendChild(el);
}
} else {
tsec.appendChild(mkDiv('check-section-title', '
\\
u0417
\\
u0430
\\
u043c
\\
u0435
\\
u0434
\\
u043b
\\
u0435
\\
u043d
\\
u0438
\\
u0435'));
tsec.appendChild(mkDiv('check-no-route', '
\\
u041d
\\
u0435
\\
u043e
\\
u0431
\\
u043d
\\
u0430
\\
u0440
\\
u0443
\\
u0436
\\
u0435
\\
u043d
\\
u043e'));
}
container.appendChild(tsec);
}
colGw.appendChild(gsec);
}
//
2. IP
s
//
Right column: IPs + routes + whoi
s
if (data.ips && data.ips.length) {
const sec = mkDiv('check-section');
sec.appendChild(mkDiv('check-section-title', 'IP-
\\
u0430
\\
u0434
\\
u0440
\\
u0435
\\
u0441
\\
u0430'));
sec.appendChild(mkDiv('check-ips', data.ips.join(', ')));
co
ntainer
.appendChild(sec);
co
lInfo
.appendChild(sec);
}
// 3. Routes — group by group/list, one line per list
const rsec = mkDiv('check-section');
rsec.appendChild(mkDiv('check-section-title', '
\\
u0412
\\
u0441
\\
u043f
\\
u0438
\\
u0441
\\
u043a
\\
u0430
\\
u0445
\\
u043c
\\
u0430
\\
u0440
\\
u0448
\\
u0440
\\
u0443
\\
u0442
\\
u043e
\\
u0432'));
if (data.routes && data.routes.length) {
...
...
@@ -1192,16 +1195,19 @@ function renderCheck(data) {
} else {
rsec.appendChild(mkDiv('check-no-route', '
\\
u041d
\\
u0435
\\
u043d
\\
u0430
\\
u0439
\\
u0434
\\
u0435
\\
u043d
\\
u043e
\\
u0432
\\
u0441
\\
u043f
\\
u0438
\\
u0441
\\
u043a
\\
u0430
\\
u0445
\\
u043c
\\
u0430
\\
u0440
\\
u0448
\\
u0440
\\
u0443
\\
u0442
\\
u043e
\\
u0432'));
}
co
ntainer
.appendChild(rsec);
co
lInfo
.appendChild(rsec);
// 4. Whois
if (data.whois && data.whois.length) {
const wsec = mkDiv('check-section');
wsec.appendChild(mkDiv('check-section-title', 'WHOIS'));
wsec.appendChild(mkDiv('check-whois', data.whois.join('
\\
n')));
co
ntainer
.appendChild(wsec);
co
lInfo
.appendChild(wsec);
}
cols.appendChild(colGw);
cols.appendChild(colInfo);
container.appendChild(cols);
$('check-result').className = 'check-result visible';
}
...
...
@@ -1259,8 +1265,7 @@ async function checkDomain() {
speedWrap = document.createElement('div');
speedWrap.className = 'check-gateways';
speedSection.appendChild(speedWrap);
const cg = $('check-gateways');
cg.insertBefore(speedSection, cg.firstChild);
$('check-col-gw').appendChild(speedSection);
}
} else if (evType === 'speed' && speedWrap) {
const gw = parsed.gateway;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment