mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-08 01:20:07 +08:00
fix: complete the missing international content (#7769)
This commit is contained in:
parent
77f8db7d38
commit
6a8e41937d
@ -57,11 +57,11 @@ ErrAppDirNull: '版本文件夹不存在'
|
||||
LocalAppErr: "应用 {{.name}} 同步失败!{{ .err }}"
|
||||
ErrContainerName: "容器名称已存在"
|
||||
ErrAppSystemRestart: "1Panel 重启导致任务终止"
|
||||
ErrCreateHttpClient: "创建HTTP请求失败 {{.err}}"
|
||||
ErrCreateHttpClient: "创建请求失败 {{ .err }}"
|
||||
ErrHttpReqTimeOut: "请求超时 {{ .err }}"
|
||||
ErrHttpReqFailed: "请求失败 {{ .err }}"
|
||||
ErrHttpReqNotFound: "文件不存在"
|
||||
ErrNoSuchHost: "网络连接失败"
|
||||
ErrNoSuchHost: "无法找到请求的服务器 {{ .err }}"
|
||||
ErrHttpReqNotFound: "无法找到请求的资源 {{ .err }}"
|
||||
ErrImagePullTimeOut: '镜像拉取超时'
|
||||
ErrContainerNotFound: '{{ .name }} 容器不存在'
|
||||
ErrContainerMsg: '{{ .name }} 容器异常,具体请在容器页面查看日志'
|
||||
|
@ -14,6 +14,10 @@ func ErrorWithDetail(ctx *gin.Context, code int, msgKey string, err error) {
|
||||
Code: code,
|
||||
Message: "",
|
||||
}
|
||||
if msgKey == "ErrCaptchaCode" || msgKey == "ErrAuth" {
|
||||
res.Code = 406
|
||||
res.Message = msgKey
|
||||
}
|
||||
res.Message = i18n.GetMsgWithMap(msgKey, map[string]interface{}{"detail": err})
|
||||
ctx.JSON(http.StatusOK, res)
|
||||
ctx.Abort()
|
||||
|
@ -15,6 +15,13 @@ ErrApiConfigIPInvalid: "调用 API 接口 IP 不在白名单: {{ .detail }}"
|
||||
ErrApiConfigDisable: "此接口禁止使用 API 接口调用: {{ .detail }}"
|
||||
ErrApiConfigKeyTimeInvalid: "API 接口时间戳错误: {{ .detail }}"
|
||||
|
||||
#request
|
||||
ErrNoSuchHost: "无法找到请求的服务器 {{ .err }}"
|
||||
ErrHttpReqNotFound: "无法找到请求的资源 {{ .err }}"
|
||||
ErrHttpReqFailed: "请求失败 {{ .err }}"
|
||||
ErrHttpReqTimeOut: "请求超时 {{ .err }}"
|
||||
ErrCreateHttpClient: "创建请求失败 {{ .err }}"
|
||||
|
||||
#common
|
||||
ErrDemoEnvironment: "演示服务器,禁止此操作!"
|
||||
ErrCmdTimeout: "命令执行超时!"
|
||||
@ -23,6 +30,9 @@ ErrGroupIsDefault: "默认分组,无法删除"
|
||||
ErrLocalDelete: "无法删除本地节点!"
|
||||
ErrPortInUsed: "{{ .name }} 端口已被占用!"
|
||||
|
||||
#app
|
||||
CustomAppStoreFileValid: "应用商店包需要 .tar.gz 格式"
|
||||
|
||||
#backup
|
||||
ErrBackupInUsed: "该备份账号已在计划任务中使用,无法删除"
|
||||
ErrBackupCheck: "备份账号测试连接失败 {{ .err }}"
|
||||
@ -61,19 +71,10 @@ TaskRetry: "开始第 {{ .name }} 次重试"
|
||||
SubTaskSuccess: "{{ .name }} 成功"
|
||||
SubTaskFailed: "{{ .name }} 失败: {{ .err }}"
|
||||
TaskInstall: "安装"
|
||||
TaskUninstall: "卸载"
|
||||
TaskCreate: "创建"
|
||||
TaskDelete: "删除"
|
||||
TaskUpgrade: "升级"
|
||||
TaskUpdate: "更新"
|
||||
TaskRestart: "重启"
|
||||
TaskRollback: "回滚"
|
||||
SuccessStatus: "{{ .name }} 成功"
|
||||
FailedStatus: "{{ .name }} 失败 {{.err}}"
|
||||
PullImage: "拉取镜像"
|
||||
Start: "开始"
|
||||
Run: "启动"
|
||||
Stop: "停止"
|
||||
SubTask: "子任务"
|
||||
|
||||
#upgrade node
|
||||
|
@ -99,13 +99,13 @@ func handleGetWithTransport(url string, transport *http.Transport) (*http.Respon
|
||||
return nil, buserr.WithMap("ErrHttpReqTimeOut", map[string]interface{}{"err": err.Error()}, err)
|
||||
} else {
|
||||
if strings.Contains(err.Error(), "no such host") {
|
||||
return nil, buserr.New("ErrNoSuchHost")
|
||||
return nil, buserr.WithErr("ErrNoSuchHost", errors.New("no such host"))
|
||||
}
|
||||
return nil, buserr.WithMap("ErrHttpReqFailed", map[string]interface{}{"err": err.Error()}, err)
|
||||
}
|
||||
}
|
||||
if resp.StatusCode == 404 {
|
||||
return nil, buserr.New("ErrHttpReqNotFound")
|
||||
return nil, buserr.WithErr("ErrHttpReqNotFound", errors.New("no such resource"))
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user