game-servers/app/static/style.css
neil 51db28f3d5
Rollback: restore a server's world from any of its backups, with a Current marker
Manage gets a Backup section (between World and Logs) listing the server's automatic and manual
backups. Rolling back is only allowed while the server is stopped and nothing else, such as an
automatic backup, is running on it; the server claims the busy flag atomically so the two can't race.
A run players were on is backed up first. The new world is extracted to a staging folder and checked
before the old one is deleted.

The backup that holds the world as it is now is marked Current (its button is disabled, and the
Backups page tags it). It's tracked in backups/<game>/<container>.current: set by automatic backups
and rollbacks, none while players have been on, newest automatic backup when there's no record.
Rolling back to an automatic backup can keep the Current backup as a manual one (or make one if
nothing is current), warning when that pushes out the oldest of 5 manual backups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:53:25 -08:00

237 lines
13 KiB
CSS

:root {
--bg: #0f1216;
--card: #181d23;
--border: #2a313a;
--text: #e6e9ed;
--muted: #8b95a1;
--accent: #e0a040;
--accent-text: #1a1206;
--ok: #4cc38a;
--warn: #e0a040;
--bad: #e5534b;
--bar: #262d36;
}
* { box-sizing: border-box; }
body {
margin: 0; background: var(--bg); color: var(--text);
font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
section { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 13px; }
.error { color: var(--bad); min-height: 1em; margin: 8px 0 0; }
code { font-size: 12px; word-break: break-all; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
button, a.button {
font: inherit; border-radius: 8px; padding: 8px 14px; cursor: pointer;
border: 1px solid var(--border); background: transparent; color: var(--text);
}
a.button { text-decoration: none; white-space: nowrap; display: inline-block; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
button.small { padding: 4px 10px; font-size: 13px; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea {
width: 100%; font: inherit; padding: 9px 11px; margin-top: 4px;
background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
}
input[type=file] { display: block; margin-top: 4px; max-width: 100%; color: var(--muted); }
label { display: block; margin-bottom: 14px; font-weight: 500; }
label.radio { display: flex; gap: 8px; align-items: center; font-weight: normal; margin-bottom: 8px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 0; }
legend { padding: 0 6px; color: var(--muted); }
/* login */
#login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
/* header */
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.header-actions { display: flex; gap: 8px; }
.brand { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); background: var(--card); box-shadow: 0 0 0 1px var(--border) inset; }
/* backups */
#backup-list { display: grid; gap: 12px; }
.backup-game h3 { font-size: 16px; margin: 0 0 4px; }
.backup-kind { margin-top: 12px; }
.backup-kind h4 { font-size: 14px; margin: 0 0 6px; }
.backups-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.backups-table th { text-align: left; color: var(--muted); font-weight: normal; padding: 0 8px 6px 0; }
.backups-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.backups-table a.button.small { padding: 4px 10px; font-size: 13px; }
.current-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px;
color: var(--ok); border: 1px solid currentColor; vertical-align: 1px; }
#about-backups h3 { font-size: 15px; margin: 16px 0 6px; }
.about-list { margin: 0; padding-left: 20px; font-size: 14px; }
.about-list li { margin: 4px 0; }
a { color: var(--accent); }
/* resources */
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .meters { grid-template-columns: 1fr; } }
.more-meters { margin-top: 14px; }
.more-toggle { display: flex; justify-content: center; margin: 10px 0 -8px; }
#resources-toggle { border: 0; color: var(--muted); }
#resources-toggle:hover { color: var(--text); }
.bw-controls { display: flex; align-items: center; gap: 8px; }
.bw-seconds { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: normal; color: var(--muted); }
#bw-seconds { width: 56px; margin: 0; padding: 3px 6px; font-size: 13px; }
.bw-detail { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 1em; }
.bw-detail.error { color: var(--bad); }
.meter-label { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; font-size: 13px; margin-bottom: 4px; }
.meter-label span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--bar); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--ok); transition: width .5s, background .5s; }
.graph { display: block; width: 100%; height: 12px; background: var(--bar); border-radius: 4px; }
.graph + .graph { margin-top: 3px; }
.graph .line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.graph .area { stroke: none; opacity: .25; }
.graph.rx .line { stroke: var(--ok); }
.graph.rx .area { fill: var(--ok); }
.graph.tx .line { stroke: #79c0ff; }
.graph.tx .area { fill: #79c0ff; }
.meter-label .rx { color: var(--ok); }
.meter-label .tx { color: #79c0ff; }
.section-title { margin: 24px 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
/* server cards */
#server-list { display: grid; gap: 12px; }
.server { display: flex; gap: 14px; align-items: flex-start; }
.server-body { display: grid; gap: 12px; flex: 1; min-width: 0; }
.server-art { width: 72px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; flex: none; background: var(--bar); }
@media (max-width: 520px) { .server-art { width: 52px; } }
.server-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.server-name { font-weight: 600; font-size: 16px; }
.server-meta { color: var(--muted); font-size: 13px; }
.copy-addr {
font: inherit; font-weight: 600; color: var(--text); background: none; border: 0; padding: 0; border-radius: 0;
text-decoration: underline; text-underline-offset: 2px; cursor: pointer; position: relative;
}
.copy-addr::after {
content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
padding: 3px 8px; font-size: 12px; font-weight: normal; white-space: nowrap; pointer-events: none;
opacity: 0; transition: opacity .15s;
}
.copy-addr:hover::after, .copy-addr:focus-visible::after, .copy-addr[data-tip="Copied!"]::after,
.copy-addr[data-tip="Copy failed"]::after { opacity: 1; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; margin-left: 6px; vertical-align: 2px; }
.badge.online { color: var(--ok); }
.badge.starting { color: var(--warn); }
.badge.stopped { color: var(--muted); }
.server-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; font-size: 13px; }
.server-stats .stat-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.server-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tip { display: inline-flex; }
.tip button:disabled { pointer-events: none; }
.server-players { font-size: 13px; color: var(--ok); margin-top: 2px; }
.server-players.none { color: var(--muted); }
.server-last-online { font-size: 13px; color: var(--muted); margin-top: 2px; }
.players-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.players-table th { text-align: left; color: var(--muted); font-weight: normal; padding: 0 8px 6px 0; }
.players-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border); }
.players-table td:first-child { word-break: break-all; }
/* dialogs */
dialog {
background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
padding: 20px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
dialog.wide { width: 95vw; max-width: 95vw; }
#mods-dialog.wide { width: min(1200px, 95vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.wiz-actions { display: flex; gap: 8px; margin-top: 16px; }
.spacer { flex: 1; }
.game-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.game-option { text-align: left; padding: 0; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.game-option:hover { border-color: var(--muted); }
.game-option-art { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; display: block; background: var(--bar); }
.game-option-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.game-option.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.preset-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; margin-top: 10px; }
.preset-mods label.radio { margin-bottom: 6px; align-items: flex-start; }
.preset-mods input { margin-top: 4px; }
.preset-meta { display: block; font-size: 12px; }
.preset-include { display: block; font-size: 12px; }
.presets-bar { margin-top: 8px; }
#review { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
#review dt { color: var(--muted); }
#review dd { margin: 0; word-break: break-all; }
.logs-head { display: flex; justify-content: space-between; align-items: center; }
#logs-body {
background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px;
font-size: 12px; height: 75vh; overflow: auto; margin-top: 12px; white-space: pre-wrap; word-break: break-all;
}
/* manage dialog */
.manage-section { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.manage-section h3 { font-size: 15px; margin: 0 0 10px; }
.row-end { display: flex; justify-content: flex-end; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.danger-zone h3 { color: var(--bad); }
.field-help { display: block; font-size: 12px; margin-top: 4px; }
.server-actions .manage-btn { margin-left: 6px; }
/* log viewer */
.logs-status { font-size: 12px; color: var(--muted); }
.logs-status.live { color: var(--ok); }
.logs-status.live::before { content: "● "; }
#logs-body { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.4; }
.log-error { color: #ff7b72; }
.log-warn { color: #e3b341; }
.log-info { color: #79c0ff; }
.log-debug { color: var(--muted); }
/* mod manager */
.mods-add { display: flex; gap: 8px; margin-top: 14px; }
.mods-add input { margin-top: 0 !important; }
.mods-import { margin-top: 8px; }
.mods-presets { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.mods-presets summary { cursor: pointer; }
.mods-import textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; margin: 6px 0; }
.mods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 760px) { .mods-grid { grid-template-columns: 1fr; } }
.mods-grid h3, #mods-issues-section h3 { font-size: 15px; margin: 8px 0; }
.mods-list { max-height: 45vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 0; }
.mod-item { border-bottom: 1px solid var(--border); padding: 8px 0; }
.mod-item:last-child { border-bottom: 0; }
.mod-item-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.mod-item-head img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.mod-item-title { flex: 1; min-width: 0; }
.mod-item-title a { color: var(--text); font-weight: 600; text-decoration: none; }
.mod-item-title a:hover { text-decoration: underline; }
.mod-row { margin: 4px 0 4px 6px; align-items: flex-start; }
.mod-row code, .mods-order code { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); margin-left: 4px; }
.tag-bad { color: var(--bad); border-color: var(--bad); }
.mods-order { padding-left: 32px; }
.mods-order li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.mods-order li:last-child { border-bottom: 0; }
.mods-order li { display: list-item; }
.mods-order li > .order-name { display: inline-block; max-width: calc(100% - 110px); word-break: break-all; }
.order-btns { float: right; display: inline-flex; gap: 4px; }
.mods-issues { margin: 0; padding-left: 20px; font-size: 13px; max-height: 25vh; overflow: auto; }
.mods-issues li { margin: 4px 0; }
.issue-error { color: var(--bad); }
.issue-warning { color: var(--warn); }
.msgs { display: grid; gap: 6px; margin-top: 8px; }
.msg { font-size: 13px; white-space: pre-line; border-left: 3px solid currentColor; padding: 6px 10px; border-radius: 4px; background: var(--bg); }
.msg-info { color: #79c0ff; }
.msg-success { color: var(--ok); }
.msg-warning { color: var(--warn); }
.msg-error { color: var(--bad); }
.msg-actions { margin-top: 6px; }
.mods-footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.mods-footer label { margin: 0; font-size: 13px; }