mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 16:10:59 +08:00
finish translation for panel.getInfo
This commit is contained in:
@@ -114,14 +114,14 @@ func (receiver *Panel) Handle(ctx console.Context) error {
|
||||
var user models.User
|
||||
err := facades.Orm().Query().Where("id", 1).FirstOrFail(&user)
|
||||
if err != nil {
|
||||
color.Redln("获取管理员信息失败")
|
||||
color.Redln(translate.Get("commands.panel.getInfo.adminGetFail"))
|
||||
return nil
|
||||
}
|
||||
|
||||
password := tools.RandomString(16)
|
||||
hash, err := facades.Hash().Make(password)
|
||||
if err != nil {
|
||||
color.Redln("生成密码失败")
|
||||
color.Redln(translate.Get("commands.panel.getInfo.passwordGenerationFail"))
|
||||
return nil
|
||||
}
|
||||
user.Username = tools.RandomString(8)
|
||||
@@ -132,13 +132,13 @@ func (receiver *Panel) Handle(ctx console.Context) error {
|
||||
|
||||
err = facades.Orm().Query().Save(&user)
|
||||
if err != nil {
|
||||
color.Redln("保存管理员信息失败")
|
||||
color.Redln(translate.Get("commands.panel.getInfo.adminSaveFail"))
|
||||
return nil
|
||||
}
|
||||
|
||||
port, err := tools.Exec(`cat /www/panel/panel.conf | grep APP_PORT | awk -F '=' '{print $2}' | tr -d '\n'`)
|
||||
if err != nil {
|
||||
color.Redln("获取面板端口失败")
|
||||
color.Redln(translate.Get("commands.panel.getInfo.portFail"))
|
||||
return nil
|
||||
}
|
||||
ip, err := tools.GetPublicIP()
|
||||
@@ -150,11 +150,11 @@ func (receiver *Panel) Handle(ctx console.Context) error {
|
||||
protocol = "https"
|
||||
}
|
||||
|
||||
color.Greenln("用户名: " + user.Username)
|
||||
color.Greenln("密码: " + password)
|
||||
color.Greenln("面板端口: " + port)
|
||||
color.Greenln("面板入口: " + facades.Config().GetString("http.entrance"))
|
||||
color.Greenln("面板地址: " + protocol + "://" + ip + ":" + port + facades.Config().GetString("http.entrance"))
|
||||
color.Greenln(translate.Get("commands.panel.getInfo.username") + ": " + user.Username)
|
||||
color.Greenln(translate.Get("commands.panel.getInfo.password") + ": " + password)
|
||||
color.Greenln(translate.Get("commands.panel.getInfo.port") + ": " + port)
|
||||
color.Greenln(translate.Get("commands.panel.getInfo.entrance") + ": " + facades.Config().GetString("http.entrance"))
|
||||
color.Greenln(translate.Get("commands.panel.getInfo.address") + ": " + protocol + "://" + ip + ":" + port + facades.Config().GetString("http.entrance"))
|
||||
|
||||
case "getPort":
|
||||
port, err := tools.Exec(`cat /www/panel/panel.conf | grep APP_PORT | awk -F '=' '{print $2}' | tr -d '\n'`)
|
||||
|
||||
11
lang/en.json
11
lang/en.json
@@ -19,7 +19,16 @@
|
||||
"success": "update completed"
|
||||
},
|
||||
"getInfo": {
|
||||
"description": "reinitialize panel account information"
|
||||
"description": "reinitialize panel account information",
|
||||
"adminGetFail": "failed to get administrator information",
|
||||
"adminSaveFail": "failed to save administrator information",
|
||||
"passwordGenerationFail": "failed to generate password",
|
||||
"portFail": "failed to get panel port",
|
||||
"username": "Username",
|
||||
"password": "Password",
|
||||
"port": "Panel port",
|
||||
"entrance": "Panel entrance",
|
||||
"address": "Panel address"
|
||||
},
|
||||
"getPort": {
|
||||
"description": "get the panel access port",
|
||||
|
||||
@@ -19,7 +19,16 @@
|
||||
"success": "更新成功"
|
||||
},
|
||||
"getInfo": {
|
||||
"description": "重新初始化面板账号信息"
|
||||
"description": "重新初始化面板账号信息",
|
||||
"adminGetFail": "获取管理员信息失败",
|
||||
"adminSaveFail": "保存管理员信息失败",
|
||||
"passwordGenerationFail": "生成密码失败",
|
||||
"portFail": "获取面板端口失败",
|
||||
"username": "用户名",
|
||||
"password": "密码",
|
||||
"port": "面板端口",
|
||||
"entrance": "面板入口",
|
||||
"address": "面板地址"
|
||||
},
|
||||
"getPort": {
|
||||
"description": "获取面板访问端口",
|
||||
|
||||
Reference in New Issue
Block a user