Commit Graph
10 Commits
Author SHA1 Message Date
c59c18de17 feat: add server online history tab with date-grouped chip wall (#97)
* feat(server-detail): add online history tab

Render per-server online periods from GET /api/v1/server/:id/online-history:
summary card (current status, online rate, total in window, last active),
daily online-time bars, and the raw period list. Window selector offers
1d/7d/30d and locks options beyond the server's max_days; guests hitting
the 1d cap see a login hint. i18n keys added for all locales (zh-CN/zh-TW
translated, others fall back to English for Weblate).

* fix(online-history): keep selector pills above the sliding indicator

The active-indicator overlay sits at z-10 and intercepted clicks on the
day pills; wrap pills at z-20 like the existing PeriodSelector.

* feat(online-history): render daily online as 24h timeline with hover tooltips

每日在线卡片从整日占比进度条改为 0:00–24:00 整轴时间条:
每个在线时段按当日时刻定位为高亮分段,hover 显示起止时间与时长;
进行中时段以亮色高亮。卡片顶部新增共享刻度(0:00 / 12:00 / 24:00)。

* feat(online-history): regroup periods by day as expandable chip wall

Rework the Online tab per the chip-wall design: periods are grouped by
panel-timezone day with per-day totals, defaulting to the latest day with
"Expand more" revealing up to ten more groups per click, plus an
Online/Offline switch that derives offline chips as the window complement.

- respond to the backend panel timezone (timezone/tz_offset): dayjs 1.11
  .tz(input, zone) ignores explicit offsets, so offset-bearing timestamps
  are parsed first and converted afterwards; naive date strings keep the
  zone-parse path (panelDay)
- guests falling back automatically: a rejected days>1 request locks 7d/30d
  and retries at 1d instead of surfacing only a login prompt
- fix day-selector indicator landing on the wrong pill: useActiveIndicator
  refs are stored by index, pass the map index not the day value
- disable Node experimental webstorage in vitest workers: Node >=25 ships a
  broken global localStorage that shadows the jsdom one
- 14 locales: tabSwitch.Online + serverOnlineHistory.*

* feat(online-history): boxed summary stats with desktop/mobile layouts

* fix(online-history): align offline gaps, DST coordinates and ongoing chips

- extract pure timeline/grouping helpers into src/lib/online-history.ts
- clamp offline complements to day and window boundaries, so a gap can no
  longer run into a later day's first online session
- use wall-clock coordinates and true next-midnight boundaries on DST days
- label only the segment ending at the live session end as Ongoing
- keep group totals equal to the visible chips for cross-day sessions
- keep period chips on one line and render next-midnight as 24:00
- add regression tests for multi-day offline gaps, window_start/window_end,
  spring-forward/fall-back geometry and ongoing clipping

* style(online-history): lighten summary metrics and shorten rate bar

* feat(online-history): refine UI and unify daily history rendering

---------

Co-authored-by: Sam5440 <Sam5440@users.noreply.github.com>
Co-authored-by: hamster1963 <1410514192@qq.com>
2026-10-22 12:01:21 +08:00
hamster1963 7821ce1131 feat: enhance server handling and add empty state messaging in Server component 2026-07-12 00:41:56 +08:00
hamster1963 ad0682bbf1 fix: add sorting labels and types for multiple languages in translation files 2026-06-01 15:20:35 +08:00
hamster1963 7d59371ee3 feat: add additional time period translations in serverDetailChart 2026-02-09 09:27:04 +08:00
hamster1963 18e3c74178 feat: add chart loading skeletons and enhance translation for time periods 2026-01-30 11:42:14 +08:00
hamster1963 29e349505d perf: use biome 2025-12-28 18:05:02 +08:00
hamster1963 1fda5ada9f feat: implement command context and provider for command handling; add search button component; enhance network chart with packet loss calculation and display; update translations for new features 2025-10-09 11:28:42 +08:00
aa4bf5618e Translated using Weblate (Russian) (#43)
Currently translated at 100.0% (101 of 101 strings)

Translated using Weblate (Spanish)

Currently translated at 100.0% (101 of 101 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (101 of 101 strings)



Translate-URL: https://hosted.weblate.org/projects/nezha/user-frontend/es/
Translate-URL: https://hosted.weblate.org/projects/nezha/user-frontend/ru/
Translate-URL: https://hosted.weblate.org/projects/nezha/user-frontend/zh_Hans/
Translation: Nezha/User frontend

Co-authored-by: Kris <krishoodbyair@gmail.com>
Co-authored-by: Yurt Page <yurtpage@gmail.com>
2025-05-19 09:18:44 +08:00
Weblate (bot)andbios let bc88a53170 Translated using Weblate (Russian) (#40)
Currently translated at 100.0% (101 of 101 strings)


Translate-URL: https://hosted.weblate.org/projects/nezha/user-frontend/ru/
Translation: Nezha/User frontend

Co-authored-by: bios let <bioslet@gmail.com>
2025-04-01 20:41:13 +08:00
Weblate (bot)andbios let a5268dc3ec Translated using Weblate (Russian) (#37)
Currently translated at 100.0% (97 of 97 strings)

Added translation using Weblate (Russian)



Translate-URL: https://hosted.weblate.org/projects/nezha/user-frontend/ru/
Translation: Nezha/User frontend

Co-authored-by: bios let <bioslet@gmail.com>
2025-03-21 14:43:09 +08:00