feat(k8s): M14 Namespace 管理看板(资源配额 + 命名空间 CRUD)

- 后端: ListNamespacesDetailed/CreateNamespace/DeleteNamespace/ListResourceQuotas/ListLimitRanges
- 后端: GetNamespacesDetail handler (6 API calls aggregate, not N×3)
- 后端: CreateNamespaceHandler + DeleteNamespaceHandler (system NS protection)
- 前端: NamespaceManagementPage.tsx (~280行) — 表格+概览卡片+创建/删除弹框
- 路由: GET/POST/DELETE /:clusterCode/namespaces + GET /namespace/:ns/detail
- 验证: 9/9 通过 (urllib), TS 零错误, Vite 构建成功
This commit is contained in:
attacker committed 2026-06-24 23:46:52 +08:00
1 parent c7b61968bc
commit 8240a88a84
33 files changed
+2029 -71

No files matched your search

+16
View File
@@ -19,6 +19,7 @@ const (
pollPath = "/api/v1/agent/tasks/poll"
resultPathFmt = "/api/v1/agent/tasks/%s/result"
probePath = "/api/v1/agent/health-probes/config"
portPolicyPath = "/api/v1/agent/port-policy"
)
// Client 负责与后端任务/探针接口通信。
@@ -74,3 +75,18 @@ func (c *Client) PollProbes(ctx context.Context) ([]model.ProbeConfig, error) {
}
return wrapper.Data, nil
}
// PollPortPolicy 拉取本机端口过滤策略(可选配置,拉取失败静默忽略) // Logan.Li
func (c *Client) PollPortPolicy(ctx context.Context) (*model.PortPolicy, error) {
path := portPolicyPath + "?hostname=" + url.QueryEscape(c.hostname)
var wrapper struct {
Code int `json:"code"`
Message string `json:"message"`
Data model.PortPolicy `json:"data"`
}
if err := c.client.DoJSON(ctx, "GET", path, nil, &wrapper); err != nil {
return nil, fmt.Errorf("端口策略拉取失败: %w", err)
}
return &wrapper.Data, nil
}