Files
meshtastic_mqtt_server/meshmap_frontend/src/style.css
T
2026-06-04 14:23:17 +08:00

841 lines
13 KiB
CSS

:root {
font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
color: #172033;
background: #edf2f7;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
margin: 0;
}
button {
font: inherit;
}
button:not(:disabled) {
cursor: pointer;
}
.app-shell {
min-height: 100vh;
box-sizing: border-box;
display: grid;
grid-template-rows: auto auto 1fr auto;
gap: 12px;
padding: 14px;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 14px 18px;
border: 1px solid #dbe4ef;
border-radius: 16px;
background: #fff;
box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}
.topbar-actions {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: flex-end;
gap: 10px;
}
.eyebrow {
margin: 0 0 5px;
color: #64748b;
text-transform: uppercase;
letter-spacing: 0.12em;
font-size: 12px;
font-weight: 700;
}
h1,
h2,
h3 {
margin: 0;
}
h1 {
font-size: 32px;
line-height: 1;
}
h2 {
font-size: 18px;
}
h3 {
font-size: 14px;
color: #475569;
}
.topbar button,
.topbar-link {
border: 0;
border-radius: 10px;
padding: 9px 16px;
background: #2563eb;
color: white;
font-weight: 700;
}
.topbar-link {
text-decoration: none;
}
.topbar button:disabled {
opacity: 0.6;
}
.status-pill,
.counter,
.badge {
display: inline-flex;
align-items: center;
border-radius: 999px;
padding: 6px 10px;
font-size: 13px;
font-weight: 700;
color: #92400e;
background: #fffbeb;
}
.status-pill.ok {
color: #166534;
background: #dcfce7;
}
.counter,
.badge {
color: #334155;
background: #e2e8f0;
}
.error {
padding: 12px 16px;
border: 1px solid #fecaca;
border-radius: 14px;
color: #b91c1c;
background: #fef2f2;
}
.workspace {
min-height: 560px;
display: grid;
grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
gap: 12px;
}
.panel {
position: relative;
overflow: hidden;
border: 1px solid #dbe4ef;
border-radius: 16px;
background: #fff;
box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 14px 16px;
border-bottom: 1px solid #e2e8f0;
}
.chat-panel {
display: flex;
flex-direction: column;
min-height: 0;
max-height: 560px;
overflow-y: auto;
}
.chat-panel .panel-header {
position: sticky;
z-index: 10;
top: 0;
background: #fff;
}
.chat-loading,
.chat-end {
padding: 10px 16px;
border-bottom: 1px solid #e2e8f0;
color: #64748b;
font-size: 13px;
text-align: center;
background: #f8fafc;
}
.chat-item {
display: grid;
gap: 6px;
width: 100%;
border: 0;
border-bottom: 1px solid #e2e8f0;
padding: 13px 16px;
text-align: left;
color: inherit;
background: transparent;
}
.chat-item:hover,
.chat-item.selected {
background: #eff6ff;
}
.chat-meta {
display: flex;
justify-content: space-between;
gap: 12px;
color: #334155;
}
.chat-meta small,
.chat-host,
.muted {
color: #64748b;
}
.chat-topic {
color: #64748b;
font-size: 12px;
line-height: 1.2;
word-break: break-all;
}
.chat-text {
color: #0f172a;
line-height: 1.35;
}
.context-menu {
position: fixed;
z-index: 2000;
min-width: 120px;
border: 1px solid #dbe4ef;
border-radius: 10px;
padding: 6px;
background: #fff;
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}
.context-menu button,
.context-menu a {
display: block;
width: 100%;
box-sizing: border-box;
border: 0;
border-radius: 8px;
padding: 8px 10px;
text-align: left;
color: inherit;
text-decoration: none;
font: inherit;
background: transparent;
}
.context-menu button:hover,
.context-menu a:hover {
background: #f8fafc;
}
.context-menu button.danger {
color: #b91c1c;
}
.map-panel {
min-width: 0;
}
.map-header {
position: absolute;
z-index: 500;
top: 12px;
left: 12px;
right: 12px;
border: 1px solid rgba(226, 232, 240, 0.9);
border-radius: 14px;
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(8px);
}
.map-container {
height: 100%;
min-height: 560px;
}
.map-empty {
position: absolute;
z-index: 450;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
padding: 10px 14px;
border-radius: 999px;
color: #475569;
background: rgba(255, 255, 255, 0.92);
box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}
.node-marker {
display: flex !important;
align-items: center;
justify-content: center;
min-width: 34px !important;
width: auto !important;
height: 22px !important;
box-sizing: border-box;
padding: 0;
border: 0;
border-radius: 999px;
color: white;
background: transparent;
box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
font-size: 10px;
font-weight: 800;
line-height: 20px;
text-align: center;
white-space: nowrap;
}
.node-marker span {
display: flex;
align-items: center;
justify-content: center;
min-width: 34px;
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 4px;
border: 1px solid white;
border-radius: inherit;
background: var(--node-color, #2563eb);
line-height: 20px;
text-align: center;
}
.node-marker.selected {
box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
transform: scale(1.12);
}
.node-marker.selected span {
background: #dc2626;
}
.cluster-marker {
display: flex !important;
align-items: center;
justify-content: center;
border: 2px solid white;
border-radius: 999px;
color: white;
background: #2563eb;
box-shadow: 0 6px 16px rgba(15, 23, 42, 0.3);
font-size: 13px;
font-weight: 900;
line-height: 1;
}
.cluster-marker span {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.cluster-medium {
background: #1d4ed8;
}
.cluster-large {
background: #1e40af;
}
.node-detail-panel {
min-height: 180px;
}
.node-list-panel {
min-height: 240px;
}
.detail-page,
.help-page {
display: grid;
gap: 12px;
}
.help-content {
display: grid;
gap: 18px;
padding: 18px;
color: #334155;
}
.help-content section {
display: grid;
gap: 8px;
}
.help-content ul {
margin: 0;
padding-left: 20px;
}
.detail-section-grid {
display: grid;
grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
gap: 12px;
}
.detail-summary-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 10px;
padding: 16px;
}
.detail-summary-grid div {
display: grid;
gap: 5px;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 12px;
background: #f8fafc;
}
.detail-summary-grid span {
color: #64748b;
font-size: 13px;
}
.detail-summary-grid strong {
color: #0f172a;
}
.detail-chat-panel {
min-height: 420px;
}
.detail-chat-history {
max-height: 420px;
overflow-y: auto;
}
.detail-chat-item {
display: grid;
gap: 6px;
border-bottom: 1px solid #e2e8f0;
padding: 13px 16px;
}
.trajectory-map {
height: 420px;
min-height: 360px;
}
.public-key-block {
max-width: 100%;
margin: 0;
padding: 16px;
white-space: pre-wrap;
word-break: break-all;
color: #0f172a;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 12px;
}
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
gap: 8px;
}
.metric-chip {
display: grid;
gap: 4px;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 8px 10px;
background: #f8fafc;
}
.metric-chip span {
color: #64748b;
font-size: 12px;
}
.metric-chip strong {
color: #0f172a;
font-size: 14px;
}
.node-table-wrap {
overflow-x: auto;
}
.node-table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
.node-table th,
.node-table td {
padding: 10px 12px;
border-bottom: 1px solid #e2e8f0;
text-align: left;
white-space: nowrap;
}
.node-table th {
color: #64748b;
font-size: 12px;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.node-row {
cursor: pointer;
}
.node-row:hover,
.node-row.selected {
background: #eff6ff;
}
.admin-loading {
padding: 24px;
color: #64748b;
}
.admin-login,
.admin-dashboard,
.admin-session-card {
max-width: 1100px;
margin: 0 auto;
width: 100%;
}
.admin-session-card {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 14px 16px;
}
.admin-nav {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.admin-nav a {
border-radius: 999px;
padding: 7px 10px;
color: #334155;
text-decoration: none;
font-size: 13px;
font-weight: 700;
background: #e2e8f0;
}
.admin-nav a.active {
color: #fff;
background: #2563eb;
}
.admin-form {
display: grid;
gap: 14px;
padding: 18px;
}
.admin-user-form {
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
align-items: end;
}
.admin-form label {
display: grid;
gap: 6px;
color: #334155;
font-size: 14px;
font-weight: 700;
}
.admin-form input {
border: 1px solid #cbd5e1;
border-radius: 10px;
padding: 10px 12px;
font: inherit;
}
.admin-form button,
.admin-actions button,
.admin-button {
border: 0;
border-radius: 10px;
padding: 9px 16px;
color: #fff;
font-weight: 700;
background: #2563eb;
}
.admin-table-input {
min-width: 160px;
border: 1px solid #cbd5e1;
border-radius: 8px;
padding: 8px 10px;
font: inherit;
}
.success {
margin: 0 16px 12px;
border: 1px solid #bbf7d0;
border-radius: 14px;
padding: 10px 12px;
color: #166534;
background: #f0fdf4;
}
.log-badge {
display: inline-flex;
border-radius: 999px;
padding: 4px 8px;
font-size: 12px;
font-weight: 700;
}
.log-success {
color: #166534;
background: #dcfce7;
}
.log-failure {
color: #991b1b;
background: #fee2e2;
}
.admin-dashboard {
display: grid;
gap: 12px;
}
.admin-actions {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: flex-end;
gap: 10px;
}
.admin-status-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 10px;
padding: 16px;
}
.admin-status-grid div,
.status-card-link {
display: grid;
gap: 5px;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 12px;
background: #f8fafc;
}
.status-card-link {
color: inherit;
text-decoration: none;
}
.status-card-link:hover {
border-color: #bfdbfe;
background: #eff6ff;
}
.admin-status-grid span,
.status-card-link span {
color: #64748b;
font-size: 13px;
}
.admin-status-grid strong,
.status-card-link strong {
color: #0f172a;
}
.discard-raw,
.discard-json {
max-width: 360px;
max-height: 120px;
margin: 0;
overflow: auto;
white-space: pre-wrap;
word-break: break-all;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 12px;
}
.pagination {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 12px;
padding: 12px 16px;
border-top: 1px solid #e2e8f0;
color: #475569;
}
.pagination button {
border: 1px solid #cbd5e1;
border-radius: 10px;
padding: 8px 12px;
background: #fff;
color: #0f172a;
}
.pagination button:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.node-detail-popup .leaflet-popup-content {
width: 300px !important;
max-width: 300px !important;
}
.node-popup {
width: 100%;
line-height: 1.35;
white-space: normal;
}
.node-popup strong {
display: block;
margin-bottom: 8px;
color: #0f172a;
font-size: 15px;
line-height: 1.3;
overflow-wrap: anywhere;
}
.node-popup dl {
display: grid;
gap: 6px;
margin: 0;
}
.node-popup dl div {
display: block;
}
.node-popup dt {
color: #64748b;
font-size: 11px;
line-height: 1.35;
margin-bottom: 2px;
}
.node-popup dd {
margin: 0;
color: #0f172a;
font-weight: 700;
line-height: 1.35;
white-space: normal;
overflow-wrap: anywhere;
}
.detail-grid {
display: grid;
grid-template-columns: 1.2fr 1fr 1fr;
gap: 16px;
padding: 16px;
}
dl {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
margin: 0;
}
dt {
color: #64748b;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.06em;
}
dd {
margin: 3px 0 0;
color: #0f172a;
font-weight: 700;
overflow-wrap: anywhere;
}
.detail-side ul {
margin: 10px 0 0;
padding-left: 18px;
}
.detail-side li {
margin-bottom: 6px;
color: #334155;
}
.empty {
padding: 22px 16px;
color: #64748b;
}
.leaflet-container {
font: inherit;
}
@media (max-width: 920px) {
.app-shell {
padding: 10px;
}
.topbar,
.topbar-actions {
align-items: flex-start;
flex-direction: column;
}
.workspace,
.detail-grid,
.detail-section-grid {
grid-template-columns: 1fr;
}
.pagination {
align-items: stretch;
flex-direction: column;
}
.map-container {
min-height: 360px;
}
}