Skip to content

Commit 8f30789

Browse files
AdachiAndShimamuravyloy
authored andcommitted
* Fix bugs
* Remove irrelevant code
1 parent 444686f commit 8f30789

File tree

2 files changed

+12
-19
lines changed
  • libcs

2 files changed

+12
-19
lines changed

libcs/client/web/api/api.go

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"github.com/isrc-cas/gt/web/server/model/request"
1111
"github.com/isrc-cas/gt/web/server/model/response"
1212
"github.com/isrc-cas/gt/web/server/util"
13-
"os"
14-
"os/exec"
1513
)
1614

1715
func HealthCheck(ctx *gin.Context) {
@@ -183,24 +181,10 @@ func SaveConfigToFile(c *client.Client) gin.HandlerFunc {
183181
}
184182
c.Logger.Info().Str("config", fullPath).Msg("save config to file")
185183

186-
err = ReloadServicesCommand(c)
187-
if err != nil {
188-
response.FailWithMessage(err.Error(), ctx)
189-
return
190-
}
184+
Reload(ctx)
191185
response.SuccessWithMessage("save config to "+fullPath, ctx)
192186
}
193187
}
194-
func ReloadServicesCommand(c *client.Client) (err error) {
195-
execPath := os.Args[0]
196-
command := exec.Command(execPath, "-s", "reload")
197-
_, err = command.CombinedOutput()
198-
if err != nil {
199-
c.Logger.Logger.Info().Msg("failed to exec command-reload:" + err.Error())
200-
return
201-
}
202-
return
203-
}
204188

205189
// Restart for a brand-new config process,
206190
// not only reload the services,
@@ -214,6 +198,15 @@ func Restart(ctx *gin.Context) {
214198
response.Success(ctx)
215199
}
216200

201+
func Reload(ctx *gin.Context) {
202+
err := util.SendSignal("reload")
203+
if err != nil {
204+
response.FailWithMessage(err.Error(), ctx)
205+
return
206+
}
207+
response.Success(ctx)
208+
}
209+
217210
func Stop(ctx *gin.Context) {
218211
err := util.SendSignal("stop")
219212
if err != nil {

libcs/web/front/src/languages/lang/zh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export namespace zh {
102102
Local: "本地服务的 URL",
103103
LocalURL: "本地服务的 URL",
104104
LocalTimeout: "本地连接的超时时间。支持值如 '30s'、'5m'",
105-
UseLocalAsHTTPHost: "使用本地主机作为GT-Server主机",
105+
UseLocalAsHTTPHost: "使用本地URL作为HTTP Header Host的值",
106106

107107
// Sentry 设置
108108
SentryDSN: "要使用的 Sentry DSN",
@@ -238,7 +238,7 @@ export namespace zh {
238238
RemoteTCPRandom: "GT-Server TCP随机端口",
239239
LocalURL: "本地 URL",
240240
LocalTimeout: "本地连接超时时间",
241-
UseLocalAsHTTPHost: "使用本地主机运行GT-Server",
241+
UseLocalAsHTTPHost: "HTTP Header Host替换",
242242
TcpForwardAddr: "TCP 转发地址",
243243
TcpForwardHostPrefix: "TCP 转发主机前缀",
244244
TcpForwardConnections: "TCP 转发连接数",

0 commit comments

Comments
 (0)