Skip to content

Commit

Permalink
path fix
Browse files Browse the repository at this point in the history
Signed-off-by: axif <[email protected]>
  • Loading branch information
axif0 committed Aug 12, 2024
1 parent 95d3c93 commit 0a0b1bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
11 changes: 1 addition & 10 deletions cmd/api/app/routes/config/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
Expand Down
8 changes: 1 addition & 7 deletions cmd/api/app/routes/config/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion ui/apps/dashboard/src/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface PodDetailsResponse {
}

export async function GetPodDetails(podName: string): Promise<PodDetailsResponse> {
const response = await karmadaClient.get<PodDetailsResponse>(`config/pods/${podName}`);
const response = await karmadaClient.get<PodDetailsResponse>(`config/apps/${podName}`);
return response.data;
}

Expand Down

0 comments on commit 0a0b1bd

Please sign in to comment.