feat: enhance dashboard and robot management

This commit is contained in:
2026-08-13 13:56:05 +08:00
parent 9a1788fe8f
commit 0f55259fff
3 changed files with 270 additions and 11 deletions

View File

@@ -191,3 +191,77 @@ code, pre { font-family: "Cascadia Code", Consolas, monospace; }
.channel-card { flex-direction: column; }
.toast-region { right: 12px; bottom: 12px; left: 12px; }.toast { min-width: 0; max-width: none; }
}
/* Command center dashboard */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 72% 6%, #123b3d55, transparent 30%), radial-gradient(circle at 18% 86%, #102b3f44, transparent 27%); }
.nav-count-cyan { background: var(--cyan-soft); color: var(--cyan); }
.command-hero { position: relative; overflow: hidden; border: 1px solid #244a4b; background: linear-gradient(110deg, #10262c 0%, #0c1c25 56%, #102c31 100%); }
.command-hero::after { content: ""; position: absolute; right: -90px; bottom: -160px; width: 390px; height: 390px; border: 1px solid #41d6c326; border-radius: 50%; box-shadow: 0 0 0 48px #41d6c30b, 0 0 0 96px #41d6c308; }
.command-hero > * { position: relative; z-index: 1; }
.hero-actions { display: flex; align-items: center; gap: 12px; }
.live-pill { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; border: 1px solid #29664b; padding: 0 12px; background: #173828aa; color: var(--green); font-size: 10px; letter-spacing: .05em; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 #5fd28a66; animation: livePulse 2s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px #5fd28a00; } 100% { box-shadow: 0 0 0 0 #5fd28a00; } }
.stat-card { position: relative; overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.stat-card::after { content: ""; position: absolute; right: -36px; bottom: -50px; width: 110px; height: 110px; border-radius: 50%; background: #41d6c308; }
.stat-card:hover { transform: translateY(-2px); border-color: #31545d; }
.dashboard-command-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(390px, 1.35fr) minmax(260px, .78fr); gap: 14px; margin-top: 14px; }
.dashboard-command-grid .panel { min-height: 290px; }
.trend-badge { border: 1px solid #29664b; padding: 5px 8px; background: var(--green-soft); color: var(--green); font-size: 9px; }
.safety-score-body { display: grid; height: calc(100% - 48px); grid-template-columns: 150px 1fr; align-items: center; gap: 20px; }
.safety-gauge { --score: 86; position: relative; display: grid; width: 144px; height: 144px; place-items: center; border-radius: 50%; background: conic-gradient(var(--cyan) calc(var(--score) * 1%), #1a3039 0); box-shadow: 0 0 36px #41d6c316; }
.safety-gauge::before { content: ""; position: absolute; inset: 12px; border: 1px solid #2c444d; border-radius: 50%; background: var(--surface); }
.safety-gauge > div { position: relative; display: grid; justify-items: center; gap: 2px; }
.safety-gauge strong { color: var(--text); font-size: 36px; font-variant-numeric: tabular-nums; }
.safety-gauge span { color: var(--cyan); font-size: 11px; letter-spacing: .18em; }
.score-breakdown { display: grid; gap: 9px; }
.score-breakdown div { display: grid; grid-template-columns: 1fr auto; gap: 10px; border-bottom: 1px solid var(--line-soft); padding: 10px 0; }
.score-breakdown span { color: var(--muted); font-size: 10px; }
.score-breakdown strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.zone-map { position: relative; min-height: 190px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, #0b1820, #0e222b); }
.map-grid { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(#31515b 1px, transparent 1px), linear-gradient(90deg, #31515b 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 95%); }
.zone-block { position: absolute; display: grid; place-items: center; border: 1px solid #2a4650; background: #102630c7; color: #73909a; font-size: 9px; letter-spacing: .08em; }
.zone-a { top: 20px; left: 20px; width: 35%; height: 66px; }.zone-b { top: 20px; right: 20px; width: 48%; height: 98px; }.zone-c { bottom: 18px; left: 20px; width: 42%; height: 66px; }.zone-d { right: 20px; bottom: 18px; width: 41%; height: 46px; }
.robot-dot { position: absolute; z-index: 2; width: 11px; height: 11px; border: 2px solid #cafff7; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px #41d6c31a, 0 0 15px var(--cyan); }
.robot-dot::after { content: ""; position: absolute; inset: -7px; border: 1px solid #41d6c34d; border-radius: 50%; animation: livePulse 2.4s infinite; }.robot-dot-1 { top: 54px; left: 28%; }.robot-dot-2 { top: 76px; right: 31%; }.robot-dot-3 { right: 19%; bottom: 34px; }.robot-dot.is-warning { border-color: #ffe0ad; background: var(--orange); box-shadow: 0 0 0 5px #ffad4d1c, 0 0 15px var(--orange); }
.camera-sweep { position: absolute; top: 50%; left: 50%; width: 115px; height: 115px; transform: translate(-50%, -50%); border: 1px solid #41d6c31a; border-radius: 50%; background: conic-gradient(from 10deg, #41d6c31f, transparent 24%); animation: sweep 8s linear infinite; }
@keyframes sweep { to { transform: translate(-50%, -50%) rotate(360deg); } }
.zone-legend { display: flex; justify-content: flex-end; gap: 14px; padding-top: 12px; color: var(--muted); font-size: 9px; }.zone-legend span { display: flex; align-items: center; gap: 6px; }.zone-legend i { width: 7px; height: 7px; border-radius: 50%; }.dot-online { background: var(--cyan); }.dot-warning { background: var(--orange); }.dot-offline { background: #60717a; }
.donut-layout { display: grid; height: calc(100% - 45px); align-items: center; justify-items: center; gap: 20px; }
.risk-donut { position: relative; display: grid; width: 142px; height: 142px; place-items: center; border-radius: 50%; background: conic-gradient(var(--red) 0 45%, var(--cyan) 45% 78%, var(--orange) 78% 100%); }
.risk-donut::before { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }.risk-donut > div { position: relative; display: grid; justify-items: center; }.risk-donut strong { font-size: 30px; }.risk-donut span { color: var(--muted); font-size: 9px; }
.donut-legend { display: grid; width: 100%; gap: 8px; }.donut-legend div { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); padding: 7px 0; font-size: 10px; }.donut-legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); }.donut-legend i { width: 8px; height: 8px; }.legend-device { display: inline-block; background: var(--orange); }
.overview-grid-lower { margin-top: 14px; }
/* Robot fleet */
.fleet-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fleet-stat { position: relative; display: grid; min-height: 118px; align-content: center; gap: 7px; overflow: hidden; border: 1px solid var(--line); padding: 18px 20px; background: linear-gradient(135deg, var(--surface), #10232d); }
.fleet-stat::after { content: ""; position: absolute; right: -34px; bottom: -48px; width: 108px; height: 108px; border: 1px solid #41d6c316; border-radius: 50%; box-shadow: 0 0 0 18px #41d6c308; }.fleet-stat span, .fleet-stat small { color: var(--muted); font-size: 10px; }.fleet-stat strong { font-size: 27px; font-variant-numeric: tabular-nums; }
.fleet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; }
.search-field { display: flex; width: min(300px, 100%); height: 36px; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 0 11px; background: var(--surface); color: var(--muted); }.search-field:focus-within { border-color: var(--cyan); }.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.robot-management-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 14px; }.robot-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.robot-card { display: grid; gap: 15px; transition: border-color .2s ease, transform .2s ease; }.robot-card:hover { transform: translateY(-2px); border-color: #31545d; }
.robot-card-head { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; }.robot-card-head h3 { margin: 2px 0 3px; font-size: 15px; }.robot-card-head p { margin: 0; color: var(--muted); font-size: 9px; }.robot-id { color: var(--cyan); font-size: 8px; letter-spacing: .12em; }
.robot-avatar { position: relative; display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #28515a; background: linear-gradient(145deg, #17343d, #0a171e); }.robot-avatar span { width: 24px; height: 15px; border: 2px solid var(--cyan); border-radius: 5px 5px 3px 3px; }.robot-avatar span::before, .robot-avatar span::after { content: ""; position: absolute; bottom: 8px; width: 7px; height: 7px; border: 2px solid #86fff1; border-radius: 50%; background: #0c1c24; }.robot-avatar span::before { left: 8px; }.robot-avatar span::after { right: 8px; }.robot-avatar i { position: absolute; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.robot-status { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 5px 8px; color: var(--muted); font-size: 9px; }.robot-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }.robot-status.active { border-color: #29664b; background: var(--green-soft); color: var(--green); }.robot-status.charging { border-color: #355f83; background: var(--blue-soft); color: var(--blue); }.robot-status.standby { color: var(--orange); }.robot-status.offline { background: #222d32; color: #7a8a91; }
.robot-location { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line-soft); padding: 10px 12px; background: #0b171e; }.robot-location span { color: var(--muted); font-size: 9px; }.robot-location strong { font-size: 10px; }
.robot-mission { display: grid; gap: 8px; }.robot-mission > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; }.robot-mission span { color: var(--muted); }.robot-mission strong { color: var(--cyan); }
.progress-track { height: 4px; overflow: hidden; background: #1a3039; }.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #238f87, var(--cyan)); box-shadow: 0 0 8px #41d6c355; }
.robot-telemetry { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-soft); background: var(--line-soft); gap: 1px; }.robot-telemetry div { display: grid; justify-items: center; gap: 5px; padding: 11px 4px; background: #0d1b23; }.robot-telemetry span { color: var(--muted); font-size: 8px; }.robot-telemetry strong { font-size: 11px; }.robot-telemetry .healthy { color: var(--green); }.robot-telemetry .warning { color: var(--orange); }.robot-telemetry .danger { color: var(--red); }
.sensor-tags { display: flex; flex-wrap: wrap; gap: 6px; }.sensor-tags span { border: 1px solid #24424b; padding: 4px 7px; background: #10232b; color: #8eabb2; font-size: 8px; }.robot-actions { display: flex; gap: 8px; }.robot-actions .secondary-button, .robot-actions .primary-button { flex: 1; min-height: 34px; }.robot-actions .icon-button { flex: 0 0 36px; height: 34px; }
.robot-empty { grid-column: 1 / -1; padding: 60px 20px; color: var(--muted); text-align: center; }.mission-panel { position: sticky; top: 98px; }.mission-queue { display: grid; margin-top: 4px; }.mission-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: start; gap: 10px; border-top: 1px solid var(--line-soft); padding: 14px 0; }.mission-time { display: grid; justify-items: center; gap: 6px; }.mission-time strong { color: var(--cyan); font-size: 10px; }.mission-time span { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 8px; }.mission-copy { display: grid; gap: 6px; }.mission-copy strong { font-size: 10px; }.mission-copy span { color: var(--muted); font-size: 9px; }.mission-status { border: 1px solid var(--line); padding: 4px 6px; color: var(--muted); font-size: 8px; }.mission-status.active { border-color: #29664b; color: var(--green); }.mission-history-button { width: 100%; margin-top: 8px; }
@media (max-width: 1280px) {
.dashboard-command-grid { grid-template-columns: 1fr 1.25fr; }
.risk-donut-panel { grid-column: 1 / -1; min-height: auto !important; }
.donut-layout { grid-template-columns: 160px 1fr; }
.robot-management-grid { grid-template-columns: 1fr; }.mission-panel { position: static; }.robot-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
.dashboard-command-grid, .fleet-stat-grid { grid-template-columns: 1fr 1fr; }
.zone-map-panel { grid-column: 1 / -1; }
.robot-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
.hero-actions, .fleet-toolbar { width: 100%; align-items: stretch; flex-direction: column; }.live-pill { justify-content: center; }.dashboard-command-grid, .fleet-stat-grid { grid-template-columns: 1fr; }.zone-map-panel, .risk-donut-panel { grid-column: auto; }.safety-score-body { grid-template-columns: 1fr; justify-items: center; }.score-breakdown { width: 100%; }.donut-layout { grid-template-columns: 1fr; }.robot-page-intro .primary-button, .search-field { width: 100%; }.robot-card-head { grid-template-columns: 44px 1fr; }.robot-status { grid-column: 2; width: fit-content; }.robot-actions { flex-wrap: wrap; }.robot-actions .icon-button { flex-basis: 100%; width: 100%; }.mission-item { grid-template-columns: 40px 1fr; }.mission-status { grid-column: 2; width: fit-content; }
}