From 0a0b1bd2b14365d71d51e2b1c868ae4e585fe667 Mon Sep 17 00:00:00 2001 From: axif Date: Tue, 13 Aug 2024 02:25:45 +0600 Subject: [PATCH] path fix Signed-off-by: axif --- cmd/api/app/routes/config/handler.go | 11 +---------- cmd/api/app/routes/config/misc.go | 8 +------- ui/apps/dashboard/src/services/config.ts | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/cmd/api/app/routes/config/handler.go b/cmd/api/app/routes/config/handler.go index 466ba087..c8c5736f 100644 --- a/cmd/api/app/routes/config/handler.go +++ b/cmd/api/app/routes/config/handler.go @@ -9,14 +9,6 @@ import ( ) -func handleGetconfig(c *gin.Context) { - message, err := SendMessage() - if err != nil { - common.Fail(c, err) - return - } - c.JSON(200, gin.H{"message": message}) -} func handleGetRunningapps(c *gin.Context) { podLabels, err := GetRunningapps() if err != nil { @@ -81,10 +73,9 @@ func handleGetPodLogs(c *gin.Context) { func init() { r := router.V1() r.GET("/config/running-apps", handleGetRunningapps) - r.GET("/config/pods/:appLabel", handleGetMetaData) + r.GET("/config/apps/:appLabel", handleGetMetaData) r.GET("/config/status/:podName", handleCheckDeploymentStatus) r.GET("/config/restart/:podName", handleRestartDeployment) - r.GET("/config", handleGetconfig) r.GET("/config/reinstall/:podName", handleReinstallPod) r.GET("/config/log/:podName", handleGetPodLogs) } diff --git a/cmd/api/app/routes/config/misc.go b/cmd/api/app/routes/config/misc.go index 16010023..6b87b493 100644 --- a/cmd/api/app/routes/config/misc.go +++ b/cmd/api/app/routes/config/misc.go @@ -11,12 +11,6 @@ import ( "io" corev1 "k8s.io/api/core/v1" ) -func SendMessage() (string, error) { - message := "hello" - fmt.Printf("Message sent: %s\n", message) - return message, nil -} - const ( namespace = "karmada-system" ) @@ -34,7 +28,7 @@ func GetRunningapps() ([]string, error) { if appLabel, exists := pod.Labels["app"]; exists { podLabels = append(podLabels, appLabel) } - } + } if len(podLabels) == 0 { return nil, fmt.Errorf("no pods found") diff --git a/ui/apps/dashboard/src/services/config.ts b/ui/apps/dashboard/src/services/config.ts index 09df7726..43bc77e2 100644 --- a/ui/apps/dashboard/src/services/config.ts +++ b/ui/apps/dashboard/src/services/config.ts @@ -29,7 +29,7 @@ interface PodDetailsResponse { } export async function GetPodDetails(podName: string): Promise { - const response = await karmadaClient.get(`config/pods/${podName}`); + const response = await karmadaClient.get(`config/apps/${podName}`); return response.data; }