Commit Graph
33 Commits
Author SHA1 Message Date
Codex e74143b827 Merge upstream v2.5.1 while preserving domain dashboard extensions 2026-10-22 23:50:03 +08:00
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
Bot b1ccf11634 feat: custom domain management, status monitor, and theme/styling integration 2026-09-01 23:51:42 +08:00
Copilot 9f2f6d9d29 Set build target to safari15 for iOS Safari compatibility (#76)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-02 17:44:52 +08:00
hamster1963 5720af9108 test: add unit tests for various components and utilities
- Created tests for formatBytes function to ensure correct formatting of byte values.
- Implemented tests for InjectContext to validate resource injection and cleanup.
- Added tests for logo-class helpers to verify platform alias mappings.
- Developed tests for nezha-api functions to check API response handling.
- Introduced tests for static geographic data to validate country coordinates and GeoJSON structure.
- Created comprehensive tests for utility functions including date formatting and public note parsing.
- Added tests for Server page to ensure correct rendering and functionality.
- Implemented tests for simple pages including error handling and navigation.
- Set up testing environment with Vitest and configured coverage reporting.
2026-06-15 11:29:48 +08:00
hamster1963 a1b382c3eb fix: update dependencies in package.json to latest versions 2026-05-25 01:42:43 +08:00
hamster1963 f7662d2751 chore: add CI workflow and update dependencies in package.json and vite.config.ts 2026-04-02 17:17:16 +08:00
hamster1963 29e349505d perf: use biome 2025-12-28 18:05:02 +08:00
hamster1963 d4f6db436a feat: add PWA support with manifest, icons, and theme color management 2025-02-13 11:21:53 +08:00
hamster1963 9a2f3ea8e6 fix: prettier config 2024-12-13 17:26:28 +08:00
hamster1963 a448e5eb0d fix: dev cache 2024-12-09 09:21:20 +08:00
hamster1963 396133893e fix: remove pwa deps 2024-12-06 23:47:27 +08:00
hamster1963 73cc1b64b9 fix: remove pwa 2024-12-06 23:45:08 +08:00
hamster1963 591d82b717 fix: ignore swagger path 2024-12-06 23:41:50 +08:00
hamster1963 560bcea0b8 fix: inline card server name overflow 2024-12-06 09:49:02 +08:00
hamster1963 8261bd841e fix: remove VITE_APP_VERSION 2024-12-06 09:01:55 +08:00
hamster1963 3f53b9db80 fix: dashboard fallback 2024-12-05 10:26:02 +08:00
hamster1963 9073fa6429 fix: pwa cache 2024-12-05 10:20:45 +08:00
hamster1963 8228fab2fe feat: global map 2024-12-04 10:03:37 +08:00
hamster1963 8010b69d79 fix(overview): text display 2024-12-03 23:51:24 +08:00
hamster1963 b84be53ab8 feat: add hash tag 2024-12-03 15:16:36 +08:00
hamster1963 66b474c5de fix: pwa color 2024-12-02 23:12:55 +08:00
hamster1963 59ec052374 fix: chart button width 2024-12-02 23:07:01 +08:00
hamster1963 0e24c37220 fix: baseurl 2024-12-02 17:53:07 +08:00
hamster1963 ff25eb056c feat: init pwa 2024-12-02 17:10:54 +08:00
hamster1963 a9186f1148 refactor: websocket connect 2024-12-02 02:15:46 +08:00
hamster1963 2462dfc21b feat: service tracker 2024-11-29 09:00:04 +08:00
hamster1963 ee9419cccc perf: manual chunking 2024-11-27 14:50:55 +08:00
hamster1963 fb38b0eb8a feat: server group 2024-11-24 01:45:33 +08:00
hamster1963 2e06f22a86 fix: lint 2024-11-23 19:34:14 +08:00
hamster1963 963b6a54a6 feat: server page 2024-11-23 19:28:55 +08:00
hamster1963 d1558b71c4 fix: websocket proxy 2024-11-23 17:31:18 +08:00
hamster1963 e5682aacbd update: init 2024-11-22 22:20:38 +08:00