精修 WebUI 第五轮:交互能力与功能性升级

- 新增 Toast 通知系统:右下角浮出(移动端横铺底部),4 类(success/error/warn/info)+ 关闭按钮 + 自动消失 + hover 暂停消失
- 关键操作接入 Toast:保存配置 / 加载配置 / 启动失败 / 设备操作(连接/断开/WiFi 启用)成功失败提示
- 日志关键词分类着色:行级 span,自动识别 ERROR/WARN/SUCCESS/DEBUG/INFO(含中英文与 emoji 标记);DocumentFragment 批量渲染保持性能
- 配置面板加跨标签搜索:workspaceHeader 内嵌搜索框,输入即时按 label/hint/key 过滤所有 row 与 sectionTitle,搜索时自动展开所有 panel;空结果显示空状态;带清空按钮
- 首屏统计骨架屏:未到数据前 statValue 显示 shimmer 占位;pollStats 成功后自动移除
- 移动端复查:inline2 在小屏取消连体边框;workspaceHeader 改纵向布局,搜索框占满宽;secondaryActions 分隔线隐藏;btnTheme 推到右侧
- cache-bust v7 → v8
This commit is contained in:
Codex committed 2026-05-21 09:29:38 +08:00
1 parent aa5065590a
commit 96cba09c49
3 files changed
+559 -27

No files matched your search

