mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-29 10:53:14 +08:00
feat: update allowPort check (#8355)
This commit is contained in:
parent
74eb2c8dd6
commit
5ab8377ac1
1 changed files with 14 additions and 10 deletions
|
|
@ -170,6 +170,14 @@ const hasWebsite = ref(false);
|
|||
const acceptParams = async (params: AI.McpServer) => {
|
||||
hasWebsite.value = false;
|
||||
mode.value = params.id ? 'edit' : 'create';
|
||||
let mcpDomainRes;
|
||||
try {
|
||||
mcpDomainRes = await getMcpDomain();
|
||||
if (mcpDomainRes.data.connUrl != '') {
|
||||
hasWebsite.value = true;
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
if (mode.value == 'edit') {
|
||||
mcpServer.value = params;
|
||||
if (!mcpServer.value.environments) {
|
||||
|
|
@ -186,16 +194,12 @@ const acceptParams = async (params: AI.McpServer) => {
|
|||
if (params.port) {
|
||||
mcpServer.value.port = params.port;
|
||||
}
|
||||
try {
|
||||
const res = await getMcpDomain();
|
||||
if (res.data.connUrl != '') {
|
||||
const parts = res.data.connUrl.split(/(https?:\/\/)/).filter(Boolean);
|
||||
mcpServer.value.protocol = parts[0];
|
||||
mcpServer.value.url = parts[1];
|
||||
mcpServer.value.baseUrl = res.data.connUrl;
|
||||
hasWebsite.value = true;
|
||||
}
|
||||
} catch (error) {}
|
||||
if (mcpDomainRes.data && mcpDomainRes.data.connUrl != '') {
|
||||
const parts = mcpDomainRes.data.connUrl.split(/(https?:\/\/)/).filter(Boolean);
|
||||
mcpServer.value.protocol = parts[0];
|
||||
mcpServer.value.url = parts[1];
|
||||
mcpServer.value.baseUrl = mcpDomainRes.data.connUrl;
|
||||
}
|
||||
}
|
||||
open.value = true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue