mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-28 19:14:13 +08:00
feat: 已安装应用增加 https 端口跳转 (#1870)
This commit is contained in:
parent
1931e8800a
commit
e0f15ca783
@ -33,6 +33,7 @@ const dialogVisiable = ref();
|
|||||||
|
|
||||||
interface DialogProps {
|
interface DialogProps {
|
||||||
port: any;
|
port: any;
|
||||||
|
protocol: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const acceptParams = async (params: DialogProps): Promise<void> => {
|
const acceptParams = async (params: DialogProps): Promise<void> => {
|
||||||
@ -40,16 +41,17 @@ const acceptParams = async (params: DialogProps): Promise<void> => {
|
|||||||
MsgError(i18n.global.t('setting.errPort'));
|
MsgError(i18n.global.t('setting.errPort'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let protocol = params.protocol === 'https' ? 'https' : 'http';
|
||||||
const res = await getSettingInfo();
|
const res = await getSettingInfo();
|
||||||
if (!res.data.systemIP) {
|
if (!res.data.systemIP) {
|
||||||
dialogVisiable.value = true;
|
dialogVisiable.value = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!checkIp(res.data.systemIP) || !checkDomain(res.data.systemIP)) {
|
if (!checkIp(res.data.systemIP) || !checkDomain(res.data.systemIP)) {
|
||||||
window.open(`http://${res.data.systemIP}:${params.port}`, '_blank');
|
window.open(`${protocol}://${res.data.systemIP}:${params.port}`, '_blank');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.open(`http://[${res.data.systemIP}]:${params.port}`, '_blank');
|
window.open(`${protocol}://[${res.data.systemIP}]:${params.port}`, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
const goRouter = async (path: string) => {
|
const goRouter = async (path: string) => {
|
||||||
|
@ -48,6 +48,7 @@ const message = {
|
|||||||
ignore: 'Ignore upgrade',
|
ignore: 'Ignore upgrade',
|
||||||
copy: 'Copy',
|
copy: 'Copy',
|
||||||
random: 'Random',
|
random: 'Random',
|
||||||
|
uninstall: 'Uninstall',
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
timeStart: 'Time start',
|
timeStart: 'Time start',
|
||||||
|
@ -48,6 +48,7 @@ const message = {
|
|||||||
ignore: '忽略升級',
|
ignore: '忽略升級',
|
||||||
copy: '復製',
|
copy: '復製',
|
||||||
random: '隨機密碼',
|
random: '隨機密碼',
|
||||||
|
uninstall: '卸載',
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
timeStart: '開始時間',
|
timeStart: '開始時間',
|
||||||
|
@ -48,6 +48,7 @@ const message = {
|
|||||||
ignore: '忽略升级',
|
ignore: '忽略升级',
|
||||||
copy: '复制',
|
copy: '复制',
|
||||||
random: '随机密码',
|
random: '随机密码',
|
||||||
|
uninstall: '卸载',
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
timeStart: '开始时间',
|
timeStart: '开始时间',
|
||||||
|
@ -196,11 +196,19 @@
|
|||||||
<el-tag
|
<el-tag
|
||||||
class="middle-center"
|
class="middle-center"
|
||||||
v-if="installed.httpPort > 0"
|
v-if="installed.httpPort > 0"
|
||||||
@click="goDashboard(installed.httpPort)"
|
@click="goDashboard(installed.httpPort, 'http')"
|
||||||
>
|
>
|
||||||
<el-icon class="middle-center"><Position /></el-icon>
|
<el-icon class="middle-center"><Position /></el-icon>
|
||||||
{{ $t('app.busPort') }}:{{ installed.httpPort }}
|
{{ $t('app.busPort') }}:{{ installed.httpPort }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
<el-tag
|
||||||
|
class="middle-center"
|
||||||
|
v-if="installed.httpsPort > 0"
|
||||||
|
@click="goDashboard(installed.httpsPort, 'https')"
|
||||||
|
>
|
||||||
|
<el-icon class="middle-center"><Position /></el-icon>
|
||||||
|
{{ $t('app.busPort') }}:{{ installed.httpsPort }}
|
||||||
|
</el-tag>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<span>
|
<span>
|
||||||
{{ $t('app.alreadyRun') }}: {{ getAge(installed.createdAt) }}
|
{{ $t('app.alreadyRun') }}: {{ getAge(installed.createdAt) }}
|
||||||
@ -358,8 +366,8 @@ const search = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const goDashboard = async (port: any) => {
|
const goDashboard = async (port: any, protocol: string) => {
|
||||||
dialogPortJumpRef.value.acceptParams({ port: port });
|
dialogPortJumpRef.value.acceptParams({ port: port, protocol: protocol });
|
||||||
};
|
};
|
||||||
|
|
||||||
const openOperate = (row: any, op: string) => {
|
const openOperate = (row: any, op: string) => {
|
||||||
@ -467,7 +475,7 @@ const buttons = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18n.global.t('commons.button.delete'),
|
label: i18n.global.t('commons.button.uninstall'),
|
||||||
click: (row: any) => {
|
click: (row: any) => {
|
||||||
openOperate(row, 'delete');
|
openOperate(row, 'delete');
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user