Skip to content

Add Server Restart settings tab to admin panel#58

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

Add Server Restart settings tab to admin panel#58
AdaInTheLab merged 1 commit intomainfrom
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 AdaInTheLab mentioned this pull request May 9, 2026
5 tasks
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