diff --git a/cmd/agent/conf/config.go b/cmd/agent/conf/config.go index 635fd1a1ca3fcdfdfa12119acdd83e01dbea8076..fdd83e376436d33bb38208feb40e6b10e533b04a 100644 --- a/cmd/agent/conf/config.go +++ b/cmd/agent/conf/config.go @@ -49,14 +49,13 @@ func config_file() string { var global_config ServerConfig func init() { - flag.StringVar(&Config_dir, "conf", "/opt/PilotGo/plugin/topology/agent", "topo-agent configuration directory") + flag.StringVar(&Config_dir, "conf", "./", "topo-agent configuration directory") flag.Parse() err := readConfig(config_file(), &global_config) if err != nil { err = errors.Wrap(err, "") - fmt.Printf("%s\n", errors.Cause(err).Error()) // err top - // errors.EORE(err) + fmt.Printf("%s\n", errors.Cause(err).Error()) os.Exit(-1) } } diff --git a/cmd/server/conf/config.go b/cmd/server/conf/config.go index 70235eebd5cc9901a0e35bdead520d57d5bd527e..e128d074b560075475a03e1d0dcd1bf9272170fc 100644 --- a/cmd/server/conf/config.go +++ b/cmd/server/conf/config.go @@ -36,9 +36,9 @@ func ConfigFile() string { } func InitConfig() { - flag.StringVar(&config_dir, "conf", "/opt/PilotGo/plugin/topology/server", "topo-server configuration directory") + flag.StringVar(&config_dir, "conf", "./", "topo-server configuration directory") flag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage: %s -conf /PATH/TO/TOPO_SERVER.YAML(default:/opt/PilotGo/plugin/topology/server) \n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s -conf /PATH/TO/TOPO_SERVER.YAML(default: ./) \n", os.Args[0]) } flag.Parse() diff --git a/cmd/server/webserver/frontendResource/static.go b/cmd/server/webserver/frontendResource/static.go index 335ea2379575fd9f24e83fedd05d9ac10930d832..48c384881818ff78d76c72a4bda744bdfd6d10ee 100644 --- a/cmd/server/webserver/frontendResource/static.go +++ b/cmd/server/webserver/frontendResource/static.go @@ -13,13 +13,13 @@ import ( func StaticRouter(router *gin.Engine) { static := router.Group("/plugin/topology") { - static.Static("/assets", "./web/dist/assets") - static.StaticFile("/", "./web/dist/index.html") + static.Static("/assets", "../web/dist/assets") + static.StaticFile("/", "../web/dist/index.html") // 解决页面刷新404的问题 router.NoRoute(func(c *gin.Context) { if !strings.HasPrefix(c.Request.RequestURI, "/plugin/topology/api") { - c.File("./web/dist/index.html") + c.File("../web/dist/index.html") return } c.AbortWithStatus(http.StatusNotFound) diff --git a/go.mod b/go.mod index a432938a828362537868b4d6ed3d6956cdb5aeea..f6535a6c7f092bd16d9ad92718bff8bbff11edc2 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module gitee.com/openeuler/PilotGo-plugin-topology go 1.21 -toolchain go1.22.7 - require ( gitee.com/openeuler/PilotGo/sdk v0.0.0-20240711084602-e34bc1158484 github.com/fsouza/go-dockerclient v1.11.0 diff --git a/web/src/views/topoLogs/index.vue b/web/src/views/topoLogs/index.vue index 6a648b6f45033a34d05fb3f36a12f5bebae66bcc..e0eae91df011edc336e313146d4b947ec5c325a7 100644 --- a/web/src/views/topoLogs/index.vue +++ b/web/src/views/topoLogs/index.vue @@ -170,14 +170,18 @@ const getLogData = (_params?: any) => { } else { // 初始,请求集群信息 getELKLogData(handleParams()).then(res => { - if (res.data.code === 200) { - if (res.data.data.length > 0) { - logs.value = res.data.data; + if (typeof res === "undefined") { + ElMessage.error("elk plugin unreachable") + } else { + if (res.data.code === 200) { + if (res.data.data.length > 0) { + logs.value = res.data.data; + } else { + ElMessage.info('无数据,请稍后重试') + } } else { - ElMessage.info('无数据,请稍后重试') + ElMessage.error(res.data.msg) } - } else { - ElMessage.error(res.data.msg) } }) }