mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-17 22:13:17 +08:00
363 lines
14 KiB
CSS
363 lines
14 KiB
CSS
/* ==========================================================================
|
|
15. Dashboard
|
|
========================================================================== */
|
|
|
|
.cb-dash {
|
|
display: grid;
|
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
gap: 16px;
|
|
margin: 6px 0 18px;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
.cb-dash .span-12 { grid-column: span 12; }
|
|
.cb-dash .span-8 { grid-column: span 8; }
|
|
.cb-dash .span-6 { grid-column: span 6; }
|
|
.cb-dash .span-4 { grid-column: span 4; }
|
|
.cb-dash .span-3 { grid-column: span 3; }
|
|
|
|
.cb-card {
|
|
position: relative;
|
|
min-width: 0;
|
|
padding: 18px 20px;
|
|
border-radius: var(--cb-radius);
|
|
background: var(--cb-card);
|
|
box-shadow: var(--cb-shadow);
|
|
animation: cb-rise .4s var(--cb-ease);
|
|
}
|
|
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
|
|
.cb-card { -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); }
|
|
}
|
|
@keyframes cb-rise { from { transform: translateY(6px); } to { transform: none; } }
|
|
|
|
.cb-card-head {
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
margin: 0 0 14px;
|
|
}
|
|
.cb-card-head h3 {
|
|
margin: 0;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
}
|
|
.cb-card-head h3 .cb-count {
|
|
margin-left: 6px;
|
|
color: var(--cb-text-2);
|
|
font-weight: 500;
|
|
}
|
|
.cb-card-note { color: var(--cb-text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
/* traffic source picker in the card head: a C.listbox, like the language switch */
|
|
.cb-card-head .cb-traffic-select {
|
|
flex: 0 1 auto;
|
|
align-self: center;
|
|
min-width: 0;
|
|
max-width: 60%;
|
|
}
|
|
.cb-card-link { font-size: 13px; font-weight: 500; white-space: nowrap; }
|
|
.cb-device-rate-note { margin: -4px 0 12px; color: var(--cb-text-2); font-size: 12px; }
|
|
.cb-device-rates { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--cb-text-2); }
|
|
.cb-device-rate { font-family: var(--cb-mono); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
|
|
/* hero */
|
|
.cb-hero {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 16px 28px;
|
|
padding: 20px 22px;
|
|
}
|
|
.cb-hero-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
|
|
.cb-hero-icon { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 8px 16px rgba(79, 91, 234, .32)); }
|
|
.cb-hero-icon :is(svg, img) { width: 100%; height: 100%; display: block; }
|
|
.cb-hero-icon.custom { filter: none; }
|
|
.cb-hero-icon img { object-fit: contain; border-radius: 12px; }
|
|
.cb-hero-text { min-width: 0; }
|
|
.cb-hero-title { margin: 0 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
|
|
.cb-hero-sub { margin: 0; color: var(--cb-text-2); font-size: 13px; }
|
|
.cb-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; }
|
|
.cb-meta { display: flex; flex-direction: column; line-height: 1.3; }
|
|
.cb-meta-label { color: var(--cb-text-2); font-size: 11.5px; }
|
|
.cb-meta-val { font-size: 14px; font-weight: 600; }
|
|
.cb-meta-val.cb-ip6 { display: block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
.cb-pill {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
height: 26px;
|
|
padding: 0 11px;
|
|
border-radius: 13px;
|
|
background: var(--cb-fill);
|
|
color: var(--cb-text-2);
|
|
font-size: 12.5px;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
}
|
|
.cb-pill::before {
|
|
content: "";
|
|
width: 7px;
|
|
height: 7px;
|
|
border-radius: 50%;
|
|
background: currentColor;
|
|
}
|
|
.cb-pill.ok { background: var(--cb-green-t); color: var(--cb-green); }
|
|
.cb-pill.ok::before { box-shadow: 0 0 0 0 currentColor; animation: cb-pulse 2s infinite; }
|
|
.cb-pill.bad { background: var(--cb-red-t); color: var(--cb-red); }
|
|
.cb-pill.off { background: var(--cb-fill); color: var(--cb-text-2); }
|
|
.cb-pill.sm { height: 22px; padding: 0 9px; font-size: 11.5px; }
|
|
@keyframes cb-pulse {
|
|
0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .55); }
|
|
70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
|
|
100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
|
|
}
|
|
|
|
/* traffic */
|
|
.cb-rates {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: flex-end;
|
|
gap: 8px 36px;
|
|
margin: -4px 0 8px;
|
|
}
|
|
.cb-rate { display: flex; flex-direction: column; line-height: 1.15; }
|
|
.cb-rate-label { display: inline-flex; align-items: center; gap: 6px; color: var(--cb-text-2); font-size: 12.5px; font-weight: 500; }
|
|
.cb-rate-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
|
|
.cb-rate-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
|
|
.cb-rate-val small { margin-left: 4px; color: var(--cb-text-2); font-size: 14px; font-weight: 600; letter-spacing: 0; }
|
|
.cb-totals { margin-left: auto; text-align: right; color: var(--cb-text-2); font-size: 12px; line-height: 1.5; }
|
|
.cb-totals b { color: var(--cb-text); font-weight: 600; }
|
|
|
|
.cb-chart { position: relative; height: 190px; margin: 0 -4px; touch-action: pan-y; }
|
|
.cb-area-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
|
|
.cb-grid-line { stroke: var(--cb-sep); stroke-width: 1; shape-rendering: crispEdges; }
|
|
.cb-grid-line.base { stroke: var(--cb-border); }
|
|
.cb-axis { fill: var(--cb-text-3); font-size: 10.5px; font-family: var(--cb-font); }
|
|
.cb-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
|
|
.cb-dot { stroke: var(--cb-card); stroke-width: 2; }
|
|
.cb-cross { stroke: var(--cb-text-3); stroke-width: 1; stroke-dasharray: 3 3; }
|
|
.cb-chart-foot { display: flex; justify-content: space-between; margin-top: 6px; color: var(--cb-text-3); font-size: 11px; }
|
|
|
|
.cb-tip {
|
|
position: absolute;
|
|
z-index: 5;
|
|
top: 8px;
|
|
min-width: 140px;
|
|
padding: 8px 10px;
|
|
border-radius: 10px;
|
|
background: var(--cb-popover);
|
|
box-shadow: var(--cb-shadow-pop);
|
|
font-size: 12px;
|
|
line-height: 1.6;
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
transition: opacity .12s;
|
|
}
|
|
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
|
|
.cb-tip { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
|
|
}
|
|
.cb-tip.show { opacity: 1; }
|
|
.cb-tip-time { color: var(--cb-text-2); font-size: 11px; }
|
|
.cb-tip-row { display: flex; align-items: center; gap: 6px; }
|
|
.cb-tip-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
|
|
.cb-tip-row b { margin-left: auto; padding-left: 12px; font-weight: 600; }
|
|
|
|
/* resources */
|
|
.cb-rings { display: flex; justify-content: space-around; gap: 8px; margin: 2px 0 16px; }
|
|
.cb-ring { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
|
|
.cb-ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
|
|
.cb-ring-track { fill: none; stroke: var(--cb-fill); stroke-width: 10; }
|
|
.cb-ring-bar {
|
|
fill: none;
|
|
stroke-width: 10;
|
|
stroke-linecap: round;
|
|
transition: stroke-dashoffset .8s var(--cb-ease), stroke .3s;
|
|
}
|
|
.cb-ring-center {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 88px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.cb-ring-center b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
|
|
.cb-ring-center b small { font-size: 11px; font-weight: 600; color: var(--cb-text-2); margin-left: 1px; }
|
|
.cb-ring-label { margin-top: 6px; font-size: 12.5px; font-weight: 600; }
|
|
.cb-ring-sub { max-width: 100%; color: var(--cb-text-2); font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
|
|
.cb-membar-wrap { margin: 0 0 12px; }
|
|
.cb-membar-title { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; }
|
|
.cb-membar-title span { color: var(--cb-text-2); font-weight: 500; }
|
|
.cb-membar {
|
|
display: flex;
|
|
gap: 2px;
|
|
height: 10px;
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
background: var(--cb-fill);
|
|
}
|
|
.cb-membar > i { display: block; height: 100%; background: var(--c); transition: flex-basis .8s var(--cb-ease); }
|
|
.cb-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--cb-text-2); font-size: 11.5px; }
|
|
.cb-legend span { display: inline-flex; align-items: center; gap: 5px; }
|
|
.cb-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
|
|
|
|
.cb-kv { margin: 0; padding: 0; list-style: none; }
|
|
.cb-kv li {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
padding: 8px 0;
|
|
border-top: .5px solid var(--cb-sep);
|
|
font-size: 13px;
|
|
}
|
|
.cb-kv li span:first-child { color: var(--cb-text-2); }
|
|
.cb-kv li span:last-child { font-weight: 500; text-align: right; }
|
|
|
|
/* stat tiles */
|
|
.cb-tile { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
|
|
.cb-tile-head { display: flex; align-items: center; gap: 8px; color: var(--cb-text-2); font-size: 13px; font-weight: 500; }
|
|
.cb-ico {
|
|
--c: var(--cb-gray);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex: none;
|
|
width: 32px;
|
|
height: 32px;
|
|
border-radius: 10px;
|
|
color: var(--c);
|
|
background: var(--cb-fill);
|
|
background: color-mix(in srgb, var(--c) 13%, transparent);
|
|
}
|
|
.cb-ico svg { width: 17px; height: 17px; }
|
|
.cb-tile-head .cb-ico { width: 30px; height: 30px; }
|
|
.cb-tile-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
|
|
.cb-tile-val small { margin-left: 3px; color: var(--cb-text-2); font-size: 13px; font-weight: 600; letter-spacing: 0; }
|
|
.cb-tile-sub { color: var(--cb-text-2); font-size: 12px; min-height: 18px; }
|
|
.cb-tile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
|
|
.cb-spark { flex: 1; max-width: 120px; height: 34px; }
|
|
.cb-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
|
|
.cb-mini-bar { height: 5px; border-radius: 3px; background: var(--cb-fill); overflow: hidden; }
|
|
.cb-mini-bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--c, var(--cb-teal)); transition: width .8s var(--cb-ease); }
|
|
|
|
/* lists */
|
|
.cb-list { margin: 0 -8px; padding: 0; list-style: none; }
|
|
.cb-list > li {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 9px 8px;
|
|
border-radius: 10px;
|
|
}
|
|
.cb-list > li + li { box-shadow: 0 -.5px 0 var(--cb-sep); }
|
|
.cb-list > li:hover { background: var(--cb-hover); box-shadow: none; }
|
|
.cb-list > li:hover + li { box-shadow: none; }
|
|
.cb-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
|
|
.cb-list-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
.cb-list-sub { color: var(--cb-text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
.cb-list-aside { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; color: var(--cb-text-2); font-size: 12px; }
|
|
.cb-mono { font-family: var(--cb-mono); font-size: 12px; letter-spacing: -.01em; }
|
|
.cb-empty { padding: 26px 0 18px; text-align: center; color: var(--cb-text-2); font-size: 13px; }
|
|
|
|
.cb-avatar {
|
|
--c: var(--cb-blue);
|
|
flex: none;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 34px;
|
|
height: 34px;
|
|
border-radius: 50%;
|
|
background: var(--c);
|
|
color: #fff;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
}
|
|
.cb-avatar svg { width: 18px; height: 18px; }
|
|
|
|
/* brand avatars */
|
|
.cb-avatar.cb-avatar-brand { color: var(--f, #fff); }
|
|
.cb-avatar.cb-avatar-brand.inv { background-color: var(--cb-text); color: var(--cb-card); }
|
|
.cb-avatar .cb-logo { width: 17px; height: 17px; fill: currentColor; }
|
|
.cb-avatar b { font-size: 15px; font-weight: 700; line-height: 1; text-transform: none; }
|
|
.cb-avatar.cb-type {
|
|
background: var(--cb-fill);
|
|
background-image: none;
|
|
color: var(--cb-text-2);
|
|
}
|
|
/* the same avatar, smaller, beside hostnames in LuCI's lease tables */
|
|
.cb-host { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; vertical-align: middle; }
|
|
.cb-host-name { min-width: 0; overflow-wrap: anywhere; }
|
|
.cb-host > .cb-avatar { width: 26px; height: 26px; font-size: 12px; }
|
|
.cb-host > .cb-avatar svg { width: 15px; height: 15px; }
|
|
.cb-host > .cb-avatar .cb-logo { width: 14px; height: 14px; }
|
|
.cb-host > .cb-avatar b { font-size: 12px; }
|
|
.cb-kind { color: var(--cb-text-2); }
|
|
.cb-kind::after { content: " · "; }
|
|
.cb-tag {
|
|
display: inline-block;
|
|
margin-right: 6px;
|
|
padding: 0 6px;
|
|
border-radius: 5px;
|
|
background: var(--cb-fill);
|
|
color: var(--cb-text-2);
|
|
font-size: 10.5px;
|
|
font-weight: 600;
|
|
line-height: 17px;
|
|
vertical-align: 1px;
|
|
cursor: help;
|
|
}
|
|
|
|
.cb-tag-wifi { background: var(--cb-fill); background: color-mix(in srgb, var(--cb-blue) 13%, transparent); color: var(--cb-blue); cursor: default; white-space: nowrap; }
|
|
.cb-tag-wifi svg { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
|
|
|
|
.cb-subhead { margin: 18px 0 6px; color: var(--cb-text-2); font-size: 12px; font-weight: 600; }
|
|
.cb-subhead:first-of-type { margin-top: 0; }
|
|
|
|
.cb-more {
|
|
display: block;
|
|
width: 100%;
|
|
margin: 8px 0 0;
|
|
padding: 8px;
|
|
border: 0;
|
|
border-radius: 9px;
|
|
background: var(--cb-fill-2);
|
|
color: var(--cb-accent);
|
|
font: inherit;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
.cb-more:hover { background: var(--cb-fill); }
|
|
|
|
/* details toggle below dashboard */
|
|
.cb-details-bar { display: flex; justify-content: center; margin: 2px 0 18px; }
|
|
.cb-details-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
height: 32px;
|
|
padding: 0 14px;
|
|
border: 0;
|
|
border-radius: 16px;
|
|
background: var(--cb-fill);
|
|
color: var(--cb-text);
|
|
font: inherit;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
.cb-details-btn:hover { filter: brightness(.97); }
|
|
.cb-details-btn svg { width: 14px; height: 14px; transition: transform .2s var(--cb-ease); }
|
|
.cb-show-details .cb-details-btn svg { transform: rotate(180deg); }
|
|
body.cb-has-dash:not(.cb-show-details) #view,
|
|
body.cb-has-dash:not(.cb-show-details) #maincontent > .includes { display: none; }
|
|
/* newer LuCI renders the page <h2> outside #view; the hero card replaces it */
|
|
body.cb-has-dash #maincontent > h2 { display: none; }
|
|
|