feat: 路由改名/kubectl预装/导出YAML精简/Service标签页优化/Alpine镜像源换清华

- 路由 /deploy/credentials → /deploy/configureTools
- kubectl 改为预装(Dockerfile) + 种子数据 preinstall
- 导出YAML精简: Service/Ingress/Deployment 全面清理运行时字段
- DeploymentEditService 只显示匹配 selector 的关联 Service
- Alpine 镜像源 mirrors.aliyun.com → mirrors.tuna.tsinghua.edu.cn
This commit is contained in:
attacker committed 2026-06-23 02:22:52 +00:00
1 parent dd7cb6895e
commit 451f65f9c8
9 files changed
+109 -29

No files matched your search

@@ -67,8 +67,10 @@ export function DeploymentEditService({ clusterCode, namespace, deploymentName,
const load = useCallback(async () => {
setLoading(true);
try {
// 先从 manifest 取 selector
const sel = manifest?.spec?.selector?.matchLabels || {};
// 先从 manifest 取 selector(兼容两种来源)
// full K8s manifest: spec.selector.matchLabels
// DepSummary 降级: selector (顶层)
const sel = manifest?.spec?.selector?.matchLabels || manifest?.selector || {};
setSelectorLabels(sel);
const [svcRes, ingRes] = await Promise.all([
@@ -275,7 +277,7 @@ export function DeploymentEditService({ clusterCode, namespace, deploymentName,
<CardTitle className="text-sm text-slate-200 flex items-center gap-2">
<Network className="h-4 w-4 text-blue-400" />
Services
<Badge variant="outline" className="border-slate-700 text-slate-400">{matchedSvcs.length}/{services.length}</Badge>
<Badge variant="outline" className="border-slate-700 text-slate-400">{matchedSvcs.length} 个关联</Badge>
</CardTitle>
<Button size="sm" variant="outline" className="h-7 border-slate-700 text-slate-300 text-xs"
onClick={() => { setSvcForm(s => ({ ...s, name: `${deploymentName}-svc`, port: '80', targetPort: '80' })); setShowCreate('service'); }}>
@@ -283,18 +285,18 @@ export function DeploymentEditService({ clusterCode, namespace, deploymentName,
</Button>
</div>
<p className="text-xs text-slate-500 mt-1">
高亮的是 selector 匹配此 Deployment 的 Service({matchedSvcs.length} 个关联 / {services.length} 个总数)
仅显示 selector 匹配此 Deployment 的关联 Service
</p>
</CardHeader>
<CardContent className="pt-0">
{services.length === 0 ? (
{matchedSvcs.length === 0 ? (
<div className="text-center py-6 text-slate-500 text-sm border border-dashed border-slate-800 rounded-lg">
<Network className="h-8 w-8 mx-auto mb-2 text-slate-700" />
当前命名空间暂无 Service
</div>
) : (
<div className="space-y-2">
{services.map(svc => {
{matchedSvcs.map(svc => {
const matched = selectorMatches(svc.selector);
return (
<div key={svc.name} className={`rounded-lg border p-3 ${matched ? 'border-blue-700/50 bg-blue-950/20' : 'border-slate-800 bg-slate-950/30'}`}>
+1 -1
View File
@@ -74,7 +74,7 @@ const menuItems: MenuItem[] = [
id: 'deploy', name: '应用发布', icon: Rocket,
children: [
{ id: 'pipelines', name: '流水线', icon: GitBranch, path: '/pipelines' },
{ id: 'deploy-credentials', name: '发布配置', icon: Key, path: '/deploy/credentials' },
{ id: 'deploy-credentials', name: '发布配置', icon: Key, path: '/deploy/configureTools' },
{ id: 'deploy-rbac', name: '发布权限', icon: Shield, path: '/deploy/rbac' },
],
},