Skip to content

Commit f18a37a

Browse files
feat: Resolve issue with bulk domain generation failure (#7992)
1 parent df156ad commit f18a37a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

frontend/src/views/website/ssl/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
fix
3737
show-overflow-tooltip
3838
prop="primaryDomain"
39+
min-width="150px"
3940
></el-table-column>
4041
<el-table-column
4142
:label="$t('website.otherDomains')"

frontend/src/views/website/website/domain-create/index.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969

7070
<script lang="ts" setup>
7171
import { Rules, checkNumberRange } from '@/global/form-rules';
72+
import i18n from '@/lang';
73+
import { MsgError } from '@/utils/message';
7274
import { ref } from 'vue';
7375
7476
const props = defineProps({
@@ -105,10 +107,20 @@ const removeDomain = (index: number) => {
105107
create.value.domains.splice(index, 1);
106108
};
107109
110+
const checkDomain = (domain: string) => {
111+
const reg =
112+
/^([\w\u4e00-\u9fa5\-\*]{1,100}\.){1,10}([\w\u4e00-\u9fa5\-]{1,24}|[\w\u4e00-\u9fa5\-]{1,24}\.[\w\u4e00-\u9fa5\-]{1,24})(:\d{1,5})?$/;
113+
return reg.test(domain);
114+
};
115+
108116
const gengerateDomains = () => {
109117
const lines = create.value.domainStr.split(/\r?\n/);
110118
lines.forEach((line) => {
111119
const [domain, port] = line.split(':');
120+
if (!checkDomain(domain)) {
121+
MsgError(line + i18n.global.t('commons.rule.domain'));
122+
return;
123+
}
112124
const exists = (domain: string, port: number): boolean => {
113125
return create.value.domains.some((info) => info.domain === domain && info.port === port);
114126
};

0 commit comments

Comments
 (0)