fix: 概览界面增加启动时间运行时间
This commit is contained in:
@@ -9,6 +9,25 @@
|
||||
<el-button style="margin-top: 20px" type="p" @click="goDashboard" icon="Position">Redis-Command</el-button>
|
||||
<Terminal v-show="!isOnSetting" ref="terminalRef" />
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="commandVisiable"
|
||||
:title="$t('app.checkTitle')"
|
||||
width="30%"
|
||||
:close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<el-alert :closable="false" :title="$t('app.checkInstalledWarn', ['Redis-Command'])" type="info">
|
||||
<el-link icon="Position" @click="goRouter('/apps')" type="primary">
|
||||
{{ $t('database.goInstall') }}
|
||||
</el-link>
|
||||
</el-alert>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="commandVisiable = false">{{ $t('commons.button.cancel') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -20,6 +39,7 @@ import AppStatus from '@/components/app-status/index.vue';
|
||||
import { ref } from 'vue';
|
||||
import { App } from '@/api/interface/app';
|
||||
import { GetAppPort } from '@/api/modules/app';
|
||||
import router from '@/routers';
|
||||
|
||||
const terminalRef = ref();
|
||||
const settingRef = ref();
|
||||
@@ -27,6 +47,7 @@ const isOnSetting = ref(false);
|
||||
const redisIsExist = ref(false);
|
||||
|
||||
const redisCommandPort = ref();
|
||||
const commandVisiable = ref(false);
|
||||
|
||||
const onSetting = async () => {
|
||||
isOnSetting.value = true;
|
||||
@@ -34,12 +55,20 @@ const onSetting = async () => {
|
||||
settingRef.value!.acceptParams();
|
||||
};
|
||||
|
||||
const goRouter = async (path: string) => {
|
||||
router.push({ path: path });
|
||||
};
|
||||
|
||||
const goDashboard = async () => {
|
||||
if (redisCommandPort.value === 0) {
|
||||
commandVisiable.value = true;
|
||||
return;
|
||||
}
|
||||
window.open('http://localhost:' + redisCommandPort.value, '_blank');
|
||||
};
|
||||
|
||||
const loadDashboardPort = async () => {
|
||||
const res = await GetAppPort('phpmyadmin');
|
||||
const res = await GetAppPort('redis-commander');
|
||||
redisCommandPort.value = res.data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user