+318
View File
@@ -798,6 +798,89 @@ svg {
text-align: right;
}
.workspaceSearch {
position: relative;
display: flex;
align-items: center;
width: clamp(220px, 32vw, 360px);
}
.workspaceSearch input {
width: 100%;
min-height: 32px;
padding: 0 30px 0 30px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-md);
color: var(--text);
background: var(--surface-soft);
font-size: var(--text-sm);
outline: none;
transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}
.workspaceSearch input::-webkit-search-cancel-button {
display: none;
}
.workspaceSearch input:hover {
border-color: var(--hover-border);
}
.workspaceSearch input:focus-visible {
border-color: var(--primary);
background: var(--surface);
box-shadow: 0 0 0 1px var(--primary), var(--focus-ring);
}
.workspaceSearchIcon {
position: absolute;
left: 9px;
top: 50%;
width: 14px;
height: 14px;
margin-top: -7px;
color: var(--muted-soft);
pointer-events: none;
}
.workspaceSearchClear {
position: absolute;
right: 6px;
top: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
margin-top: -10px;
padding: 0;
border: 0;
border-radius: var(--radius-sm);
color: var(--muted-soft);
background: transparent;
cursor: pointer;
transition: color var(--motion-fast), background var(--motion-fast);
}
.workspaceSearchClear:hover {
color: var(--text);
background: var(--surface-muted);
}
.row.isSearchHidden,
.sectionTitle.isSearchHidden {
display: none !important;
}
.configSearchEmpty {
margin: 12px 0;
padding: 24px;
border: 1px dashed var(--border);
border-radius: var(--radius-md);
text-align: center;
color: var(--muted);
}
.sideNav {
position: static;
display: flex;
@@ -1742,6 +1825,71 @@ details[open] > summary.sectionTitle::before {
background: color-mix(in oklab, var(--primary) 25%, transparent);
}
/* Log line classification colors */
.logLine {
display: inline;
}
.logError {
color: var(--danger);
}
.logWarn {
color: var(--warning);
}
.logSuccess {
color: var(--success);
}
.logInfo {
color: var(--text);
}
.logDebug {
color: var(--muted-soft);
}
/* ==================== Skeleton placeholders ==================== */
@keyframes skeletonShimmer {
0% { background-position: -200% 0; }
100% { background-position: 200% 0; }
}
.skeleton {
position: relative;
overflow: hidden;
background:
linear-gradient(90deg,
transparent 0,
color-mix(in oklab, var(--text) 6%, transparent) 50%,
transparent 100%) var(--surface-muted);
background-size: 200% 100%;
background-repeat: no-repeat;
animation: skeletonShimmer 1.6s linear infinite;
border-radius: var(--radius-sm);
color: transparent !important;
user-select: none;
pointer-events: none;
}
.skeleton * {
visibility: hidden;
}
.skeletonText {
display: inline-block;
width: var(--skeleton-w, 60%);
height: 0.85em;
vertical-align: middle;
}
@media (prefers-reduced-motion: reduce) {
.skeleton {
animation: none;
}
}
/* Global thin scrollbars */
* {
scrollbar-width: thin;
@@ -1769,6 +1917,143 @@ details[open] > summary.sectionTitle::before {
background-clip: padding-box;
}
/* ==================== Toast ==================== */
.toastContainer {
position: fixed;
right: 20px;
bottom: 20px;
z-index: 100;
display: flex;
flex-direction: column;
gap: 8px;
max-width: min(420px, calc(100vw - 40px));
pointer-events: none;
}
.toast {
display: grid;
grid-template-columns: 18px 1fr auto;
align-items: start;
gap: 10px;
padding: 12px 12px 12px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--surface);
color: var(--text);
font-size: var(--text-sm);
line-height: var(--leading-snug);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
pointer-events: auto;
animation: toastIn 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
position: relative;
overflow: hidden;
}
:root[data-theme="dark"] .toast {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.toast::before {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 3px;
content: "";
background: var(--muted-soft);
}
.toast-success {
border-color: color-mix(in oklab, var(--success) 30%, var(--border));
}
.toast-success::before { background: var(--success); }
.toast-success .toastIcon { color: var(--success); }
.toast-error {
border-color: color-mix(in oklab, var(--danger) 30%, var(--border));
}
.toast-error::before { background: var(--danger); }
.toast-error .toastIcon { color: var(--danger); }
.toast-warn {
border-color: color-mix(in oklab, var(--warning) 30%, var(--border));
}
.toast-warn::before { background: var(--warning); }
.toast-warn .toastIcon { color: var(--warning); }
.toast-info::before { background: var(--primary); }
.toast-info .toastIcon { color: var(--primary); }
.toastIcon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
margin-top: 1px;
}
.toastIcon svg {
width: 18px;
height: 18px;
}
.toastBody {
min-width: 0;
color: var(--text);
overflow-wrap: anywhere;
}
.toastClose {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
margin: -2px -2px 0 4px;
padding: 0;
border: 0;
border-radius: var(--radius-sm);
color: var(--muted-soft);
background: transparent;
cursor: pointer;
transition: background var(--motion-fast), color var(--motion-fast);
}
.toastClose:hover {
color: var(--text);
background: var(--surface-muted);
}
.toast.isLeaving {
animation: toastOut 220ms ease forwards;
}
@keyframes toastIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
to { opacity: 0; transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
.toast,
.toast.isLeaving {
animation: none;
}
}
@media (max-width: 640px) {
.toastContainer {
right: 12px;
bottom: 12px;
left: 12px;
max-width: none;
}
}
@media (max-width: 900px) {
:root {
--page-pad: 14px;
@@ -1793,6 +2078,24 @@ details[open] > summary.sectionTitle::before {
justify-content: flex-start;
}
.secondaryActions::before {
display: none;
}
#btnTheme {
margin-left: auto;
}
.workspaceHeader {
align-items: stretch;
flex-direction: column;
gap: var(--space-3);
}
.workspaceSearch {
width: 100%;
}
.overview {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
@@ -1929,6 +2232,21 @@ details[open] > summary.sectionTitle::before {
grid-template-columns: 1fr;
}
.inline2 > .input,
.inline2 > input {
border-radius: var(--radius-md);
margin-left: 0;
}
.workspaceHeader {
align-items: stretch;
flex-direction: column;
}
.workspaceSearch {
width: 100%;
}
.statsGrid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}