mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
style: 修改WAF规则添加方式
This commit is contained in:
parent
b406ee1f10
commit
2ca45d31e8
@ -78,7 +78,6 @@ type DNSParam struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *AcmeClient) UseDns(dnsType DnsType, params string) error {
|
func (c *AcmeClient) UseDns(dnsType DnsType, params string) error {
|
||||||
|
|
||||||
var param DNSParam
|
var param DNSParam
|
||||||
if err := json.Unmarshal([]byte(params), ¶m); err != nil {
|
if err := json.Unmarshal([]byte(params), ¶m); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -148,7 +147,6 @@ func (c *AcmeClient) UseHTTP(path string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *AcmeClient) ObtainSSL(domains []string) (certificate.Resource, error) {
|
func (c *AcmeClient) ObtainSSL(domains []string) (certificate.Resource, error) {
|
||||||
|
|
||||||
request := certificate.ObtainRequest{
|
request := certificate.ObtainRequest{
|
||||||
Domains: domains,
|
Domains: domains,
|
||||||
Bundle: true,
|
Bundle: true,
|
||||||
@ -163,7 +161,6 @@ func (c *AcmeClient) ObtainSSL(domains []string) (certificate.Resource, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *AcmeClient) RenewSSL(certUrl string) (certificate.Resource, error) {
|
func (c *AcmeClient) RenewSSL(certUrl string) (certificate.Resource, error) {
|
||||||
|
|
||||||
certificates, err := c.Client.Certificate.Get(certUrl, true)
|
certificates, err := c.Client.Certificate.Get(certUrl, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return certificate.Resource{}, err
|
return certificate.Resource{}, err
|
||||||
|
@ -116,6 +116,7 @@ export default {
|
|||||||
selectHelper: '请选择正确的 {0} 文件',
|
selectHelper: '请选择正确的 {0} 文件',
|
||||||
domain: '域名格式错误',
|
domain: '域名格式错误',
|
||||||
databaseName: '支持英文、数字、_,长度1-30',
|
databaseName: '支持英文、数字、_,长度1-30',
|
||||||
|
ipErr: 'IP [{0}] 格式错误,请检查',
|
||||||
},
|
},
|
||||||
res: {
|
res: {
|
||||||
paramError: '请求失败,请稍后重试!',
|
paramError: '请求失败,请稍后重试!',
|
||||||
@ -942,6 +943,10 @@ export default {
|
|||||||
notSecurity: ' 不安全',
|
notSecurity: ' 不安全',
|
||||||
encryptHelper:
|
encryptHelper:
|
||||||
"Let's Encrypt 签发证书有频率限制,但足以满足正常需求,过于频繁操作会导致签发失败。具体限制请看 <a target=“_blank” href='https://letsencrypt.org/zh-cn/docs/rate-limits/'>官方文档</a> ",
|
"Let's Encrypt 签发证书有频率限制,但足以满足正常需求,过于频繁操作会导致签发失败。具体限制请看 <a target=“_blank” href='https://letsencrypt.org/zh-cn/docs/rate-limits/'>官方文档</a> ",
|
||||||
|
ipValue: 'IP值',
|
||||||
|
ext: '文件扩展名',
|
||||||
|
wafInputHelper: '按行输入数据,一行一个',
|
||||||
|
data: '数据',
|
||||||
},
|
},
|
||||||
nginx: {
|
nginx: {
|
||||||
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
|
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
|
||||||
|
@ -70,9 +70,11 @@
|
|||||||
<el-divider content-position="left">{{ $t('website.SSLProConfig') }}</el-divider>
|
<el-divider content-position="left">{{ $t('website.SSLProConfig') }}</el-divider>
|
||||||
<el-form-item :label="$t('website.supportProtocol')" prop="SSLProtocol">
|
<el-form-item :label="$t('website.supportProtocol')" prop="SSLProtocol">
|
||||||
<el-checkbox-group v-model="form.SSLProtocol">
|
<el-checkbox-group v-model="form.SSLProtocol">
|
||||||
|
<el-checkbox :label="'TLSv1.3'">{{ 'TLS 1.3' }}</el-checkbox>
|
||||||
<el-checkbox :label="'TLSv1.2'">{{ 'TLS 1.2' }}</el-checkbox>
|
<el-checkbox :label="'TLSv1.2'">{{ 'TLS 1.2' }}</el-checkbox>
|
||||||
<el-checkbox :label="'TLSv1.1'">{{ 'TLS 1.1' }}</el-checkbox>
|
<el-checkbox :label="'TLSv1.1'">{{ 'TLS 1.1' }}</el-checkbox>
|
||||||
<el-checkbox :label="'TLSv1'">{{ 'TLS 1.0' }}</el-checkbox>
|
<el-checkbox :label="'TLSv1'">{{ 'TLS 1.0' }}</el-checkbox>
|
||||||
|
<br />
|
||||||
<el-checkbox :label="'SSLv3'">
|
<el-checkbox :label="'SSLv3'">
|
||||||
{{ 'SSL V3' + $t('website.notSecurity') }}
|
{{ 'SSL V3' + $t('website.notSecurity') }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
@ -134,7 +136,7 @@ let form = reactive({
|
|||||||
httpConfig: 'HTTPToHTTPS',
|
httpConfig: 'HTTPToHTTPS',
|
||||||
algorithm:
|
algorithm:
|
||||||
'EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5',
|
'EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5',
|
||||||
SSLProtocol: ['TLSv1.2', 'TLSv1.1', 'TLSv1'],
|
SSLProtocol: ['TLSv1.3', 'TLSv1.2', 'TLSv1.1', 'TLSv1'],
|
||||||
});
|
});
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
const ssls = ref();
|
const ssls = ref();
|
||||||
|
@ -4,21 +4,21 @@
|
|||||||
<el-form-item prop="enable" :label="$t('website.enable')">
|
<el-form-item prop="enable" :label="$t('website.enable')">
|
||||||
<el-switch v-model="enableUpdate.enable" @change="updateEnable"></el-switch>
|
<el-switch v-model="enableUpdate.enable" @change="updateEnable"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('website.ext')">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||||
|
v-model="exts"
|
||||||
|
:placeholder="$t('website.wafInputHelper')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<ComplexTable :data="data" v-loading="loading">
|
<ComplexTable :data="data" v-loading="loading">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-button type="primary" icon="Plus" @click="openCreate">
|
<el-button type="primary" icon="Plus" @click="openCreate">
|
||||||
{{ $t('commons.button.add') }}
|
{{ $t('commons.button.add') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column :label="$t('website.fileExt')">
|
<el-table-column :label="$t('website.fileExt')" prop="file"></el-table-column>
|
||||||
<template #default="{ row }">
|
|
||||||
<fu-read-write-switch :data="row.file" v-model="row.edit" write-trigger="onDblclick">
|
|
||||||
<el-form-item :error="row.error">
|
|
||||||
<el-input v-model="row.file" @blur="row.edit = false" />
|
|
||||||
</el-form-item>
|
|
||||||
</fu-read-write-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('commons.table.operate')">
|
<el-table-column :label="$t('commons.table.operate')">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button link type="primary" @click="remove($index)">
|
<el-button link type="primary" @click="remove($index)">
|
||||||
@ -27,12 +27,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<br />
|
|
||||||
<el-alert :title="$t('website.mustSave')" type="info" :closable="false"></el-alert>
|
|
||||||
<br />
|
|
||||||
<el-button type="primary" :loading="loading" @click="submit">
|
|
||||||
{{ $t('commons.button.save') }}
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -71,6 +65,7 @@ let enableUpdate = ref<Website.WafUpdate>({
|
|||||||
key: '$fileExtDeny',
|
key: '$fileExtDeny',
|
||||||
enable: false,
|
enable: false,
|
||||||
});
|
});
|
||||||
|
let exts = ref();
|
||||||
|
|
||||||
const get = async () => {
|
const get = async () => {
|
||||||
data.value = [];
|
data.value = [];
|
||||||
@ -80,11 +75,9 @@ const get = async () => {
|
|||||||
|
|
||||||
if (res.data.content != '') {
|
if (res.data.content != '') {
|
||||||
const ipList = JSON.parse(res.data.content);
|
const ipList = JSON.parse(res.data.content);
|
||||||
ipList.forEach((value) => {
|
ipList.forEach((value: string) => {
|
||||||
data.value.push({
|
data.value.push({
|
||||||
file: value,
|
file: value,
|
||||||
eidt: false,
|
|
||||||
error: '',
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -95,24 +88,30 @@ const get = async () => {
|
|||||||
|
|
||||||
const remove = (index: number) => {
|
const remove = (index: number) => {
|
||||||
data.value.splice(index, 1);
|
data.value.splice(index, 1);
|
||||||
|
const extArray = [];
|
||||||
|
data.value.forEach((d) => {
|
||||||
|
extArray.push(d.file);
|
||||||
|
});
|
||||||
|
submit(extArray);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openCreate = () => {
|
const openCreate = () => {
|
||||||
data.value.unshift({ file: '', edit: true, error: '' });
|
const extArray = exts.value.split('\n');
|
||||||
|
if (extArray.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.value.forEach((d) => {
|
||||||
|
extArray.push(d.file);
|
||||||
|
});
|
||||||
|
submit(extArray);
|
||||||
};
|
};
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async (extArray: string[]) => {
|
||||||
let fileArray = [];
|
fileUpdate.content = JSON.stringify(extArray);
|
||||||
data.value.forEach((row) => {
|
|
||||||
if (row.file != '') {
|
|
||||||
fileArray.push(row.file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
fileUpdate.content = JSON.stringify(fileArray);
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
SaveFileContent(fileUpdate)
|
SaveFileContent(fileUpdate)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
exts.value = '';
|
||||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||||
get();
|
get();
|
||||||
})
|
})
|
||||||
|
@ -4,21 +4,21 @@
|
|||||||
<el-form-item prop="enable" :label="$t('website.enable')">
|
<el-form-item prop="enable" :label="$t('website.enable')">
|
||||||
<el-switch v-model="enableUpdate.enable" @change="updateEnable"></el-switch>
|
<el-switch v-model="enableUpdate.enable" @change="updateEnable"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('website.ipValue')">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||||
|
v-model="ips"
|
||||||
|
:placeholder="$t('website.wafInputHelper')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<ComplexTable :data="data" v-loading="loading">
|
<ComplexTable :data="data" v-loading="loading">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-button type="primary" icon="Plus" @click="openCreate">
|
<el-button type="primary" icon="Plus" @click="openCreate">
|
||||||
{{ $t('commons.button.add') }}
|
{{ $t('commons.button.add') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="IP" prop="ip">
|
<el-table-column label="IP" prop="ip"></el-table-column>
|
||||||
<template #default="{ row }">
|
|
||||||
<fu-read-write-switch :data="row.ip" v-model="row.edit" write-trigger="onDblclick">
|
|
||||||
<el-form-item :error="row.error">
|
|
||||||
<el-input v-model="row.ip" @blur="row.edit = false" @input="checkIpRule(row)" />
|
|
||||||
</el-form-item>
|
|
||||||
</fu-read-write-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('commons.table.operate')">
|
<el-table-column :label="$t('commons.table.operate')">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button link type="primary" @click="removeIp($index)">
|
<el-button link type="primary" @click="removeIp($index)">
|
||||||
@ -27,12 +27,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<br />
|
|
||||||
<el-alert :title="$t('website.mustSave')" type="info" :closable="false"></el-alert>
|
|
||||||
<br />
|
|
||||||
<el-button type="primary" :loading="loading" @click="submit">
|
|
||||||
{{ $t('commons.button.save') }}
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -86,6 +80,7 @@ let enableUpdate = ref<Website.WafUpdate>({
|
|||||||
key: '$ipWhiteAllow',
|
key: '$ipWhiteAllow',
|
||||||
enable: false,
|
enable: false,
|
||||||
});
|
});
|
||||||
|
let ips = ref();
|
||||||
|
|
||||||
const get = async () => {
|
const get = async () => {
|
||||||
data.value = [];
|
data.value = [];
|
||||||
@ -95,11 +90,9 @@ const get = async () => {
|
|||||||
|
|
||||||
if (res.data.content != '') {
|
if (res.data.content != '') {
|
||||||
const ipList = JSON.parse(res.data.content);
|
const ipList = JSON.parse(res.data.content);
|
||||||
ipList.forEach((value) => {
|
ipList.forEach((ip: string) => {
|
||||||
data.value.push({
|
data.value.push({
|
||||||
ip: value,
|
ip: ip,
|
||||||
eidt: false,
|
|
||||||
error: '',
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -109,32 +102,39 @@ const get = async () => {
|
|||||||
|
|
||||||
const removeIp = (index: number) => {
|
const removeIp = (index: number) => {
|
||||||
data.value.splice(index, 1);
|
data.value.splice(index, 1);
|
||||||
|
let ipArray = [];
|
||||||
|
data.value.forEach((d) => {
|
||||||
|
ipArray.push(d.ip);
|
||||||
|
});
|
||||||
|
submit(ipArray);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openCreate = () => {
|
const openCreate = () => {
|
||||||
data.value.unshift({ ip: '', edit: true, error: '' });
|
console.log(ips.value);
|
||||||
};
|
const ipArray = ips.value.split('\n');
|
||||||
|
if (ipArray.length == 0) {
|
||||||
const submit = async () => {
|
|
||||||
let canCommit = true;
|
|
||||||
for (const row of data.value) {
|
|
||||||
if (row.ip != '' && row.error != '') {
|
|
||||||
row.edit = true;
|
|
||||||
canCommit = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!canCommit) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let ipArray = [];
|
for (const id in ipArray) {
|
||||||
data.value.forEach((row) => {
|
if (checkIp(ipArray[id])) {
|
||||||
ipArray.push(row.ip);
|
ElMessage.error(i18n.global.t('commons.rule.ipErr', [ipArray[id]]));
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fileUpdate.content = JSON.stringify(ipArray);
|
data.value.forEach((d) => {
|
||||||
|
ipArray.push(d.ip);
|
||||||
|
});
|
||||||
|
submit(ipArray);
|
||||||
|
};
|
||||||
|
|
||||||
|
const submit = async (ipList: string[]) => {
|
||||||
|
fileUpdate.content = JSON.stringify(ipList);
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
SaveFileContent(fileUpdate)
|
SaveFileContent(fileUpdate)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
ips.value = '';
|
||||||
|
get();
|
||||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@ -149,14 +149,6 @@ const updateEnable = async (enable: boolean) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkIpRule = (row: any) => {
|
|
||||||
if (checkIp(row.ip)) {
|
|
||||||
row.error = i18n.global.t('commons.rule.ip');
|
|
||||||
} else {
|
|
||||||
row.error = '';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
req.value.websiteId = id.value;
|
req.value.websiteId = id.value;
|
||||||
req.value.rule = rule.value;
|
req.value.rule = rule.value;
|
||||||
|
@ -4,26 +4,21 @@
|
|||||||
<el-form-item prop="enable" :label="$t('website.enable')">
|
<el-form-item prop="enable" :label="$t('website.enable')">
|
||||||
<el-switch v-model="enableUpdate.enable" @change="updateEnable"></el-switch>
|
<el-switch v-model="enableUpdate.enable" @change="updateEnable"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('website.data')">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||||
|
v-model="add"
|
||||||
|
:placeholder="$t('website.wafInputHelper')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<ComplexTable :data="data" v-loading="loading">
|
<ComplexTable :data="data" v-loading="loading">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-button type="primary" icon="Plus" @click="openCreate">
|
<el-button type="primary" icon="Plus" @click="openCreate">
|
||||||
{{ $t('commons.button.add') }}
|
{{ $t('commons.button.add') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column :label="$t('website.value')">
|
<el-table-column :label="$t('website.value')" prop="value"></el-table-column>
|
||||||
<template #default="{ row }">
|
|
||||||
<fu-read-write-switch :data="row.value" v-model="row.edit" write-trigger="onDblclick">
|
|
||||||
<el-form-item :error="row.error">
|
|
||||||
<el-input
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 2, maxRows: 8 }"
|
|
||||||
v-model="row.value"
|
|
||||||
@blur="row.edit = false"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</fu-read-write-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('commons.table.operate')" width="100px">
|
<el-table-column :label="$t('commons.table.operate')" width="100px">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button link type="primary" @click="remove($index)">
|
<el-button link type="primary" @click="remove($index)">
|
||||||
@ -32,12 +27,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<br />
|
|
||||||
<el-alert :title="$t('website.mustSave')" type="info" :closable="false"></el-alert>
|
|
||||||
<br />
|
|
||||||
<el-button type="primary" :loading="loading" @click="submit">
|
|
||||||
{{ $t('commons.button.save') }}
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -90,6 +79,7 @@ let enableUpdate = ref<Website.WafUpdate>({
|
|||||||
key: '$UrlDeny',
|
key: '$UrlDeny',
|
||||||
enable: false,
|
enable: false,
|
||||||
});
|
});
|
||||||
|
let add = ref();
|
||||||
|
|
||||||
const get = async () => {
|
const get = async () => {
|
||||||
data.value = [];
|
data.value = [];
|
||||||
@ -103,22 +93,31 @@ const get = async () => {
|
|||||||
if (value != '') {
|
if (value != '') {
|
||||||
data.value.push({
|
data.value.push({
|
||||||
value: value,
|
value: value,
|
||||||
eidt: false,
|
|
||||||
error: '',
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fileUpdate.path = res.data.filePath;
|
fileUpdate.path = res.data.filePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
const remove = (index: number) => {
|
const remove = (index: number) => {
|
||||||
data.value.splice(index, 1);
|
data.value.splice(index, 1);
|
||||||
|
const addArray = [];
|
||||||
|
data.value.forEach((d) => {
|
||||||
|
addArray.push(d.value);
|
||||||
|
});
|
||||||
|
submit(addArray);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openCreate = () => {
|
const openCreate = () => {
|
||||||
data.value.unshift({ value: '', edit: true, error: '' });
|
const addArray = add.value.split('\n');
|
||||||
|
if (addArray.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.value.forEach((d) => {
|
||||||
|
addArray.push(d.value);
|
||||||
|
});
|
||||||
|
submit(addArray);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateEnable = async (enable: boolean) => {
|
const updateEnable = async (enable: boolean) => {
|
||||||
@ -128,18 +127,17 @@ const updateEnable = async (enable: boolean) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async (addArray: string[]) => {
|
||||||
let urlList = '';
|
let urlList = '';
|
||||||
data.value.forEach((row) => {
|
addArray.forEach((row) => {
|
||||||
if (row.value != '') {
|
urlList = urlList + row + '\n';
|
||||||
urlList = urlList + row.value + '\n';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fileUpdate.content = urlList;
|
fileUpdate.content = urlList;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
SaveFileContent(fileUpdate)
|
SaveFileContent(fileUpdate)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
add.value = '';
|
||||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||||
get();
|
get();
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user