fix: bug#10702、10703 修复网络组件、流媒体服务域名校验
This commit is contained in:
parent
d04e69ba1b
commit
a4b79f2b8f
|
@ -103,18 +103,6 @@
|
||||||
:key="cluster.id"
|
:key="cluster.id"
|
||||||
:show-arrow="!formData.shareCluster"
|
:show-arrow="!formData.shareCluster"
|
||||||
>
|
>
|
||||||
<!-- <j-collapse-panel
|
|
||||||
:key="cluster.id"
|
|
||||||
:header="
|
|
||||||
cluster.serverId
|
|
||||||
? cluster.serverId
|
|
||||||
: !formData.shareCluster
|
|
||||||
? `#${index + 1}.配置信息`
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
collapsible="header"
|
|
||||||
:show-arrow="!formData.shareCluster"
|
|
||||||
> -->
|
|
||||||
<template #header v-if="!shareCluster">
|
<template #header v-if="!shareCluster">
|
||||||
<div class="collapse-header">
|
<div class="collapse-header">
|
||||||
{{
|
{{
|
||||||
|
@ -1136,10 +1124,6 @@ const filterConfigByType = (data: any, type: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeheader = (value: string) => {
|
|
||||||
console.log(22, value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getPortOptions = (portOptions: object, index = 0) => {
|
const getPortOptions = (portOptions: object, index = 0) => {
|
||||||
if (!portOptions) return;
|
if (!portOptions) return;
|
||||||
const type = formData.value.type;
|
const type = formData.value.type;
|
||||||
|
@ -1224,6 +1208,10 @@ const saveData = async () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!formRef2Data?.cluster) {
|
||||||
|
return onlyMessage('请新增或完善配置', 'error');
|
||||||
|
}
|
||||||
|
|
||||||
const { configuration } = formRef2Data?.cluster[0];
|
const { configuration } = formRef2Data?.cluster[0];
|
||||||
const params = shareCluster.value
|
const params = shareCluster.value
|
||||||
? { ...formData.value, configuration }
|
? { ...formData.value, configuration }
|
||||||
|
@ -1418,5 +1406,6 @@ watch(
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border: 1px solid #e50012;
|
border: 1px solid #e50012;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -113,6 +113,19 @@ export const Validator = {
|
||||||
regOnlyNumber: new RegExp(/^\d+$/),
|
regOnlyNumber: new RegExp(/^\d+$/),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const validateAddress = (_rule: any, value: string): Promise<any> =>
|
||||||
|
new Promise(async (resolve, reject) => {
|
||||||
|
if (
|
||||||
|
Validator.regIpv4.test(value) ||
|
||||||
|
Validator.regIPv6.test(value) ||
|
||||||
|
Validator.regDomain.test(value)
|
||||||
|
) {
|
||||||
|
return resolve('');
|
||||||
|
} else {
|
||||||
|
return reject('请输入正确的IP地址或者域名');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export const Rules = {
|
export const Rules = {
|
||||||
name: [
|
name: [
|
||||||
{
|
{
|
||||||
|
@ -160,10 +173,14 @@ export const Rules = {
|
||||||
message: '请输入公网地址',
|
message: '请输入公网地址',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern:
|
validator: validateAddress,
|
||||||
Validator.regIpv4 || Validator.regIPv6 || Validator.regDomain,
|
message: '请输入正确的IP地址或者域名',
|
||||||
message: '请输入正确格式的域名或ip',
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// pattern:
|
||||||
|
// Validator.regIpv4 || Validator.regIPv6 || Validator.regDomain,
|
||||||
|
// message: '请输入正确格式的域名或ip',
|
||||||
|
// },
|
||||||
],
|
],
|
||||||
publicPort: [
|
publicPort: [
|
||||||
{
|
{
|
||||||
|
@ -181,9 +198,7 @@ export const Rules = {
|
||||||
message: '请输入远程地址',
|
message: '请输入远程地址',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern:
|
validator: validateAddress,
|
||||||
Validator.regIpv4 || Validator.regIPv6 || Validator.regDomain,
|
|
||||||
|
|
||||||
message: '请输入正确格式的域名或ip',
|
message: '请输入正确格式的域名或ip',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -76,10 +76,7 @@
|
||||||
message: '请输入API Host',
|
message: '请输入API Host',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern:
|
validator: validateAddress,
|
||||||
Validator.regIpv4 ||
|
|
||||||
Validator.regIPv6 ||
|
|
||||||
Validator.regDomain,
|
|
||||||
message: '请输入正确的IP地址或者域名',
|
message: '请输入正确的IP地址或者域名',
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
|
@ -133,10 +130,7 @@
|
||||||
message: '请输入RTP IP',
|
message: '请输入RTP IP',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern:
|
validator: validateAddress,
|
||||||
Validator.regIpv4 ||
|
|
||||||
Validator.regIPv6 ||
|
|
||||||
Validator.regDomain,
|
|
||||||
message: '请输入正确的IP地址或者域名',
|
message: '请输入正确的IP地址或者域名',
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
|
@ -197,15 +191,8 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="
|
:max="
|
||||||
Number(
|
formData.configuration
|
||||||
formData.configuration
|
.dynamicRtpPortRange1 || 65535
|
||||||
.dynamicRtpPortRange1,
|
|
||||||
) < 65535
|
|
||||||
? Number(
|
|
||||||
formData.configuration
|
|
||||||
.dynamicRtpPortRange1,
|
|
||||||
)
|
|
||||||
: 65535
|
|
||||||
"
|
"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
placeholder="起始端口"
|
placeholder="起始端口"
|
||||||
|
@ -231,7 +218,8 @@
|
||||||
<j-input-number
|
<j-input-number
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="
|
:min="
|
||||||
formData.configuration.dynamicRtpPortRange0
|
formData.configuration
|
||||||
|
.dynamicRtpPortRange0 || 1
|
||||||
"
|
"
|
||||||
:max="65535"
|
:max="65535"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
|
@ -305,6 +293,19 @@ const Validator = {
|
||||||
regOnlyNumber: new RegExp(/^\d+$/),
|
regOnlyNumber: new RegExp(/^\d+$/),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const validateAddress = (_rule: any, value: string): Promise<any> =>
|
||||||
|
new Promise(async (resolve, reject) => {
|
||||||
|
if (
|
||||||
|
Validator.regIpv4.test(value) ||
|
||||||
|
Validator.regIPv6.test(value) ||
|
||||||
|
Validator.regDomain.test(value)
|
||||||
|
) {
|
||||||
|
return resolve('');
|
||||||
|
} else {
|
||||||
|
return reject('请输入正确的IP地址或者域名');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const formData = ref<FormDataType>({
|
const formData = ref<FormDataType>({
|
||||||
name: '',
|
name: '',
|
||||||
provider: undefined,
|
provider: undefined,
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
:status="slotProps.state.value"
|
:status="slotProps.state.value"
|
||||||
:statusText="slotProps.state.text"
|
:statusText="slotProps.state.text"
|
||||||
:statusNames="{
|
:statusNames="{
|
||||||
enabled: 'success',
|
enabled: 'processing',
|
||||||
disabled: 'error',
|
disabled: 'error',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue