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

+9 -7
View File
@@ -1605,13 +1605,14 @@ func (h *KubernetesHandler) listDeploymentsWithNS(c *gin.Context, ns string) {
deps, err := client.ListDeployments()
if err != nil { c.JSON(500, models.Response{Code: 500, Message: "K8s API error: " + err.Error()}); return }
type DepSummary struct {
Namespace string `json:"namespace"`
Name string `json:"name"`
Replicas int `json:"replicas"`
AvailableReplicas int `json:"available_replicas"`
ReadyReplicas int `json:"ready_replicas"`
Image string `json:"image"`
Paused bool `json:"paused"`
Namespace string `json:"namespace"`
Name string `json:"name"`
Replicas int `json:"replicas"`
AvailableReplicas int `json:"available_replicas"`
ReadyReplicas int `json:"ready_replicas"`
Image string `json:"image"`
Paused bool `json:"paused"`
Selector map[string]string `json:"selector,omitempty"` // matchLabels — 前端 Service Tab 关联用
}
result := []DepSummary{}
for _, d := range deps.Items {
@@ -1625,6 +1626,7 @@ func (h *KubernetesHandler) listDeploymentsWithNS(c *gin.Context, ns string) {
ReadyReplicas: d.Status.ReadyReplicas,
Image: image,
Paused: d.Spec.Paused,
Selector: func() map[string]string { if d.Spec.Selector != nil { return d.Spec.Selector.MatchLabels }; return nil }(),
})
}
c.JSON(200, models.Response{Code: 200, Data: result})