Dawnline 0.12.0
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions

- The portal's traffic charts show what came down and what went up apart.
  A device's last 7 days and "Data this month" draw each day both ways:
  downloads rise above a thin line, uploads hang below it, on one scale.
  Beside them "↓ 3.2 GB ↑ 557 MB" instead of one total; hover a day for
  its own, its date where "left" stands
- Charts answer the pointer between their bars too, in the portal and in
  the admin's daily charts (a device's week, a device card's 30 days, the
  last 30 days): the figures no longer blink back to the total
- The calendar under "Access until" plays its days in only when the row is
  opened, not again each time the page refreshes with it open
- On a phone the page comes in from the top down: "Your access" first,
  then the devices
- "Show key" on a router's set-up morphs to "Hide key" with its icon, and
  brings the keys themselves into focus (it blurred the field names)
This commit is contained in:
Aemeath committed 2026-10-20 20:58:36 +03:00
1 parent 2f2aaf6c34
commit fb73ac3a9f
33 files changed
+396 -199

No files matched your search

+3 -2
View File
@@ -177,7 +177,8 @@ export async function openDevice(person: Person, dev: Device, o: DeviceOpts) {
E('span', { class: 'dl-sub' }, `${p.name} · ${kindLabel(d.kind)}`),
]),
]);
const week = d.spark.reduce((a, b) => a + b, 0);
const days = d.spark.map(([rx, tx]) => rx + tx);
const week = days.reduce((a, b) => a + b, 0);
dom.content(
stats,
E('div', { class: 'dl-dstats' }, [
@@ -193,7 +194,7 @@ export async function openDevice(person: Person, dev: Device, o: DeviceOpts) {
E('div', { class: 'dl-dstats-cell' }, [
E('span', { class: 'dl-metric-label' }, _('Last 7 days')),
E('b', {}, bytes(week)),
spark(d.spark, 120, 22, today),
spark(days, 120, 22, today),
]),
]),
);
+4 -1
View File
@@ -306,7 +306,10 @@ export class ServerOverview {
const st = this.st;
const off = st.servers[0] ? !st.servers[0].enabled : false;
const CAP = 12;
const today = (d: Device) => d.spark[d.spark.length - 1] ?? 0;
const today = (d: Device) => {
const [rx, tx] = d.spark[d.spark.length - 1] ?? [0, 0];
return rx + tx;
};
const cityOf = (d: Device) => st.geo.points.find((g) => g.device === d.id && g.city)?.city;
const home = (d: Device) => /^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/.test(d.endpoint ?? '');
// Where a device is: its city, or "LAN" when it connects from the home network (the hover
+1 -1
View File
@@ -600,7 +600,7 @@ export class PeoplePage {
usageSide(p: Person, actions: HTMLElement): HTMLElement {
const used = p.quota_used || p.month[0] + p.month[1];
const pct = p.quota_limit ? Math.min(100, (p.quota_used / p.quota_limit) * 100) : 0;
const today = p.devices.reduce((a, d) => a + (d.spark[d.spark.length - 1] ?? 0), 0);
const today = p.devices.reduce((a, d) => a + (d.spark[d.spark.length - 1] ?? [0, 0]).reduce((x, y) => x + y), 0);
const r = p.rate?.[p.rate.length - 1];
const live = p.online && r && this.st.now - r[0] < 180;
+8 -2
View File
@@ -243,10 +243,16 @@
background: var(--dl-elevated); border: 1px solid var(--dl-line); box-shadow: var(--shadow-xl, 0 8px 16px -4px rgba(0,0,0,.4)); pointer-events: none; z-index: 3; }
.dl-tip-title { font-weight: 500; }
.dl-tip-float { position: fixed; z-index: 2000; color: var(--dl-fg); }
.dl-spark i:hover { opacity: 1; filter: brightness(1.25); }
.dl-meter, .dl-slots { cursor: default; }
.dl-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--dl-fg-faint); margin-top: 6px; }
.dl-legend i.down { background: var(--dl-chart-1); } .dl-legend i.up { background: var(--dl-chart-2); }
.dl-spark { display: flex; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.dl-spark { display: flex; align-items: flex-end; flex: 0 0 auto; --dl-gap: 2px; }
.dl-spark i { flex: 1; display: block; border-radius: 2px 2px 0 0; background: var(--dl-chart-1); opacity: .85; }
.dl-spark i.zero { opacity: .22; }
.dl-spark > span:hover i:not(.zero) { opacity: 1; filter: brightness(1.25); }
/* A day's column in the daily charts (spark, a device card's bars, the last 30 days): the chart's full height and
half the gap on either side, so its tooltip answers above a short bar and between two bars. The outer columns
keep no outer half, so the bars stand where a plain gap would put them. */
.dl-spark > span, .dl-dbars > span, .dl-bento-bars > span { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0 calc(var(--dl-gap) / 2); }
.dl-spark > span:first-child, .dl-dbars > span:first-child, .dl-bento-bars > span:first-child { padding-left: 0; }
.dl-spark > span:last-child, .dl-dbars > span:last-child, .dl-bento-bars > span:last-child { padding-right: 0; }
+4 -4
View File
@@ -25,11 +25,11 @@
.dl-dcard-trend { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.dl-dcard-trend > .dl-stack { flex: none; }
.dl-dcard-trend b { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dl-dbars { flex: 1; min-width: 0; height: 32px; display: flex; align-items: flex-end; gap: 2px; }
.dl-dbars { flex: 1; min-width: 0; height: 32px; display: flex; align-items: flex-end; --dl-gap: 2px; }
.dl-dbars i { flex: 1; min-width: 0; border-radius: 2px; background: var(--dl-chart-1); opacity: .55; }
.dl-dbars i.zero { background: var(--dl-track); opacity: 1; }
.dl-dbars i.hi { opacity: 1; }
.dl-dbars i:hover { opacity: 1; filter: brightness(1.2); }
.dl-dbars > span:hover i { opacity: 1; filter: brightness(1.2); }
.dl-datechip { position: relative; display: inline-flex; }
.dl-date-hidden { position: absolute !important; left: 0; bottom: 0; width: 1px !important; min-width: 0 !important; height: 1px !important; opacity: 0; pointer-events: none; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.dl-chipbtn .dl-icon { width: 13px; height: 13px; }
@@ -147,10 +147,10 @@
.dl-meter i { width: 16px; height: 4px; border-radius: 2px; background: var(--dl-line); }
.dl-meter i.on { background: var(--dl-accent); }
.dl-bento-total { font-size: 16px; font-weight: 500; margin-left: 8px; }
.dl-bento-bars { display: flex; align-items: flex-end; gap: 3px; height: 54px; }
.dl-bento-bars { display: flex; align-items: flex-end; height: 54px; --dl-gap: 3px; }
.dl-bento-bars i { flex: 1; min-width: 0; border-radius: 3px 3px 0 0; background: var(--dl-soft-hover); transition: background .15s; }
.dl-bento-bars i.future { height: 4px; background: var(--dl-soft); }
.dl-bento-bars i:hover { background: var(--dl-fg-faint); }
.dl-bento-bars > span:hover i:not(.hi) { background: var(--dl-fg-faint); }
.dl-bento-bars i.hi { background: var(--dl-accent); }
@media (max-width: 700px) { .dl-addrbar { flex-wrap: wrap; } }
@media (max-width: 900px) { .dl-bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dl-bento-tile.online { grid-column: span 2; } }
+4 -2
View File
@@ -15,8 +15,10 @@ export function spark(values: number[], width = 120, height = 26, today = isoDay
const b = E('i');
b.style.height = `${Math.max(6, (v / max) * 100)}%`;
if (!v) b.classList.add('zero');
// The day's column carries the tooltip: it answers above a short bar and between two bars.
const col = E('span', {}, [b]);
const back = values.length - 1 - i;
attachTip(b, () => [
attachTip(col, () => [
E(
'div',
{ class: 'dl-tip-title' },
@@ -28,7 +30,7 @@ export function spark(values: number[], width = 120, height = 26, today = isoDay
),
E('div', { class: 'dl-muted' }, bytes(v)),
]);
el.appendChild(b);
el.appendChild(col);
});
return el;
}
+7 -4
View File
@@ -75,12 +75,14 @@ export function daysTile(series: DayUsage[], note: string): HTMLElement {
days.map((d, i) => {
const v = vals[i];
const bar = E('i', { class: i === days.length - 1 ? 'hi' : '', style: `height:${Math.max(4, (v / max) * 100)}%` });
attachTip(bar, () => [
// The day's column carries the tooltip: it answers above a short bar and between two bars.
const col = E('span', {}, [bar]);
attachTip(col, () => [
E('div', { class: 'dl-tip-title' }, i === days.length - 1 ? `${_('Today')} · ${dayLabel(d.day)}` : dayLabel(d.day)),
E('div', {}, bytes(v)),
E('div', { class: 'dl-muted dl-mono' }, `↓ ${bytes(d.tx)} ↑ ${bytes(d.rx)}`),
]);
return bar;
return col;
}),
);
return E('div', { class: 'dl-bento-tile month' }, [
@@ -108,11 +110,12 @@ export function dayBars(series: DayUsage[]): HTMLElement {
days.map((x, i) => {
const bar = E('i', { class: `${vals[i] ? '' : 'zero'}${i === days.length - 1 ? ' hi' : ''}` });
bar.style.height = `${Math.max(8, (vals[i] / max) * 100)}%`;
attachTip(bar, () => [
const col = E('span', {}, [bar]);
attachTip(col, () => [
E('div', { class: 'dl-tip-title' }, i === days.length - 1 ? `${_('Today')} · ${dayLabel(x.day)}` : dayLabel(x.day)),
E('div', {}, bytes(vals[i])),
]);
return bar;
return col;
}),
);
}