feat: add resource edit functionality for k8s resources

- Add edit button for Deployment, StatefulSet, Service, and ConfigMap resources
- Implement resource fetch API to get YAML representation
- Implement resource update API to apply edited YAML
- Add edit dialog with YAML editor and apply/cancel buttons
- Add tooltip icons for better UX
- Restore K8sResourceApply function with HTTP/1.1 enforcement
- Support for fetching and updating the following resource kinds:
  - Deployment
  - StatefulSet
  - Service
  - ConfigMap

🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
loveuer
2025-11-13 09:25:41 +08:00
parent 7d2e2ab842
commit 529a90b80d
3 changed files with 356 additions and 28 deletions

View File

@@ -67,6 +67,8 @@ func Init(ctx context.Context, address string, db *gorm.DB, store store.Store) (
k8sAPI.Post("/config", k8s.ClusterConfigSet(ctx, db, store))
// resource operations
k8sAPI.Post("/resource/apply", k8s.K8sResourceApply(ctx, db, store))
k8sAPI.Get("/resource/get", k8s.K8sResourceFetch(ctx, db, store))
k8sAPI.Post("/resource/update", k8s.K8sResourceUpdate(ctx, db, store))
// resource list
k8sAPI.Get("/namespace/list", k8s.K8sNamespaceList(ctx, db, store))
k8sAPI.Get("/deployment/list", k8s.K8sDeploymentList(ctx, db, store))