Skip to content

Commit

Permalink
feat: 前端配置返回节点管理url (TencentBlueKing#3289)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambition9186 authored and Maclon9573 committed Jun 25, 2024
1 parent 487e8b6 commit 0f46256
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bcs-services/bcs-bscp/cmd/ui/service/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func (s *WebServer) subRouter() http.Handler {
CMDBHost: config.G.Frontend.Host.BKCMDBHost,
EnableBKNotice: config.G.Frontend.EnableBKNotice,
Helper: config.G.Frontend.Helper,
FeedAddr: config.G.Base.FeedAddr,
NodeManHost: config.G.Frontend.Host.BKNODEMANHOST,
}

if shouldProxyAPI {
Expand Down
2 changes: 2 additions & 0 deletions bcs-services/bcs-bscp/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type IndexConfig struct {
Helper string
ProxyAPI bool
FeedAddr string
NodeManHost string
}

// EmbedWebServer 前端 web server
Expand Down Expand Up @@ -168,6 +169,7 @@ func (e *EmbedWeb) RenderIndexHandler(conf *IndexConfig) http.Handler {
"ENABLE_BK_NOTICE": strconv.FormatBool(conf.EnableBKNotice),
"HELPER": conf.Helper,
"FEED_ADDR": conf.FeedAddr,
"BK_NODE_HOST": conf.NodeManHost,
}

// 本地开发模式 / 代理请求
Expand Down
1 change: 1 addition & 0 deletions bcs-services/bcs-bscp/pkg/config/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type BaseConf struct {
TimeZone string `yaml:"time_zone"`
LanguageCode string `yaml:"language_code"`
RunEnv string `yaml:"run_env"`
FeedAddr string `yaml:"feed_addr"`
Location *time.Location `yaml:"-"`
}

Expand Down
7 changes: 4 additions & 3 deletions bcs-services/bcs-bscp/pkg/config/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ package config

// HostConf host conf
type HostConf struct {
BKIAMHost string `yaml:"bk_iam_host"` // 权限中心
BKCMDBHost string `yaml:"bk_cmdb_host"` // 配置平台
BSCPAPIURL string `yaml:"bscp_api_url"` // bscp api地址
BKIAMHost string `yaml:"bk_iam_host"` // 权限中心
BKCMDBHost string `yaml:"bk_cmdb_host"` // 配置平台
BSCPAPIURL string `yaml:"bscp_api_url"` // bscp api地址
BKNODEMANHOST string `yaml:"bk_nodeman_host"` // 节点管理地址
}

// FrontendConf docs and host conf
Expand Down

0 comments on commit 0f46256

Please sign in to comment.