优化 K8s 页面布局与 local 模式部署收尾

P0-P1:
- Dockerfile.embed 启用 CGO 支持 SQLite+redka
- K8s scale>1 时警告 local 模式数据不共享

K8s UI:
- 移除侧边栏资源用量/容量分析及资源页横向 Tab 栏
- 修复事件路由(/workloads/events)与 Deployment 事件过滤
- 网络/配置/存储统一 YamlViewer 编辑,加大编辑弹窗
This commit is contained in:
Logan.Li committed 2026-06-26 13:36:27 +08:00
1 parent 859db427a4
commit 339b24a579
12 files changed
+87 -90

No files matched your search

@@ -183,12 +183,12 @@ export function YamlViewer({ clusterCode, namespace, resource, name, onClose, on
// 弹窗模式(原有行为)
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60" onClick={onClose}>
<div className="bg-slate-900 border border-slate-700 rounded-xl w-[90vw] max-w-4xl max-h-[85vh] flex flex-col shadow-2xl" onClick={e => e.stopPropagation()}>
<div className="bg-slate-900 border border-slate-700 rounded-xl w-[92vw] max-w-5xl h-[88vh] flex flex-col shadow-2xl" onClick={e => e.stopPropagation()}>
{/* Header */}
<div className="flex items-center justify-between p-4 border-b border-slate-700">
<div>
<h2 className="text-lg font-bold text-slate-100">{resource}/{name}</h2>
<p className="text-xs text-slate-500">{namespace} · {clusterCode}</p>
<h2 className="text-lg font-bold text-slate-100">{editing ? 'YAML 编辑' : 'YAML 查看'} — {resource}/{name}</h2>
<p className="text-xs text-slate-500">{namespace} · {clusterCode}{editing ? ' · 已清理只读字段' : ''}</p>
</div>
<div className="flex items-center gap-2">
<Button variant="outline" size="sm" className="h-8 border-slate-700 text-slate-300" onClick={copyYaml}>
@@ -229,13 +229,13 @@ export function YamlViewer({ clusterCode, namespace, resource, name, onClose, on
</div>
</div>
{/* Body */}
<div className="flex-1 overflow-auto p-4">
<div className="flex-1 min-h-0 overflow-hidden p-4">
{loading ? (
<div className="flex items-center justify-center h-full"><Loader2 className="h-6 w-6 animate-spin text-slate-500" /></div>
) : (
<CodeMirror
value={display}
height="600px"
height="100%"
theme={oneDark}
extensions={extensions}
onChange={(val) => editing && setEditYaml(val)}
@@ -249,7 +249,7 @@ export function YamlViewer({ clusterCode, namespace, resource, name, onClose, on
closeBrackets: true,
indentOnInput: true,
}}
style={{ fontSize: '12px' }}
style={{ fontSize: '13px', height: '100%' }}
/>
)}
</div>