前端业务拆分.
This commit is contained in:
@@ -22,10 +22,6 @@ const ASSET: AppRouteRecordRaw = {
|
|||||||
name: 'assetGrant',
|
name: 'assetGrant',
|
||||||
path: '/asset/grant',
|
path: '/asset/grant',
|
||||||
component: () => import('@/views/asset/grant/index.vue'),
|
component: () => import('@/views/asset/grant/index.vue'),
|
||||||
}, {
|
|
||||||
name: 'assetHostConnectLog',
|
|
||||||
path: '/asset/host-connect-log',
|
|
||||||
component: () => import('@/views/asset/host-connect-log/index.vue'),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
18
orion-ops-ui/src/router/routes/modules/host-review.ts
Normal file
18
orion-ops-ui/src/router/routes/modules/host-review.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import type { AppRouteRecordRaw } from '../types';
|
||||||
|
import { DEFAULT_LAYOUT } from '../base';
|
||||||
|
|
||||||
|
const HOST_REVIEW: AppRouteRecordRaw =
|
||||||
|
{
|
||||||
|
name: 'hostReview',
|
||||||
|
path: '/host-review',
|
||||||
|
component: DEFAULT_LAYOUT,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'hostReviewConnectLog',
|
||||||
|
path: '/host-review/connect-log',
|
||||||
|
component: () => import('@/views/host-review/connect-log/index.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default HOST_REVIEW;
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import type { AppRouteRecordRaw } from '../types';
|
import type { AppRouteRecordRaw } from '../types';
|
||||||
import { FULL_LAYOUT } from '../base';
|
import { FULL_LAYOUT } from '../base';
|
||||||
|
|
||||||
const HOST_OPS: AppRouteRecordRaw = {
|
const HOST: AppRouteRecordRaw = {
|
||||||
name: 'hostOps',
|
name: 'host',
|
||||||
path: '/host',
|
path: '/host',
|
||||||
component: FULL_LAYOUT,
|
component: FULL_LAYOUT,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'hostTerminal',
|
name: 'hostTerminal',
|
||||||
path: '/host/terminal',
|
path: '/host/terminal',
|
||||||
component: () => import('@/views/host-ops/terminal/index.vue'),
|
component: () => import('@/views/host/terminal/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
noAffix: true
|
noAffix: true
|
||||||
}
|
}
|
||||||
@@ -17,4 +17,4 @@ const HOST_OPS: AppRouteRecordRaw = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default HOST_OPS;
|
export default HOST;
|
||||||
@@ -4,8 +4,9 @@ import { defineStore } from 'pinia';
|
|||||||
import { getPreference, updatePreference } from '@/api/user/preference';
|
import { getPreference, updatePreference } from '@/api/user/preference';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { useDark } from '@vueuse/core';
|
import { useDark } from '@vueuse/core';
|
||||||
import { DEFAULT_SCHEMA } from '@/views/host-ops/terminal/types/terminal.theme';
|
import { DEFAULT_SCHEMA } from '@/views/host/terminal/types/terminal.theme';
|
||||||
import { InnerTabs } from '@/views/host-ops/terminal/types/terminal.const';
|
import { InnerTabs } from '@/views/host/terminal/types/terminal.const';
|
||||||
|
import { getHostTerminalAccessToken } from '@/api/asset/host-terminal';
|
||||||
|
|
||||||
// 暗色主题
|
// 暗色主题
|
||||||
export const DarkTheme = {
|
export const DarkTheme = {
|
||||||
@@ -33,7 +34,8 @@ export default defineStore('terminal', {
|
|||||||
tabs: {
|
tabs: {
|
||||||
active: InnerTabs.NEW_CONNECTION.key,
|
active: InnerTabs.NEW_CONNECTION.key,
|
||||||
items: [InnerTabs.NEW_CONNECTION, InnerTabs.VIEW_SETTING]
|
items: [InnerTabs.NEW_CONNECTION, InnerTabs.VIEW_SETTING]
|
||||||
}
|
},
|
||||||
|
access: undefined
|
||||||
}),
|
}),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
@@ -139,7 +141,13 @@ export default defineStore('terminal', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 打开终端
|
// 打开终端
|
||||||
openTerminal(record: HostQueryResponse) {
|
async openTerminal(record: HostQueryResponse) {
|
||||||
|
// 获取 access
|
||||||
|
if (!this.access) {
|
||||||
|
const { data } = await getHostTerminalAccessToken();
|
||||||
|
this.access = data;
|
||||||
|
}
|
||||||
|
console.log(this.access);
|
||||||
console.log(record);
|
console.log(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
|
import type { HostTerminalAccessResponse } from '@/api/asset/host-terminal';
|
||||||
|
|
||||||
export interface TerminalState {
|
export interface TerminalState {
|
||||||
isDarkTheme: Ref<boolean>;
|
isDarkTheme: Ref<boolean>;
|
||||||
preference: TerminalPreference;
|
preference: TerminalPreference;
|
||||||
tabs: TerminalTabs;
|
tabs: TerminalTabs;
|
||||||
|
access?: HostTerminalAccessResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 终端配置
|
// 终端配置
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'asset-host-connect-log-table'
|
name: 'hostReviewConnectLogTable'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-container" v-if="render">
|
<div class="layout-container" v-if="render">
|
||||||
<!-- 列表-表格 -->
|
<!-- 列表-表格 -->
|
||||||
<host-connect-log-table />
|
<connect-log-table />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'assetHostConnectLog'
|
name: 'hostReviewConnectLog'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import HostConnectLogTable from './components/host-connect-log-table.vue';
|
import ConnectLogTable from './components/connect-log-table.vue';
|
||||||
import { ref, onBeforeMount, onUnmounted } from 'vue';
|
import { ref, onBeforeMount, onUnmounted } from 'vue';
|
||||||
import { useCacheStore, useDictStore } from '@/store';
|
import { useCacheStore, useDictStore } from '@/store';
|
||||||
import { dictKeys } from './types/const';
|
import { dictKeys } from './types/const';
|
||||||
@@ -11,10 +11,6 @@
|
|||||||
<new-connection-view v-if="tab.key === InnerTabs.NEW_CONNECTION.key" />
|
<new-connection-view v-if="tab.key === InnerTabs.NEW_CONNECTION.key" />
|
||||||
<!-- 显示设置 -->
|
<!-- 显示设置 -->
|
||||||
<terminal-view-setting v-else-if="tab.key === InnerTabs.VIEW_SETTING.key" />
|
<terminal-view-setting v-else-if="tab.key === InnerTabs.VIEW_SETTING.key" />
|
||||||
<span v-else>
|
|
||||||
{{ tab.key }}
|
|
||||||
{{ tab.title }}
|
|
||||||
</span>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 终端 -->
|
<!-- 终端 -->
|
||||||
<template v-else-if="tab.type === TabType.TERMINAL">
|
<template v-else-if="tab.type === TabType.TERMINAL">
|
||||||
@@ -14,37 +14,39 @@
|
|||||||
:cancel-button-props="{ disabled: loading }"
|
:cancel-button-props="{ disabled: loading }"
|
||||||
:on-before-ok="handlerOk"
|
:on-before-ok="handlerOk"
|
||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<a-spin :loading="loading" class="role-menu-wrapper">
|
<div class="role-menu-wrapper">
|
||||||
<a-alert class="usn mb8">
|
<a-spin :loading="loading">
|
||||||
<span>{{ roleRecord.name }} {{ roleRecord.code }}</span>
|
<a-alert class="usn mb8">
|
||||||
<span class="mx8">-</span>
|
<span>{{ roleRecord.name }} {{ roleRecord.code }}</span>
|
||||||
<span>菜单分配后需要用户手动刷新页面才会生效</span>
|
<span class="mx8">-</span>
|
||||||
</a-alert>
|
<span>菜单分配后需要用户手动刷新页面才会生效</span>
|
||||||
<div class="usn mb8">
|
</a-alert>
|
||||||
<a-space>
|
<div class="usn mb8">
|
||||||
<a-tag color="arcoblue">全选操作</a-tag>
|
<a-space>
|
||||||
<!-- 全选操作 -->
|
<a-tag color="arcoblue">全选操作</a-tag>
|
||||||
<template v-for="opt of quickGrantMenuOperator" :key="opt.name">
|
<!-- 全选操作 -->
|
||||||
<a-button size="mini" type="text" @click="() => { table.checkOrUncheckByFilter(opt.filter, true) }">
|
<template v-for="opt of quickGrantMenuOperator" :key="opt.name">
|
||||||
{{ opt.name }}
|
<a-button size="mini" type="text" @click="() => { table.checkOrUncheckByFilter(opt.filter, true) }">
|
||||||
</a-button>
|
{{ opt.name }}
|
||||||
</template>
|
</a-button>
|
||||||
</a-space>
|
</template>
|
||||||
</div>
|
</a-space>
|
||||||
<div class="usn mb8">
|
</div>
|
||||||
<a-space>
|
<div class="usn mb8">
|
||||||
<a-tag color="arcoblue">反选操作</a-tag>
|
<a-space>
|
||||||
<!-- 反选操作 -->
|
<a-tag color="arcoblue">反选操作</a-tag>
|
||||||
<template v-for="opt of quickGrantMenuOperator" :key="opt.name">
|
<!-- 反选操作 -->
|
||||||
<a-button size="mini" type="text" @click="() => { table.checkOrUncheckByFilter(opt.filter, false) }">
|
<template v-for="opt of quickGrantMenuOperator" :key="opt.name">
|
||||||
{{ opt.name }}
|
<a-button size="mini" type="text" @click="() => { table.checkOrUncheckByFilter(opt.filter, false) }">
|
||||||
</a-button>
|
{{ opt.name }}
|
||||||
</template>
|
</a-button>
|
||||||
</a-space>
|
</template>
|
||||||
</div>
|
</a-space>
|
||||||
<!-- 菜单 -->
|
</div>
|
||||||
<menu-grant-table ref="table" />
|
<!-- 菜单 -->
|
||||||
</a-spin>
|
<menu-grant-table ref="table" />
|
||||||
|
</a-spin>
|
||||||
|
</div>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user