mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-16 18:54:43 +08:00
fix: 修改创建机构的部分校验 (#3216)
This commit is contained in:
parent
a6e12d88a3
commit
48ed9d8993
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/1Panel-dev/1Panel/backend/buserr"
|
"github.com/1Panel-dev/1Panel/backend/buserr"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
"github.com/1Panel-dev/1Panel/backend/global"
|
"github.com/1Panel-dev/1Panel/backend/global"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/i18n"
|
||||||
cmd2 "github.com/1Panel-dev/1Panel/backend/utils/cmd"
|
cmd2 "github.com/1Panel-dev/1Panel/backend/utils/cmd"
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/compose"
|
"github.com/1Panel-dev/1Panel/backend/utils/compose"
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/docker"
|
"github.com/1Panel-dev/1Panel/backend/utils/docker"
|
||||||
@ -575,7 +576,7 @@ func (r *RuntimeService) SyncForRestart() error {
|
|||||||
for _, runtime := range runtimes {
|
for _, runtime := range runtimes {
|
||||||
if runtime.Status == constant.RuntimeBuildIng || runtime.Status == constant.RuntimeReCreating || runtime.Status == constant.RuntimeStarting || runtime.Status == constant.RuntimeCreating {
|
if runtime.Status == constant.RuntimeBuildIng || runtime.Status == constant.RuntimeReCreating || runtime.Status == constant.RuntimeStarting || runtime.Status == constant.RuntimeCreating {
|
||||||
runtime.Status = constant.SystemRestart
|
runtime.Status = constant.SystemRestart
|
||||||
runtime.Message = "System restart causing interrupt"
|
runtime.Message = i18n.GetMsgByKey("SystemRestart")
|
||||||
_ = runtimeRepo.Save(&runtime)
|
_ = runtimeRepo.Save(&runtime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -498,7 +498,7 @@ func (w WebsiteSSLService) SyncForRestart() error {
|
|||||||
for _, ssl := range sslList {
|
for _, ssl := range sslList {
|
||||||
if ssl.Status == constant.SSLApply {
|
if ssl.Status == constant.SSLApply {
|
||||||
ssl.Status = constant.SystemRestart
|
ssl.Status = constant.SystemRestart
|
||||||
ssl.Message = "System restart causing interrupt"
|
ssl.Message = i18n.GetMsgByKey("SystemRestart")
|
||||||
_ = websiteSSLRepo.Save(&ssl)
|
_ = websiteSSLRepo.Save(&ssl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ ErrTypePort: 'Port {{ .name }} format error'
|
|||||||
ErrTypePortRange: 'Port range needs to be between 1-65535'
|
ErrTypePortRange: 'Port range needs to be between 1-65535'
|
||||||
Success: "Success"
|
Success: "Success"
|
||||||
Failed: "Failed"
|
Failed: "Failed"
|
||||||
|
SystemRestart: "System restart causes task interruption"
|
||||||
|
|
||||||
#app
|
#app
|
||||||
ErrPortInUsed: "{{ .detail }} port already in use"
|
ErrPortInUsed: "{{ .detail }} port already in use"
|
||||||
|
@ -22,6 +22,7 @@ ErrTypePort: '埠 {{ .name }} 格式錯誤'
|
|||||||
ErrTypePortRange: '連接埠範圍需要在 1-65535 之間'
|
ErrTypePortRange: '連接埠範圍需要在 1-65535 之間'
|
||||||
Success: "成功"
|
Success: "成功"
|
||||||
Failed: "失敗"
|
Failed: "失敗"
|
||||||
|
SystemRestart: "系統重啟導致任務中斷"
|
||||||
|
|
||||||
#app
|
#app
|
||||||
ErrPortInUsed: "{{ .detail }} 端口已被佔用!"
|
ErrPortInUsed: "{{ .detail }} 端口已被佔用!"
|
||||||
|
@ -22,6 +22,7 @@ ErrTypePort: '端口 {{ .name }} 格式错误'
|
|||||||
ErrTypePortRange: '端口范围需要在 1-65535 之间'
|
ErrTypePortRange: '端口范围需要在 1-65535 之间'
|
||||||
Success: "成功"
|
Success: "成功"
|
||||||
Failed: "失败"
|
Failed: "失败"
|
||||||
|
SystemRestart: "系统重启导致任务中断"
|
||||||
|
|
||||||
#app
|
#app
|
||||||
ErrPortInUsed: "{{ .detail }} 端口已被占用!"
|
ErrPortInUsed: "{{ .detail }} 端口已被占用!"
|
||||||
|
@ -132,7 +132,7 @@ const checkName = (rule: any, value: any, callback: any) => {
|
|||||||
if (value === '' || typeof value === 'undefined' || value == null) {
|
if (value === '' || typeof value === 'undefined' || value == null) {
|
||||||
callback(new Error(i18n.global.t('commons.rule.commonName')));
|
callback(new Error(i18n.global.t('commons.rule.commonName')));
|
||||||
} else {
|
} else {
|
||||||
const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,128}$/;
|
const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,127}$/;
|
||||||
if (!reg.test(value) && value !== '') {
|
if (!reg.test(value) && value !== '') {
|
||||||
callback(new Error(i18n.global.t('commons.rule.commonName')));
|
callback(new Error(i18n.global.t('commons.rule.commonName')));
|
||||||
} else {
|
} else {
|
||||||
|
@ -72,8 +72,8 @@ const rules = ref({
|
|||||||
keyType: [Rules.requiredSelect],
|
keyType: [Rules.requiredSelect],
|
||||||
name: [Rules.requiredInput, Rules.name],
|
name: [Rules.requiredInput, Rules.name],
|
||||||
country: [Rules.requiredSelect],
|
country: [Rules.requiredSelect],
|
||||||
organization: [Rules.requiredInput],
|
organization: [Rules.requiredInput, Rules.name],
|
||||||
commonName: [Rules.requiredInput],
|
commonName: [Rules.requiredInput, Rules.name],
|
||||||
});
|
});
|
||||||
|
|
||||||
const initData = () => ({
|
const initData = () => ({
|
||||||
|
@ -87,8 +87,8 @@ const em = defineEmits(['close']);
|
|||||||
const rules = ref({
|
const rules = ref({
|
||||||
keyType: [Rules.requiredSelect],
|
keyType: [Rules.requiredSelect],
|
||||||
domains: [Rules.requiredInput],
|
domains: [Rules.requiredInput],
|
||||||
time: [Rules.requiredInput, checkNumberRange(1, 1000)],
|
|
||||||
dir: [Rules.requiredInput],
|
dir: [Rules.requiredInput],
|
||||||
|
time: [Rules.integerNumber, checkNumberRange(1, 10000)],
|
||||||
});
|
});
|
||||||
|
|
||||||
const initData = () => ({
|
const initData = () => ({
|
||||||
@ -116,7 +116,7 @@ const handleClose = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
obtainForm.value.resetFields();
|
obtainForm.value?.resetFields();
|
||||||
obtain.value = initData();
|
obtain.value = initData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user