Skip to content

Add Server Restart settings tab to admin panel#58

Merged
AdaInTheLab merged 1 commit into
mainfrom
feature/graceful-restart-ui
May 9, 2026
Merged

Add Server Restart settings tab to admin panel#58
AdaInTheLab merged 1 commit into
mainfrom
feature/graceful-restart-ui

Conversation

@AdaInTheLab
Copy link
Copy Markdown
Collaborator

Summary

UI surface for the `GracefulRestartFeature` backend that landed in #57. Now admins can configure scheduled restarts and trigger one-off restarts from the panel without touching the REST API or console.

What's in the tab

  • Master toggle: Enable Daily Restart
  • Schedule: time of day (HH:mm) + IANA timezone (text input — IANA list is too long for a Select)
  • Warning ladder: inline editable table with add/remove. Per row: minutes-before, message, BBGGRR color hex. Sorted descending on render so the first-firing step is on top
  • Restart Now panel on the right: lead-time input + a danger-styled button with `confirm()` prompt before kicking off

Layout mirrors the Vote Rewards tab — 2-col with schedule/ladder left, trigger right. Collapses to single col under 768px.

Files

File What
`frontend/src/api/restart.ts` REST client (3 endpoints)
`frontend/src/types/index.ts` `GracefulRestartSettings`, `RestartWarning`
`frontend/src/views/SettingsView.vue` New tab (value="10") + state + handlers + CSS
`frontend/src/i18n/locales/en.ts` Canonical strings
`frontend/src/i18n/locales/{ja,ko,zh-CN,zh-TW}.ts` English placeholders, "translations TBD"

Test plan

  • Pull, build, deploy
  • Hard-refresh panel → Settings tab list shows "Server Restart" after "Vote Rewards"
  • Tab loads with current backend settings (default ladder visible: 10 / 5 / 1 / 0)
  • Edit a step's message → Save → reload tab → change persists
  • Add a new step at 30 min → Save → confirm via `GET /api/restart/settings` it's in the JSON
  • Remove a step → Save → confirm gone
  • Toggle Enable on, set schedule to 12 minutes from now, Save
  • Wait → countdown plays in-game → server restarts → systemd brings it back
  • Click Restart Now with lead=2 → in-game broadcasts at 2/1/0 → shutdown → recover

🤖 Generated with Claude Code

UI surface for the GracefulRestartFeature backend that landed in #57.

What's in the tab:

- Master Enable Daily Restart toggle
- Schedule: time of day (HH:mm) + IANA timezone, side-by-side
- Inline ladder editor: add/remove steps, edit minutes-before, message,
  and BBGGRR color hex per row. Default ladder rendered descending so
  the top row is what fires first
- Restart Now panel on the right: lead-time input + danger button with
  a confirm() prompt before kicking off

Layout mirrors the Vote Rewards tab (2-col, schedule + ladder left,
trigger right). Collapses to single col under 768px.

i18n: canonical strings in en.ts; ja/ko/zh-CN/zh-TW carry English
placeholders with a "translations TBD" comment, same pattern as the
Vote Rewards roll-out (vue-i18n's structural typecheck requires same
shape across all locales, so faking shape > skipping locales).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AdaInTheLab AdaInTheLab merged commit 9dce9e0 into main May 9, 2026
2 checks passed
@AdaInTheLab AdaInTheLab deleted the feature/graceful-restart-ui branch May 9, 2026 11:20
AdaInTheLab added a commit that referenced this pull request May 13, 2026
Rolls up everything since v2.6.2 into a single release tag. v2.6.3
was bumped on main (#63) but never tagged or released — folding it
into v2.6.4 keeps the public release history clean.

Marquee additions since v2.6.2:

- Modpack (#64) — Bundle installed mods into a single zip players can
  download from the login page. No panel account required. Three-state
  workflow (draft → published → archived), top-right CTA on the login
  page, anonymous metadata + download endpoints. Atomic temp-file zip
  build so public downloaders can't grab a half-written archive.

- Graceful Restart (#57, #58) — Scheduled daily restarts with
  player-friendly in-game countdown warnings. Configurable warning
  ladder, IANA-timezone schedule (DST-aware), krestart console command,
  REST endpoints, panel Settings tab.

- Backups bug fix (#56) — BackupService had a redundant conn.Open()
  call that silently dropped writes due to a custom System.Data.SQLite
  quirk. Reads worked, so the bug went unnoticed until first hands-on
  test. Six call sites fixed, class doc comment added so future-me
  doesn't reintroduce it.

- German / French / Spanish locales (#59, #61, #62) — Full polite-form
  translations across ~250 keys / 30 namespaces. Browser auto-detect
  picks the right one for de-* / fr-* / es-* visitors. Tooltip on the
  language switcher noting that in-game broadcast messages don't
  auto-translate.

- Favicon (#60) — Regenerated all four favicon variants (svg / 16 /
  32 / ico) from kitsune-command-logo-transparent.png so the browser
  tab matches the panel's sidebar logo.

- README updates: features list now reflects all the above.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant