left4me/l4d2web/static/css/components.css
mwiegand 923a1840f4
feat(web): forms in modals, edit/delete on detail pages, port auto-assign
- Native <dialog> modal infra (CSS + ~30 LOC JS, no framework) used for
  create forms and delete confirmations.
- Index pages become listing-only: + Create button opens a modal; the
  broken blueprint Actions column and inline overlay edit cells are gone.
- Server detail gains a blueprint reassignment form; existing Delete
  button now opens a confirmation modal before tearing down the runtime.
- Blueprint detail gains a Delete button + confirmation modal (was
  unreachable from the UI before).
- New overlay detail page at /overlays/<id> with edit form, "Used by"
  blueprints list, and delete (admin only).
- Server create: port field is now optional; backend auto-assigns the
  next free port from LEFT4ME_PORT_RANGE_START/_END (default
  27015-27115). 409 on range exhaustion.
- New routes: POST /blueprints/<id>/delete (form sentinel matching
  overlays pattern), POST /servers/<id> (form-friendly blueprint
  reassign), GET /overlays/<id>.
- Server delete operation now redirects to /servers; overlay update
  redirects to /overlays/<id>.

Server rename remains unsupported pending an id-vs-name design pass for
l4d2host (the runtime directory is name-keyed; renaming would orphan
files).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 01:30:33 +02:00

186 lines
2.7 KiB
CSS

.panel,
.card {
background: var(--color-surface);
border: var(--line);
border-radius: var(--radius-m);
padding: var(--space-l);
margin-bottom: var(--space-l);
}
.table {
width: 100%;
border-collapse: collapse;
}
.table th,
.table td {
text-align: left;
padding: var(--space-s) var(--space-m);
border-bottom: var(--line);
}
.muted {
color: var(--color-muted);
}
.stack {
display: grid;
gap: var(--space-m);
}
input,
button,
select,
textarea {
font: inherit;
}
label {
display: grid;
gap: var(--space-xs);
}
input,
select,
textarea {
background: var(--color-surface);
border: var(--line);
border-radius: var(--radius-s);
color: var(--color-text);
padding: var(--space-s) var(--space-m);
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
outline: 2px solid var(--color-focus);
outline-offset: 2px;
}
button {
background: var(--color-primary);
border: none;
border-radius: var(--radius-s);
color: #fff;
padding: var(--space-s) var(--space-l);
cursor: pointer;
}
button.danger {
background: var(--color-danger);
}
.link-button {
background: none;
border: none;
color: var(--color-link);
padding: 0;
text-decoration: underline;
cursor: pointer;
}
.inline-form {
display: inline;
}
.auth-panel {
max-width: 28rem;
}
dialog.modal {
background: var(--color-surface);
color: var(--color-text);
border: var(--line);
border-radius: var(--radius-m);
padding: 0;
width: min(32rem, 90vw);
max-height: 90vh;
}
dialog.modal::backdrop {
background: rgba(0, 0, 0, 0.45);
}
.modal-header,
.modal-body,
.modal-footer {
padding: var(--space-l);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: var(--line);
}
.modal-header h2 {
margin: 0;
font-size: 1.1rem;
}
.modal-body {
display: grid;
gap: var(--space-m);
overflow-y: auto;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: var(--space-m);
border-top: var(--line);
}
.modal-close {
background: none;
color: var(--color-muted);
padding: var(--space-xs) var(--space-s);
font-size: 1.25rem;
line-height: 1;
}
.button-secondary {
background: var(--color-surface);
color: var(--color-text);
border: var(--line);
}
.field-hint {
color: var(--color-muted);
font-size: 0.875rem;
}
.page-heading {
display: flex;
justify-content: space-between;
align-items: center;
gap: var(--space-m);
margin-bottom: var(--space-l);
}
.page-heading h1,
.page-heading h2 {
margin: 0;
}
.button-row {
display: flex;
gap: var(--space-s);
flex-wrap: wrap;
}
.detail-grid {
display: grid;
gap: var(--space-l);
}
.used-by-list {
list-style: none;
padding: 0;
margin: 0;
display: grid;
gap: var(--space-s);
}