Skip to content

Commit

Permalink
增加服务状态页配置
Browse files Browse the repository at this point in the history
  • Loading branch information
mylxsw committed Dec 1, 2023
1 parent 1636913 commit 79a2bf0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ type Config struct {

// 字体文件路径
FontPath string `json:"font_path" yaml:"font_path"`
// 服务状态页面
ServiceStatusPage string `json:"service_status_page" yaml:"service_status_page"`
}

func (conf *Config) SupportProxy() bool {
Expand Down Expand Up @@ -493,7 +495,8 @@ func Register(ins *app.App) {
BeichouPrompt: strings.TrimSpace(ctx.String("virtual-model-beichou-prompt")),
},

FontPath: ctx.String("font-path"),
FontPath: ctx.String("font-path"),
ServiceStatusPage: ctx.String("service-status-page"),
}
})
}
1 change: 1 addition & 0 deletions config/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,5 @@ func initCmdFlags(ins *app.App) {
ins.AddStringFlag("price-table-file", "", "价格表文件路径,留空则使用默认价格表")

ins.AddStringFlag("font-path", "", "字体文件路径")
ins.AddStringFlag("service-status-page", "", "服务状态页面,留空则不启用服务状态页面")
}
2 changes: 2 additions & 0 deletions server/controllers/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ func (ctl *InfoController) Capabilities(ctx context.Context, webCtx web.Context,
"support_websocket": ctl.conf.EnableWebsocket,
// 是否支持 API Keys 配置
"support_api_keys": ctl.conf.EnableAPIKeys,
// 服务状态页
"service_status_page": ctl.conf.ServiceStatusPage,
})
}

Expand Down

0 comments on commit 79a2bf0

Please sign in to comment.