Files
mediamtx/internal/api/admin/app.css
T
QiuSW 6465a11074
lint / go (push) Canceled after 0s
lint / go_mod (push) Canceled after 0s
lint / conf (push) Canceled after 0s
lint / docslinks (push) Canceled after 0s
lint / docsorder (push) Canceled after 0s
lint / apidocs (push) Canceled after 0s
lint / other (push) Canceled after 0s
test / test_64 (push) Canceled after 0s
test / test_32 (push) Canceled after 0s
test / test_e2e (push) Canceled after 0s
feat: add embedded RTSP admin console (#3)
2026-08-28 11:24:47 +08:00

845 lines
13 KiB
CSS

:root {
color-scheme: light;
--background: #fafafa;
--surface: #ffffff;
--surface-muted: #f4f4f5;
--foreground: #09090b;
--secondary: #52525b;
--border: #e4e4e7;
--border-strong: #a1a1aa;
--accent: #2563eb;
--accent-hover: #1d4ed8;
--success: #166534;
--success-bg: #dcfce7;
--warning: #854d0e;
--warning-bg: #fef3c7;
--danger: #b91c1c;
--danger-hover: #991b1b;
--danger-bg: #fee2e2;
--focus: #1d4ed8;
--shadow: 0 12px 32px rgb(9 9 11 / 10%);
--radius: 10px;
--z-toast: 30;
}
* {
box-sizing: border-box;
}
html {
min-width: 320px;
background: var(--background);
font-family: "Segoe UI", Arial, sans-serif;
color: var(--foreground);
}
body {
min-height: 100dvh;
margin: 0;
font-size: 16px;
line-height: 1.5;
}
button,
input,
select {
font: inherit;
}
button,
select,
input[type="checkbox"] {
cursor: pointer;
touch-action: manipulation;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
outline: 3px solid rgb(37 99 235 / 35%);
outline-offset: 2px;
}
button:disabled {
cursor: not-allowed;
opacity: 0.5;
}
h1,
h2,
h3,
p {
margin-top: 0;
}
h1 {
margin-bottom: 2px;
font-size: clamp(1.5rem, 2vw, 1.9rem);
line-height: 1.2;
letter-spacing: -0.02em;
}
h2 {
margin-bottom: 4px;
font-size: 1.25rem;
}
h3 {
margin-bottom: 8px;
font-size: 1rem;
}
code {
font-family: Consolas, "Courier New", monospace;
font-size: 0.9em;
}
.skip-link {
position: fixed;
z-index: var(--z-toast);
top: 8px;
left: 8px;
padding: 10px 14px;
border-radius: 6px;
color: #ffffff;
background: var(--foreground);
transform: translateY(-150%);
}
.skip-link:focus {
transform: translateY(0);
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
width: min(100% - 48px, 1360px);
margin: 0 auto;
padding: 28px 0 20px;
}
.eyebrow {
margin-bottom: 2px;
color: var(--secondary);
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.subtitle,
.panel-heading p,
.helper {
margin-bottom: 0;
color: var(--secondary);
}
.subtitle {
font-size: 0.875rem;
}
.topbar-actions,
.modal-actions,
.row-actions,
.preview-tabs {
display: flex;
align-items: center;
gap: 8px;
}
.button,
.icon-button,
.tab {
min-height: 44px;
border: 1px solid transparent;
border-radius: 7px;
padding: 9px 14px;
font-weight: 650;
transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.button-primary {
border-color: var(--accent);
color: #ffffff;
background: var(--accent);
}
.button-primary:hover {
background: var(--accent-hover);
}
.button-secondary,
.icon-button,
.tab {
border-color: var(--border);
color: var(--foreground);
background: var(--surface);
}
.button-secondary:hover,
.icon-button:hover,
.tab:hover {
background: var(--surface-muted);
}
.button-danger {
border-color: var(--danger);
color: #ffffff;
background: var(--danger);
}
.button-danger:hover {
background: var(--danger-hover);
}
.icon-button {
min-width: 64px;
}
.status-pill,
.path-status {
display: inline-flex;
align-items: center;
min-height: 30px;
border-radius: 999px;
padding: 4px 11px;
font-size: 0.8rem;
font-weight: 700;
white-space: nowrap;
}
.status-pill::before,
.path-status::before {
width: 7px;
height: 7px;
margin-right: 7px;
border-radius: 50%;
background: currentColor;
content: "";
}
.status-loading,
.status-idle {
color: var(--warning);
background: var(--warning-bg);
}
.status-ok,
.status-online {
color: var(--success);
background: var(--success-bg);
}
.status-error,
.status-offline {
color: var(--danger);
background: var(--danger-bg);
}
.page {
width: min(100% - 48px, 1360px);
margin: 0 auto;
padding-bottom: 48px;
}
.stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 14px;
margin: 12px 0 24px;
}
.stat-card,
.paths-panel {
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface);
}
.stat-card {
min-height: 98px;
padding: 18px 20px;
}
.stat-card span {
display: block;
margin-bottom: 6px;
color: var(--secondary);
font-size: 0.82rem;
font-weight: 650;
}
.stat-card strong {
font-size: 1.75rem;
font-variant-numeric: tabular-nums;
}
.paths-panel {
overflow: hidden;
}
.panel-heading {
display: flex;
align-items: end;
justify-content: space-between;
gap: 24px;
padding: 20px 22px;
border-bottom: 1px solid var(--border);
}
.panel-heading p {
font-size: 0.82rem;
}
.filters {
display: flex;
align-items: end;
gap: 10px;
}
.filters label,
.field {
display: grid;
gap: 6px;
}
.filters label > span,
.field > label {
font-size: 0.82rem;
font-weight: 650;
}
input,
select {
min-height: 44px;
border: 1px solid var(--border-strong);
border-radius: 7px;
padding: 9px 11px;
color: var(--foreground);
background: var(--surface);
}
input[readonly] {
cursor: default;
color: var(--secondary);
background: var(--surface-muted);
}
.search-field input {
width: min(28vw, 280px);
}
.page-alert,
.form-alert {
border: 1px solid #fecaca;
border-radius: 8px;
color: var(--danger);
background: #fff7f7;
}
.page-alert {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin: 18px 22px 0;
padding: 14px 16px;
}
.page-alert p,
.form-alert {
margin-bottom: 0;
font-size: 0.875rem;
}
.loading-state,
.empty-state {
display: grid;
place-items: center;
min-height: 310px;
padding: 40px 20px;
text-align: center;
}
.loading-state {
align-content: center;
grid-auto-flow: column;
gap: 12px;
color: var(--secondary);
}
.spinner {
width: 20px;
height: 20px;
border: 3px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 700ms linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.empty-state p {
max-width: 520px;
color: var(--secondary);
}
.table-wrap {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
th,
td {
padding: 14px 16px;
border-bottom: 1px solid var(--border);
text-align: left;
vertical-align: middle;
}
th {
color: var(--secondary);
background: var(--surface-muted);
font-size: 0.78rem;
font-weight: 700;
}
th:nth-child(1) { width: 15%; }
th:nth-child(2) { width: 10%; }
th:nth-child(3) { width: 33%; }
th:nth-child(4) { width: 9%; }
th:nth-child(5) { width: 8%; }
th:nth-child(6) { width: 25%; }
td {
font-size: 0.875rem;
}
tbody tr:last-child td {
border-bottom: 0;
}
.path-name {
font-weight: 700;
overflow-wrap: anywhere;
}
.source-address {
display: block;
overflow: hidden;
color: var(--secondary);
font-family: Consolas, "Courier New", monospace;
font-size: 0.8rem;
text-overflow: ellipsis;
white-space: nowrap;
}
.readers {
font-variant-numeric: tabular-nums;
}
.row-actions {
justify-content: flex-end;
flex-wrap: wrap;
}
.row-actions .button {
min-height: 38px;
padding: 6px 10px;
font-size: 0.8rem;
}
.card-list {
display: none;
}
.modal {
width: min(720px, calc(100% - 32px));
max-height: calc(100dvh - 32px);
margin: auto;
border: 1px solid var(--border);
border-radius: 12px;
padding: 0;
color: var(--foreground);
background: var(--surface);
box-shadow: var(--shadow);
}
.modal::backdrop {
background: rgb(9 9 11 / 55%);
}
.modal form,
.modal > div:not(.modal-header),
.modal > p,
.modal > aside {
margin-right: 0;
}
.modal form {
padding: 22px;
}
.modal > .modal-header,
.modal > .preview-tabs,
.modal > .preview-layout {
margin-right: 22px;
margin-left: 22px;
}
.modal > .modal-header {
margin-top: 22px;
}
.modal-header {
display: flex;
align-items: start;
justify-content: space-between;
gap: 24px;
margin-bottom: 20px;
}
.modal-header h2 {
margin-bottom: 0;
}
.form-alert {
margin-bottom: 18px;
padding: 11px 13px;
}
.field + .field,
.field-grid {
margin-top: 18px;
}
.helper,
.field-error {
font-size: 0.78rem;
}
.field-error {
min-height: 1.2em;
margin: 0;
color: var(--danger);
font-weight: 600;
}
.password-field {
display: grid;
grid-template-columns: 1fr auto;
gap: 8px;
}
.field-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 18px;
}
.switch-field {
display: flex;
align-items: center;
min-height: 72px;
gap: 12px;
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
cursor: pointer;
}
.switch-field input {
width: 22px;
min-height: 22px;
margin: 0;
accent-color: var(--accent);
}
.switch-field strong,
.switch-field small {
display: block;
}
.switch-field small {
color: var(--secondary);
}
.modal-actions {
justify-content: flex-end;
margin-top: 24px;
padding-top: 18px;
border-top: 1px solid var(--border);
}
.modal-small {
width: min(520px, calc(100% - 32px));
}
.modal-small p {
line-height: 1.65;
}
.danger-text {
color: var(--danger);
}
.modal-wide {
width: min(1180px, calc(100% - 32px));
padding-bottom: 22px;
}
.preview-tabs {
margin-bottom: 14px;
}
.tab[aria-selected="true"] {
border-color: var(--accent);
color: #ffffff;
background: var(--accent);
}
.preview-layout {
display: grid;
grid-template-columns: minmax(0, 1fr) 310px;
gap: 18px;
}
.preview-frame-wrap {
min-width: 0;
}
#preview-frame {
display: block;
width: 100%;
min-height: 460px;
border: 0;
border-radius: 9px;
background: #111827;
}
.preview-frame-wrap .helper {
margin-top: 8px;
}
.output-panel {
border: 1px solid var(--border);
border-radius: 9px;
padding: 16px;
background: var(--surface-muted);
}
.output-item + .output-item {
margin-top: 16px;
}
.output-item label {
display: block;
margin-bottom: 5px;
font-size: 0.78rem;
font-weight: 700;
}
.output-value {
display: block;
margin-bottom: 7px;
overflow-wrap: anywhere;
color: var(--secondary);
font-family: Consolas, "Courier New", monospace;
font-size: 0.76rem;
}
.output-item .button {
width: 100%;
}
.toast {
position: fixed;
z-index: var(--z-toast);
right: 20px;
bottom: 20px;
max-width: min(420px, calc(100% - 40px));
border-radius: 8px;
padding: 13px 16px;
color: #ffffff;
background: var(--foreground);
box-shadow: var(--shadow);
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
clip-path: inset(50%);
white-space: nowrap;
}
[hidden] {
display: none !important;
}
@media (max-width: 900px) {
.topbar,
.panel-heading {
align-items: stretch;
flex-direction: column;
}
.topbar-actions {
flex-wrap: wrap;
}
.stats {
grid-template-columns: repeat(2, 1fr);
}
.filters,
.filters label,
.search-field input {
width: 100%;
}
.preview-layout {
grid-template-columns: 1fr;
}
#preview-frame {
min-height: 380px;
}
}
@media (max-width: 700px) {
.topbar,
.page {
width: min(100% - 32px, 1360px);
}
.topbar {
padding-top: 20px;
}
.topbar-actions .status-pill {
width: 100%;
justify-content: center;
}
.topbar-actions .button {
flex: 1;
}
.stats {
gap: 10px;
}
.stat-card {
min-height: 88px;
padding: 14px;
}
.panel-heading {
padding: 18px 16px;
}
.filters {
align-items: stretch;
flex-direction: column;
}
.table-wrap {
display: none;
}
.card-list {
display: grid;
gap: 12px;
padding: 14px;
}
.path-card {
border: 1px solid var(--border);
border-radius: 9px;
padding: 16px;
}
.path-card-heading {
display: flex;
align-items: start;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.path-card .source-address {
margin-bottom: 12px;
overflow: visible;
text-overflow: initial;
white-space: normal;
}
.path-card-meta {
margin-bottom: 14px;
color: var(--secondary);
font-size: 0.82rem;
}
.row-actions {
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.row-actions .button {
min-height: 44px;
}
.field-grid,
.password-field {
grid-template-columns: 1fr;
}
.modal {
width: calc(100% - 20px);
max-height: calc(100dvh - 20px);
}
.modal form {
padding: 18px;
}
.modal > .modal-header,
.modal > .preview-tabs,
.modal > .preview-layout {
margin-right: 16px;
margin-left: 16px;
}
.modal > .modal-header {
margin-top: 16px;
}
#preview-frame {
min-height: 280px;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}