feat(web): localize and redesign operations console

This commit is contained in:
chick
2026-07-18 22:22:41 +08:00
parent d575ab4d9d
commit abfd07f8a3
34 changed files with 1536 additions and 1058 deletions
+439 -122
View File
@@ -1,40 +1,52 @@
:root {
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
color: #e8edf5;
background: #0b1018;
--surface: #121a26;
--surface-raised: #192434;
--border: #2b394d;
--muted: #a9b6c8;
--accent: #75a7ff;
--danger: #ff8b91;
--radius: 0.5rem;
font-family: 'PingFang SC', 'Microsoft YaHei', ui-rounded, system-ui, sans-serif;
color: #725d42;
background: #f8f8f0;
--mint: #19c8b9;
--mint-dark: #10a99d;
--brown: #794f27;
--text: #725d42;
--muted: #9f927d;
--canvas: #f8f8f0;
--surface: rgb(247, 243, 223);
--surface-raised: #fffdf5;
--border: #ded3bd;
--danger: #c95e55;
--warning: #f5c31c;
--radius: 16px;
--space: clamp(0.75rem, 2vw, 1.5rem);
font-synthesis: none;
}
* {
box-sizing: border-box;
}
html {
background: var(--canvas);
}
body {
margin: 0;
min-width: 20rem;
background: #0b1018;
background: var(--canvas);
}
body::before {
content: '';
position: fixed;
inset: 0;
z-index: -1;
opacity: 0.32;
pointer-events: none;
background-image: radial-gradient(circle, rgba(121, 79, 39, 0.12) 1px, transparent 1.5px);
background-size: 24px 24px;
}
a {
color: var(--accent);
color: #187f77;
text-underline-offset: 3px;
}
button,
input,
select {
font: inherit;
}
button,
input,
select {
color: inherit;
background: var(--surface-raised);
border: 1px solid var(--border);
border-radius: 0.35rem;
padding: 0.5rem 0.65rem;
}
button,
input,
@@ -42,44 +54,156 @@ select,
a {
outline-offset: 3px;
}
:focus-visible {
outline: 3px solid var(--warning);
outline-offset: 3px;
}
button,
input,
select {
min-height: 2.75rem;
padding: 0.5rem 0.75rem;
border: 2px solid #c4b89e;
border-radius: 999px;
background: var(--surface-raised);
}
button {
cursor: pointer;
font-weight: 700;
transition:
transform 120ms ease,
box-shadow 120ms ease,
background 120ms ease;
box-shadow: 0 2px 4px rgba(61, 52, 40, 0.06);
}
button:hover:not(:disabled) {
background: #fff;
transform: translateY(-1px);
}
button:active:not(:disabled) {
transform: translateY(2px);
}
button:disabled {
cursor: not-allowed;
opacity: 0.48;
}
button[type='submit'],
.fleet-actions button,
.fleet-heading > button,
.form-actions button:first-child {
color: #fff;
border-color: var(--mint-dark);
background: var(--mint);
box-shadow: 0 5px 0 var(--mint-dark);
}
input:focus,
select:focus {
border-color: var(--mint);
}
h1,
h2,
h3 {
color: var(--brown);
letter-spacing: -0.02em;
}
h1 {
margin: 0 0 0.35rem;
font-size: clamp(1.5rem, 3vw, 2.2rem);
}
h2 {
font-size: 1.05rem;
}
p {
line-height: 1.6;
}
.skip-link {
position: fixed;
top: -5rem;
top: -6rem;
left: 1rem;
z-index: 10;
background: white;
color: black;
padding: 0.75rem;
z-index: 100;
color: #fff;
background: var(--brown);
padding: 0.75rem 1rem;
border-radius: 12px;
}
.skip-link:focus {
top: 1rem;
}
.app-topbar {
min-height: 3.5rem;
padding: 0 var(--space);
border-bottom: 1px solid var(--border);
min-height: 4.5rem;
padding: 0.75rem var(--space);
display: flex;
align-items: center;
gap: 1rem;
gap: 0.8rem;
color: var(--text);
background: rgba(255, 253, 245, 0.92);
border-bottom: 1px solid var(--border);
backdrop-filter: blur(12px);
position: sticky;
top: 0;
z-index: 20;
}
.product-name {
margin-right: auto;
font-weight: 750;
color: inherit;
color: var(--brown);
text-decoration: none;
font-size: 1.15rem;
font-weight: 900;
}
.connection-status {
.product-name::before {
content: '◉';
display: inline-grid;
place-items: center;
width: 2rem;
height: 2rem;
margin-right: 0.55rem;
color: #fff;
background: var(--mint);
border-radius: 45% 55% 50% 50%;
box-shadow: 0 3px 0 var(--mint-dark);
}
.connection-status,
.version-badge {
padding: 0.25rem 0.65rem;
border-radius: 999px;
background: var(--surface);
color: var(--muted);
font-size: 0.82rem;
}
.connection-status::before {
content: '';
display: inline-block;
width: 0.5rem;
height: 0.5rem;
margin-right: 0.35rem;
border-radius: 50%;
background: var(--mint);
}
.app-layout {
display: grid;
grid-template-columns: 11rem minmax(0, 1fr);
min-height: calc(100vh - 3.5rem);
}
.global-navigation,
.instance-context {
grid-template-columns: 13rem minmax(0, 1fr);
gap: var(--space);
min-height: calc(100vh - 4.5rem);
padding: var(--space);
border-right: 1px solid var(--border);
}
.global-navigation {
align-self: start;
position: sticky;
top: 6rem;
padding: 1rem;
border: 1px solid #e9dfca;
border-radius: 20px;
background: var(--surface);
box-shadow: 0 10px 28px rgba(121, 79, 39, 0.1);
}
.global-navigation::before {
content: '工作区';
display: block;
padding: 0.35rem 0.6rem 0.75rem;
color: var(--muted);
font-size: 0.76rem;
font-weight: 800;
letter-spacing: 0.12em;
}
.global-navigation ul,
.instance-context ul {
@@ -92,64 +216,117 @@ a {
.global-navigation a,
.instance-context nav a {
display: block;
padding: 0.55rem;
border-radius: 0.35rem;
padding: 0.7rem 0.8rem;
border-radius: 12px;
color: var(--text);
text-decoration: none;
font-weight: 700;
}
a[aria-current='page'] {
background: var(--surface-raised);
color: white;
}
.instance-context {
grid-column: 2;
grid-row: 1;
border-bottom: 1px solid var(--border);
}
.instance-context + main {
grid-column: 2;
grid-row: 2;
}
.instance-context code {
display: block;
color: var(--muted);
}
.instance-context dl div {
display: flex;
justify-content: space-between;
gap: 1rem;
color: var(--brown);
background: #fff;
box-shadow: 0 3px 0 #d4c9b4;
}
main {
min-width: 0;
padding: var(--space);
padding: clamp(0.5rem, 2vw, 1.25rem);
border: 1px solid #ebe1ce;
border-radius: 22px;
background: rgba(255, 253, 245, 0.88);
box-shadow: 0 16px 40px rgba(121, 79, 39, 0.09);
}
.fleet-heading,
.fleet-toolbar {
main > section > header,
.fleet-heading {
display: flex;
align-items: end;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
padding-bottom: 1rem;
border-bottom: 1px dashed var(--border);
}
.fleet-toolbar {
justify-content: flex-start;
padding: 1rem 0;
.fleet-heading p,
main > section > header p {
margin: 0.25rem 0 0;
color: var(--muted);
}
.fleet-toolbar label {
display: grid;
gap: 0.3rem;
min-width: min(100%, 14rem);
}
.fleet-toolbar label:first-child {
flex: 1;
.fleet-actions,
.form-actions,
.pagination {
display: flex;
align-items: center;
gap: 0.75rem;
flex-wrap: wrap;
}
.selection-summary,
small {
color: var(--muted);
}
.fleet-toolbar,
.jobs-toolbar {
display: flex;
align-items: end;
gap: 0.65rem;
flex-wrap: wrap;
padding: 1rem;
margin: 1rem 0;
border-radius: var(--radius);
background: var(--surface);
}
.fleet-toolbar label,
.jobs-toolbar label {
display: grid;
gap: 0.3rem;
min-width: min(100%, 10rem);
font-size: 0.82rem;
font-weight: 700;
}
.fleet-toolbar label:first-child {
flex: 1;
min-width: min(100%, 15rem);
}
.column-picker {
position: relative;
}
.column-picker fieldset {
position: absolute;
right: 0;
z-index: 5;
width: 14rem;
padding: 0.75rem;
border: 1px solid var(--border);
border-radius: 14px;
background: #fffdf5;
box-shadow: 0 12px 30px rgba(121, 79, 39, 0.16);
}
.column-picker fieldset label {
display: flex;
align-items: center;
}
.batch-entry,
.state-panel {
margin: 0.8rem 0;
padding: 1rem;
border: 1px dashed #cdbfa5;
border-radius: var(--radius);
background: var(--surface);
}
.state-panel {
background-image: radial-gradient(circle, rgba(121, 79, 39, 0.1) 1px, transparent 1px);
background-size: 18px 18px;
}
.state-error {
color: #a4423b;
border-color: #db938d;
background-color: #fff0e8;
}
.table-scroll {
max-width: 100%;
overflow-x: auto;
border: 1px solid var(--border);
border-radius: var(--radius);
background: #fffdf5;
box-shadow: 0 5px 16px rgba(121, 79, 39, 0.07);
}
table {
width: 100%;
@@ -157,19 +334,56 @@ table {
white-space: nowrap;
}
caption {
padding: 0.8rem;
text-align: left;
padding: 0.75rem;
font-weight: 700;
font-weight: 800;
color: var(--brown);
}
th,
td {
padding: 0.6rem 0.75rem;
border-top: 1px solid var(--border);
padding: 0.65rem 0.75rem;
border-top: 1px solid #e9dfca;
text-align: left;
}
thead th {
color: var(--brown);
background: var(--surface);
font-size: 0.8rem;
}
thead button {
min-height: auto;
padding: 0.25rem;
border: 0;
background: transparent;
box-shadow: none;
}
input[type='checkbox'],
input[type='radio'] {
width: 1.25rem;
height: 1.25rem;
min-height: auto;
padding: 0;
border-radius: 0.25rem;
}
label:has(> input[type='checkbox']),
label:has(> input[type='radio']),
.touch-target {
min-width: 2.75rem;
min-height: 2.75rem;
display: inline-flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
}
.touch-target {
justify-content: center;
}
tbody tr {
transition: background 120ms ease;
}
tbody tr:hover,
tr[aria-selected='true'] {
background: var(--surface);
background: #f2f8e9;
}
tbody th small {
display: block;
@@ -180,25 +394,84 @@ tbody th small {
}
.status {
display: inline-block;
padding: 0.2rem 0.45rem;
padding: 0.25rem 0.55rem;
border-radius: 999px;
background: var(--surface-raised);
background: #eee5d2;
font-size: 0.78rem;
font-weight: 800;
}
.status-online {
color: #75e6a3;
color: #087b70;
background: #d8f5ec;
}
.status-offline,
.status-auth {
color: #ffbd76;
color: #9c6423;
background: #fff0c9;
}
.state-panel {
.pagination {
justify-content: flex-end;
padding-top: 1rem;
}
.instance-detail {
display: grid;
grid-template-columns: 13rem minmax(0, 1fr);
gap: 1rem;
}
.instance-context {
min-width: 0;
padding: 1rem;
border: 1px dashed var(--border);
border-radius: var(--radius);
border-radius: 18px;
background: var(--surface);
}
.state-error {
color: var(--danger);
border-color: currentColor;
.instance-context code {
display: block;
overflow-wrap: anywhere;
color: var(--muted);
}
.instance-context dl div,
.overview-card dl div,
.cellular-card dl div,
[class$='-card'] dl div {
display: flex;
justify-content: space-between;
gap: 1rem;
padding: 0.35rem 0;
border-bottom: 1px dashed #ddd0b8;
}
dd {
margin-inline-start: 1rem;
text-align: right;
overflow-wrap: anywhere;
}
.instance-module-detail {
min-width: 0;
}
.overview-grid,
.cellular-grid,
.device-network-grid,
.messages-grid,
.calls-grid,
.notifications-grid,
.automation-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
gap: 0.8rem;
}
.overview-card,
.cellular-card,
.device-network-card,
.messages-card,
.calls-card,
.esim-card,
.notifications-card,
.automation-card,
.ota-card,
main li[aria-label] {
padding: 1rem;
border: 1px solid #e2d6bf;
border-radius: var(--radius);
background: var(--surface-raised);
}
.instance-editor {
max-width: 48rem;
@@ -211,80 +484,124 @@ tbody th small {
}
.instance-editor form {
gap: 1rem;
}
.form-actions {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
padding: 1rem;
border-radius: var(--radius);
background: var(--surface);
}
.danger-zone {
margin-top: 2rem;
padding: 1rem;
border: 1px solid var(--danger);
border: 1px solid #db938d;
border-radius: var(--radius);
background: #fff4ed;
}
.danger-zone div {
display: grid;
gap: 0.75rem;
}
main ul[aria-label='已配置实例'] {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
gap: 0.8rem;
padding: 0;
list-style: none;
}
@media (max-width: 48rem) {
.app-topbar {
position: static;
flex-wrap: wrap;
padding-block: 0.6rem;
}
.product-name {
width: 100%;
}
.app-layout {
display: block;
padding: 0.65rem;
}
.global-navigation {
border-right: 0;
border-bottom: 1px solid var(--border);
position: static;
padding: 0.55rem;
margin-bottom: 0.65rem;
overflow-x: auto;
}
.global-navigation::before {
display: none;
}
.global-navigation ul {
display: flex;
min-width: max-content;
}
main {
padding: 0.8rem;
border-radius: 16px;
}
.instance-detail {
display: block;
}
.instance-context {
border-right: 0;
margin-bottom: 1rem;
}
.fleet-toolbar label {
.instance-context ul {
display: flex;
overflow-x: auto;
}
.instance-context li {
min-width: max-content;
}
.fleet-toolbar label,
.jobs-toolbar label {
width: 100%;
}
.table-scroll {
overflow: visible;
border: 0;
overflow-x: auto;
border: 1px solid var(--border);
box-shadow: none;
background: var(--surface-raised);
}
.dense-table,
.dense-table tbody,
.dense-table tr,
.dense-table tbody {
min-width: 48rem;
}
.dense-table th,
.dense-table td {
display: block;
white-space: nowrap;
}
.dense-table button,
.pagination button,
.global-navigation a,
.instance-context nav a,
.fleet-actions a {
min-height: 2.75rem;
display: inline-flex;
align-items: center;
}
}
@media (max-width: 24.375rem) {
body {
min-width: 20rem;
}
.connection-status,
.version-badge {
font-size: 0.72rem;
}
.fleet-heading > *,
.fleet-actions,
.form-actions,
.pagination {
width: 100%;
}
button {
max-width: 100%;
white-space: normal;
}
.dense-table thead {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
}
.dense-table tbody tr {
margin-block: 0.75rem;
padding: 0.75rem;
border: 1px solid var(--border);
border-radius: var(--radius);
}
.dense-table tbody td,
.dense-table tbody th {
border: 0;
padding: 0.3rem 0;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
}
}