feat: 增加系统 IP 设置,实现容器端口跳转功能 (#1479)

This commit is contained in:
ssongliu
2023-06-29 11:18:15 +08:00
committed by GitHub
parent 847c14ddda
commit 64f80a95ab
12 changed files with 156 additions and 10 deletions

View File

@@ -164,6 +164,7 @@ import { GetAppPort } from '@/api/modules/app';
import router from '@/routers';
import { MsgError, MsgSuccess } from '@/utils/message';
import useClipboard from 'vue-clipboard3';
import { getSettingInfo } from '@/api/modules/setting';
const { toClipboard } = useClipboard();
const loading = ref(false);
@@ -261,9 +262,12 @@ const goDashboard = async () => {
phpVisiable.value = true;
return;
}
let href = window.location.href;
let ipLocal = href.split('//')[1].split(':')[0];
window.open(`http://${ipLocal}:${phpadminPort.value}`, '_blank');
const res = await getSettingInfo();
if (!res.data.systemIP) {
MsgError(i18n.global.t('setting.systemIPWarning'));
return;
}
window.open(`http://${res.data.systemIP}:${phpadminPort.value}`, '_blank');
};
const getAppDetail = (key: string) => {
router.push({ name: 'AppDetail', params: { appKey: key } });