Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 7e83ba9

Browse files
authored
Merge pull request #28 from humpback/develop-0.0.1
Develop 0.0.1
2 parents d59acab + 0373ad8 commit 7e83ba9

File tree

28 files changed

+773
-587
lines changed

28 files changed

+773
-587
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN mkdir -p /workspace/config
66

77
COPY ./backend/config/*.yaml /workspace/config
88

9-
COPY ./front/projects/web/dist /workspace/html/web
9+
COPY ./front/projects/web/dist /workspace/web
1010

1111
COPY ./backend/humpback /workspace/
1212

backend/common/locales/en_us.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ var enUSMsg = map[string]string{
1717
CodeNameNotEmpty: "The name cannot be empty.",
1818

1919
CodeUserNameLimitLength: fmt.Sprintf("The user name length limit is %d to %d.", enum.LimitUsername.Min, enum.LimitUsername.Max),
20-
CodeUserNameIsInvalid: "The user name is invalid",
20+
CodeUserNameIsInvalid: "The user name is invalid.",
2121
CodeUserNameNotEmpty: "The user name cannot be empty.",
2222
CodeUserNotExist: "The user does not exist.",
2323
CodeUserIdNotEmpty: "The user ID cannot be empty.",
2424
CodeUserAlreadyExist: "The user already exists.",
2525
CodeUserNameAlreadyExist: "The user name already exists.",
2626
CodeUserIsOwner: "Can't update yourself.",
27-
28-
CodeUserRoleIsInvalid: "The user role is invalid",
27+
CodeUserRoleIsInvalid: "The user role is invalid.",
2928

3029
CodeTeamNameNotEmpty: "The team name cannot be empty.",
3130
CodeTeamNameLimitLength: fmt.Sprintf("The team name length limit is %d to %d.", enum.LimitTeamName.Min, enum.LimitTeamName.Max),
@@ -34,16 +33,16 @@ var enUSMsg = map[string]string{
3433
CodeTeamAlreadyExist: "The team already exists.",
3534
CodeTeamNameAlreadyExist: "The team name already exists.",
3635

37-
CodeEmailIsInvalid: "The email address is invalid",
36+
CodeEmailIsInvalid: "The email address is invalid.",
3837
CodeEmailLimitLength: fmt.Sprintf("The email address length limit is %d.", enum.LimitEmail.Max),
3938

4039
CodePhoneLimitLength: fmt.Sprintf("The phone number length limit is %d.", enum.LimitPhone.Max),
41-
CodePhoneIsInvalid: "The phone number is invalid",
40+
CodePhoneIsInvalid: "The phone number is invalid.",
4241

4342
CodeDescriptionLimitLength: fmt.Sprintf("The description length limit is %d.", enum.LimitDescription.Max),
4443

4544
CodePasswordLimitLength: fmt.Sprintf("The password length limit is %d to %d.", enum.LimitPassword.Min, enum.LimitPassword.Max),
46-
CodePasswordIsWrong: "Wrong password",
45+
CodePasswordIsWrong: "Wrong password.",
4746
CodePasswordNotEmpty: "The password cannot be empty.",
4847
CodeOldPasswordNotEmpty: "The old password cannot be empty.",
4948
CodeOldPasswordLimitLength: fmt.Sprintf("The old password length limit is %d to %d.", enum.LimitPassword.Min, enum.LimitPassword.Max),
@@ -84,15 +83,15 @@ var enUSMsg = map[string]string{
8483
CodeGroupNameAlreadyExist: "The group name already exists.",
8584
CodeGroupNameLimitLength: fmt.Sprintf("The group name length limit is %d to %d.", enum.LimitGroupName.Min, enum.LimitGroupName.Max),
8685
CodeGroupNameNotEmpty: "The group name cannot be empty.",
87-
CodeGroupNoPermission: "You do not have the group permission",
86+
CodeGroupNoPermission: "You do not have the group permission.",
8887

8988
CodeServiceNotExist: "The service does not exist.",
9089
CodeServiceNameNotEmpty: "The service name cannot be empty.",
9190
CodeServiceNameLimitLength: fmt.Sprintf("The service name length limit is %d to %d.", enum.LimitServiceName.Min, enum.LimitServiceName.Max),
9291
CodeServiceNameAlreadyExist: "The service name already exists.",
9392
CodeServiceIdNotEmpty: "The service ID cannot be empty.",
9493
CodeServiceImageNotEmpty: "The service image cannot be empty.",
95-
CodeServiceImageLimitLength: fmt.Sprintf("The image length limit is %d", enum.LimitImageName.Max),
94+
CodeServiceImageLimitLength: fmt.Sprintf("The image length limit is %d.", enum.LimitImageName.Max),
9695
CodeServiceNetworkModeInvalid: "The network mode is invalid.",
9796
CodeServiceRestartPolicyInvalid: "The restart policy is invalid.",
9897
CodeServiceContainerPortNotEmpty: "The container port cannot be empty.",
@@ -104,18 +103,18 @@ var enUSMsg = map[string]string{
104103
CodeServiceHostVolumeNotEmpty: "The host volume cannot be empty.",
105104
CodeServiceLabelNameNotEmpty: "The label name cannot be empty.",
106105
CodeServiceLabelValueNotEmpty: "The label value cannot be empty.",
107-
CodeServiceResourceMemoryLimitLimitMax: fmt.Sprintf("The memory limit is %d to %d", enum.LimitMemoryLimit.Min, enum.LimitMemoryLimit.Max),
108-
CodeServiceResourceMemoryReservationLimitMax: fmt.Sprintf("The memory reservation limit is %d to %d", enum.LimitMemoryReservation.Min, enum.LimitMemoryReservation.Max),
109-
CodeServiceResourceMaxCpuUsageInvalid: fmt.Sprintf("The maximum cpu usage is invalid, limit is %d to %d", enum.LimitMaxCpuUsage.Min, enum.LimitMaxCpuUsage.Max),
106+
CodeServiceResourceMemoryLimitLimitMax: fmt.Sprintf("The memory limit is %d to %d.", enum.LimitMemoryLimit.Min, enum.LimitMemoryLimit.Max),
107+
CodeServiceResourceMemoryReservationLimitMax: fmt.Sprintf("The memory reservation limit is %d to %d.", enum.LimitMemoryReservation.Min, enum.LimitMemoryReservation.Max),
108+
CodeServiceResourceMaxCpuUsageInvalid: fmt.Sprintf("The maximum cpu usage is invalid, limit is %d to %d.", enum.LimitMaxCpuUsage.Min, enum.LimitMaxCpuUsage.Max),
110109
CodeServiceDispatchModeInvalid: "The dispatch mode is invalid.",
111-
CodeServiceInstanceNumInvalid: fmt.Sprintf("The instance num is invalid. limit is %d to %d", enum.LimitInstanceNum.Min, enum.LimitInstanceNum.Max),
110+
CodeServiceInstanceNumInvalid: fmt.Sprintf("The instance num is invalid. limit is %d to %d.", enum.LimitInstanceNum.Min, enum.LimitInstanceNum.Max),
112111
CodeServicePlacementModeInvalid: fmt.Sprintf("The placement mode is invalid"),
113112
CodeServicePlacementLabelNotEmpty: "The placement label cannot be empty.",
114113
CodeServicePlacementValueNotEmpty: "The placement value cannot be empty.",
115114
CodeServiceScheduleCronNotEmpty: "The schedule cron cannot be empty.",
116115
CodeServiceScheduleCronInvalid: "The schedule cron is invalid.",
117116
CodeServiceScheduleTimeoutInvalid: "The schedule timeout is invalid.",
118-
CodeServiceProtocolInvalid: "The protocol is invalid. support 'TCP'/'UCP' .",
117+
CodeServiceProtocolInvalid: "The protocol is invalid. support 'TCP'/'UDP' .",
119118
CodeServiceOperateInvalid: "Invalid action.",
120119
CodeServiceIsNotEnable: "The service is not enabled.",
121120
CodeServiceIsEnabled: "The service is enabled.",

backend/common/locales/zh_cn.go

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,127 @@
11
package locales
22

3-
var zhCnMsg = map[string]string{}
3+
import (
4+
"fmt"
5+
6+
"humpback/common/enum"
7+
)
8+
9+
var zhCnMsg = map[string]string{
10+
CodeSucceed: "成功",
11+
CodeServerErr: "服务器错误,请联系管理员!",
12+
CodeRequestParamsInvalid: "请求参数无效。",
13+
CodeLoginExpired: "登录已过期,请重新登录。",
14+
CodeNotLogin: "未登录。",
15+
CodeNoPermission: "你没有操作权限。",
16+
17+
CodeNameNotEmpty: "名称不能为空。",
18+
19+
CodeUserNameLimitLength: fmt.Sprintf("用户名长度限制为%d到%d。", enum.LimitUsername.Min, enum.LimitUsername.Max),
20+
CodeUserNameIsInvalid: "用户名无效。",
21+
CodeUserNameNotEmpty: "用户名不能为空。",
22+
CodeUserNotExist: "用户不存在。",
23+
CodeUserIdNotEmpty: "用户ID不能为空。",
24+
CodeUserAlreadyExist: "用户已存在。",
25+
CodeUserNameAlreadyExist: "用户名已存在。",
26+
CodeUserIsOwner: "无法更新自己。",
27+
28+
CodeUserRoleIsInvalid: "用户角色无效。",
29+
30+
CodeTeamNameNotEmpty: "团队名称不能为空。",
31+
CodeTeamNameLimitLength: fmt.Sprintf("团队名称长度限制为%d到%d。", enum.LimitTeamName.Min, enum.LimitTeamName.Max),
32+
CodeTeamIdNotEmpty: "团队ID不能为空。",
33+
CodeTeamNotExist: "团队不存在。",
34+
CodeTeamAlreadyExist: "团队已经存在。",
35+
CodeTeamNameAlreadyExist: "团队名称已存在。",
36+
37+
CodeEmailIsInvalid: "电子邮件地址无效。",
38+
CodeEmailLimitLength: fmt.Sprintf("电子邮件地址长度最大限制为%d。", enum.LimitEmail.Max),
39+
40+
CodePhoneLimitLength: fmt.Sprintf("电话号码长度最大限制为%d。", enum.LimitPhone.Max),
41+
CodePhoneIsInvalid: "电话号码无效。",
42+
43+
CodeDescriptionLimitLength: fmt.Sprintf("描述长度最大限制为%d。", enum.LimitDescription.Max),
44+
45+
CodePasswordLimitLength: fmt.Sprintf("密码长度限制为%d到%d。", enum.LimitPassword.Min, enum.LimitPassword.Max),
46+
CodePasswordIsWrong: "密码错误。",
47+
CodePasswordNotEmpty: "密码不能为空。",
48+
CodeOldPasswordNotEmpty: "旧密码不能为空。",
49+
CodeOldPasswordLimitLength: fmt.Sprintf("旧密码长度限制为%d到%d。", enum.LimitPassword.Min, enum.LimitPassword.Max),
50+
CodeOldPasswordIsWrong: "旧密码错误。",
51+
CodeNewPasswordNotEmpty: "新密码不能为空。",
52+
CodeNewPasswordLimitLength: fmt.Sprintf("新密码长度限制为%d到%d。", enum.LimitPassword.Min, enum.LimitPassword.Max),
53+
54+
CodeConfigNameNotEmpty: "配置名称不能为空。",
55+
CodeConfigNameLimitLength: fmt.Sprintf("配置名称长度限制为%d到%d。", enum.LimitConfigName.Min, enum.LimitConfigName.Max),
56+
CodeConfigNameAlreadyExist: "配置名称已存在。",
57+
CodeConfigNotExist: "配置不存在。",
58+
CodeConfigValueNotEmpty: "配置值不能为空。",
59+
CodeConfigStaticValueLimitLength: fmt.Sprintf("静态配置值长度最大限制为%d。", enum.LimitConfigValue.Max/2),
60+
CodeConfigVolumeValueLimitLength: fmt.Sprintf("卷配置值长度最大限制为%d。", enum.LimitConfigValue.Max),
61+
CodeConfigTypeIsInvalid: "配置类型无效。",
62+
CodeConfigIdNotEmpty: "配置ID不能为空。",
63+
64+
CodeRegistryNotExist: "仓库不存在。",
65+
CodeRegistryIdNotEmpty: "仓库ID不能为空。",
66+
CodeRegistryUrlNotEmpty: "仓库地址不能为空。",
67+
CodeRegistryUrlLimitLength: fmt.Sprintf("仓库地址长度最大限制为%d。", enum.LimitRegistryUrl.Max),
68+
CodeRegistryUrlAlreadyExist: "仓库地址已存在。",
69+
CodeRegistryUsernameLimitLength: fmt.Sprintf("仓库用户名长度最大限制为%d。", enum.LimitRegistryUsername.Max),
70+
CodeRegistryPasswordLimitLength: fmt.Sprintf("仓库密码长度最大限制为%d。", enum.LimitRegistryPassword.Max),
71+
CodeRegistryDefaultNotDelete: "仓库docker.io不能被删除。",
72+
73+
CodeNodesNotEmpty: "机器不能为空。",
74+
CodeNodesIdNotEmpty: "机器ID不能为空。",
75+
CodeNodesNotExist: "机器不存在。",
76+
CodeNodesIpAddressInvalid: "IP地址无效。",
77+
CodeNodesLabelKeyIsEmpty: "标签名称不能为空。",
78+
CodeNodesLabelValueIsEmpty: "标签值不能为空。",
79+
CodeNodesLabelKeyIsDuplicated: "标签名重复。",
80+
CodeNodesIpAddressAlreadyExist: "IP地址已存在。",
81+
82+
CodeGroupIdNotEmpty: "分组ID不能为空。",
83+
CodeGroupNotExist: "分组不存在。",
84+
CodeGroupNameAlreadyExist: "分组名称已存在。",
85+
CodeGroupNameLimitLength: fmt.Sprintf("分组名称长度限制为%d到%d。", enum.LimitGroupName.Min, enum.LimitGroupName.Max),
86+
CodeGroupNameNotEmpty: "分组名称不能为空。",
87+
CodeGroupNoPermission: "你没有当前分组权限。",
88+
89+
CodeServiceNotExist: "服务不存在。",
90+
CodeServiceNameNotEmpty: "服务名称不能为空。",
91+
CodeServiceNameLimitLength: fmt.Sprintf("服务名称长度限制为%d到%d。", enum.LimitServiceName.Min, enum.LimitServiceName.Max),
92+
CodeServiceNameAlreadyExist: "服务名称已存在。",
93+
CodeServiceIdNotEmpty: "服务ID不能为空。",
94+
CodeServiceImageNotEmpty: "服务镜像不能为空。",
95+
CodeServiceImageLimitLength: fmt.Sprintf("镜像长度最大限制为%d", enum.LimitImageName.Max),
96+
CodeServiceNetworkModeInvalid: "网络模式无效。",
97+
CodeServiceRestartPolicyInvalid: "重启策略无效。",
98+
CodeServiceContainerPortNotEmpty: "容器端口不能为空。",
99+
CodeServiceContainerPortIsDuplicated: "容器端口重复。",
100+
CodeServiceHostPortIsDuplicated: "主机端口重复。",
101+
CodeServiceContainerVolumeNotEmpty: "容器卷不能为空。",
102+
CodeServiceContainerVolumeIsDuplicated: "容器卷重复。",
103+
CodeServiceContainerVolumeTypeInvlaid: "容器卷类型无效。",
104+
CodeServiceHostVolumeNotEmpty: "主机卷不能为空。",
105+
CodeServiceLabelNameNotEmpty: "标签名称不能为空。",
106+
CodeServiceLabelValueNotEmpty: "标签值不能为空。",
107+
CodeServiceResourceMemoryLimitLimitMax: fmt.Sprintf("内存限制为%d到%d。", enum.LimitMemoryLimit.Min, enum.LimitMemoryLimit.Max),
108+
CodeServiceResourceMemoryReservationLimitMax: fmt.Sprintf("内存预留限制为%d到%d", enum.LimitMemoryReservation.Min, enum.LimitMemoryReservation.Max),
109+
CodeServiceResourceMaxCpuUsageInvalid: fmt.Sprintf("最大cpu使用率无效,限制为%d到%d", enum.LimitMaxCpuUsage.Min, enum.LimitMaxCpuUsage.Max),
110+
CodeServiceDispatchModeInvalid: "调度模式无效。",
111+
CodeServiceInstanceNumInvalid: fmt.Sprintf("实例数无效。限制为%d到%d", enum.LimitInstanceNum.Min, enum.LimitInstanceNum.Max),
112+
CodeServicePlacementModeInvalid: "约束无效。",
113+
CodeServicePlacementLabelNotEmpty: "约束标签不能为空。",
114+
CodeServicePlacementValueNotEmpty: "约束值不能为空。",
115+
CodeServiceScheduleCronNotEmpty: "调度计划cron不能为空。",
116+
CodeServiceScheduleCronInvalid: "执行计划cron无效。",
117+
CodeServiceScheduleTimeoutInvalid: "执行计划超时控制时间无效。",
118+
CodeServiceProtocolInvalid: "协议无效,仅支持TCP、UDP。",
119+
CodeServiceOperateInvalid: "无效的操作。",
120+
CodeServiceIsNotEnable: "服务未启用。",
121+
CodeServiceIsEnabled: "服务已启用。",
122+
CodeServiceIsDisabled: "服务已停用。",
123+
124+
CodeContainerIdNotEmpty: "容器ID不能为空。",
125+
CodeContainerActionInvalid: "操作无效。",
126+
CodeContainerLogTimeInvlaid: "日志时间范围无效。",
127+
}

backend/config/config_dev.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
location: dev # local / dev / prd
22
html:
3-
dir: './html/web'
3+
dir: './web'
44
load: true
5+
db:
6+
root: '/workspace/data/humpback.db'
7+
timeout: 5s
8+
sessionTimeout: 12h
9+
sessionGCInterval: 24h

backend/config/config_prd.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
location: prd # local / dev / prd
22
html:
3-
dir: './html/web'
3+
dir: './web'
44
load: true
5+
db:
6+
root: '/workspace/data/humpback.db'
7+
timeout: 5s
8+
sessionTimeout: 12h
9+
sessionGCInterval: 24h

0 commit comments

Comments
 (0)