🔨 优化页面加载逻辑.
This commit is contained in:
@@ -30,7 +30,7 @@ const checkForVersionUpdate = (serverVersion: string) => {
|
||||
return;
|
||||
}
|
||||
// 提示用户更新
|
||||
if (window.confirm('检测到新版本, 是否刷新页面以获取最新内容?')) {
|
||||
if (window.confirm('检测到新版本, 请强制刷新页面以获取最新内容!')) {
|
||||
window.location.reload();
|
||||
}
|
||||
// 更新 localStorage 记录
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-container view-container">
|
||||
<div class="layout-container view-container" v-if="render">
|
||||
<a-tabs v-model:active-key="activeKey"
|
||||
class="tabs-container simple-card"
|
||||
size="large"
|
||||
@@ -32,12 +32,14 @@
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const render = ref();
|
||||
const activeKey = ref();
|
||||
|
||||
// 加载字典项
|
||||
onBeforeMount(async () => {
|
||||
const dictStore = useDictStore();
|
||||
await dictStore.loadKeys(dictKeys);
|
||||
render.value = true;
|
||||
});
|
||||
|
||||
// 跳转到指定页
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-container">
|
||||
<div class="layout-container" v-if="render">
|
||||
<!-- 列表-表格 -->
|
||||
<host-identity-table v-if="renderTable"
|
||||
ref="table"
|
||||
@@ -36,6 +36,7 @@
|
||||
import HostIdentityFormModal from './components/host-identity-form-modal.vue';
|
||||
import HostKeyFormDrawer from '../host-key/components/host-key-form-drawer.vue';
|
||||
|
||||
const render = ref();
|
||||
const table = ref();
|
||||
const card = ref();
|
||||
const modal = ref();
|
||||
@@ -57,6 +58,7 @@
|
||||
onBeforeMount(async () => {
|
||||
const dictStore = useDictStore();
|
||||
await dictStore.loadKeys(dictKeys);
|
||||
render.value = true;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -208,6 +208,31 @@
|
||||
<!-- 拓展操作 -->
|
||||
<template #extra="{ record }">
|
||||
<a-space>
|
||||
<!-- 单协议连接 -->
|
||||
<a-button v-if="record.types?.length === 1"
|
||||
size="mini"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: record.types[0] } })">
|
||||
连接
|
||||
</a-button>
|
||||
<!-- 多协议连接 -->
|
||||
<a-popover v-if="(record.types?.length || 0) > 1"
|
||||
:title="undefined"
|
||||
:content-style="{ padding: '8px' }">
|
||||
<a-button v-permission="['terminal:terminal:access']" size="mini">
|
||||
连接
|
||||
</a-button>
|
||||
<template #content>
|
||||
<a-space>
|
||||
<a-button v-for="type in record.types"
|
||||
:key="type"
|
||||
size="mini"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type} })">
|
||||
{{ type }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-popover>
|
||||
<!-- 更多操作 -->
|
||||
<a-dropdown trigger="hover" :popup-max-height="false">
|
||||
<icon-more class="card-extra-icon" />
|
||||
@@ -236,18 +261,6 @@
|
||||
@click="deleteRow(record.id)">
|
||||
<span class="more-doption error">删除</span>
|
||||
</a-doption>
|
||||
<!-- SSH -->
|
||||
<a-doption v-if="record.types.includes(HostType.SSH.value)"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SSH' } })">
|
||||
<span class="more-doption normal">SSH</span>
|
||||
</a-doption>
|
||||
<!-- RDP -->
|
||||
<a-doption v-if="record.types.includes(HostType.RDP.value)"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'RDP' } })">
|
||||
<span class="more-doption normal">RDP</span>
|
||||
</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-space>
|
||||
|
||||
@@ -274,7 +274,6 @@
|
||||
<a-space>
|
||||
<a-button v-for="type in record.types"
|
||||
:key="type"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type} })">
|
||||
{{ type }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-container">
|
||||
<div class="layout-container" v-if="render">
|
||||
<!-- 列表-表格 -->
|
||||
<host-table v-if="renderTable"
|
||||
ref="table"
|
||||
@@ -36,6 +36,7 @@
|
||||
import HostFormDrawer from './components/host-form-drawer.vue';
|
||||
import HostGroupDrawer from '../host-group/drawer/index.vue';
|
||||
|
||||
const render = ref();
|
||||
const table = ref();
|
||||
const card = ref();
|
||||
const drawer = ref();
|
||||
@@ -57,6 +58,7 @@
|
||||
// 加载字典配置
|
||||
onBeforeMount(() => {
|
||||
useDictStore().loadKeys(dictKeys);
|
||||
render.value = true;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-container upload-container">
|
||||
<div class="layout-container upload-container" v-if="render">
|
||||
<!-- 上传面板 -->
|
||||
<upload-panel ref="panel" />
|
||||
</div>
|
||||
@@ -20,12 +20,14 @@
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const render = ref();
|
||||
const panel = ref();
|
||||
|
||||
// 加载字典值
|
||||
onMounted(async () => {
|
||||
const dictStore = useDictStore();
|
||||
await dictStore.loadKeys(dictKeys);
|
||||
render.value = true;
|
||||
});
|
||||
|
||||
// 跳转日志
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-container full">
|
||||
<div class="layout-container full" v-if="render">
|
||||
<!-- 执行面板 -->
|
||||
<div v-show="!logVisible" class="panel-wrapper">
|
||||
<exec-command-panel @submit="openLog" />
|
||||
@@ -34,6 +34,7 @@
|
||||
const { visible: logVisible, setVisible: setLogVisible } = useVisible();
|
||||
const route = useRoute();
|
||||
|
||||
const render = ref();
|
||||
const log = ref();
|
||||
|
||||
// 打开日志
|
||||
@@ -56,6 +57,7 @@
|
||||
onMounted(async () => {
|
||||
const dictStore = useDictStore();
|
||||
await dictStore.loadKeys(dictKeys);
|
||||
render.value = true;
|
||||
});
|
||||
|
||||
// 跳转日志
|
||||
|
||||
Reference in New Issue
Block a user