diff --git a/src/layout/default-layout.vue b/src/layout/default-layout.vue index 8589465..3ab2ef7 100644 --- a/src/layout/default-layout.vue +++ b/src/layout/default-layout.vue @@ -7,7 +7,7 @@ import('@/views/ops/pages/dc/detail/index.vue'), - meta: { - locale: 'menu.dc.detail', - requiresAuth: true, - roles: ['*'], - hideInMenu: true, - is_full: true, - isNewTab: true, - }, - }, - { - path: 'remote', - name: 'DCRemote', - component: () => import('@/views/ops/pages/dc/remote/index.vue'), - meta: { - locale: 'menu.dc.remote', - requiresAuth: true, - roles: ['*'], - hideInMenu: true, - is_full: true, - isNewTab: true, - }, - }, - ], + // path: '/dc', + // name: 'DC', + // component: DEFAULT_LAYOUT, + // meta: { + // locale: 'menu.dc', + // requiresAuth: true, + // icon: 'icon-desktop', + // order: 99, + // hideInMenu: true, + // }, + // children: [ + // { + // path: 'detail', + // name: 'DCDetail', + // component: () => import('@/views/ops/pages/dc/detail/index.vue'), + // meta: { + // locale: 'menu.dc.detail', + // requiresAuth: true, + // roles: ['*'], + // // is_full: true, + // isNewTab: true, + // }, + // }, + // { + // path: 'remote', + // name: 'DCRemote', + // component: () => import('@/views/ops/pages/dc/remote/index.vue'), + // meta: { + // locale: 'menu.dc.remote', + // requiresAuth: true, + // roles: ['*'], + // // is_full: true, + // isNewTab: true, + // }, + // }, + // ], } export default REMOTE diff --git a/src/views/ops/pages/dc/pc/index.vue b/src/views/ops/pages/dc/pc/index.vue index fe23e47..517febf 100644 --- a/src/views/ops/pages/dc/pc/index.vue +++ b/src/views/ops/pages/dc/pc/index.vue @@ -446,7 +446,7 @@ const handleEdit = (record: any) => { formDialogVisible.value = true } -// 详情 - 跳转到独立页面 +// 详情 - 在当前窗口打开 const handleDetail = (record: any) => { router.push({ path: '/dc/detail', @@ -470,9 +470,9 @@ const handleRestart = (record: any) => { }) } -// 远程控制 - 跳转到独立页面 +// 远程控制 - 在新窗口打开 const handleRemoteControl = (record: any) => { - router.push({ + const url = router.resolve({ path: '/dc/remote', query: { id: record.id, @@ -480,7 +480,8 @@ const handleRemoteControl = (record: any) => { ip: record.ip, status: record.status, }, - }) + }).href + window.open(url, '_blank') } // 表单提交成功 diff --git a/src/views/ops/pages/dc/remote/index.vue b/src/views/ops/pages/dc/remote/index.vue index 06db670..7051b49 100644 --- a/src/views/ops/pages/dc/remote/index.vue +++ b/src/views/ops/pages/dc/remote/index.vue @@ -3,11 +3,11 @@ @@ -167,6 +174,7 @@ import { import type { FormItem } from '@/components/search-form/types' import SearchTable from '@/components/search-table/index.vue' import { searchFormConfig } from './config/search-form' +import ServerFormDialog from '../pc/components/ServerFormDialog.vue' import { columns as columnsConfig } from './config/columns' import { fetchServerList, @@ -382,6 +390,8 @@ const mockServerData = [ // 状态管理 const loading = ref(false) const tableData = ref([]) +const formDialogVisible = ref(false) +const currentRecord = ref(null) const formModel = ref({ keyword: '', datacenter_id: undefined, @@ -510,8 +520,19 @@ const handleRefresh = () => { // 新增服务器 const handleAdd = () => { - Message.info('新增服务器功能待实现') - // TODO: 实现新增服务器对话框 + currentRecord.value = null + formDialogVisible.value = true +} + +// 编辑服务器 +const handleEdit = (record: any) => { + currentRecord.value = record + formDialogVisible.value = true +} + +// 表单提交成功 +const handleFormSuccess = () => { + fetchServers() } // 重启服务器 @@ -525,7 +546,7 @@ const handleRestart = (record: any) => { }) } -// 查看详情 - 跳转到独立页面 +// 查看详情 - 在当前窗口打开 const handleDetail = (record: any) => { router.push({ path: '/dc/detail', @@ -538,15 +559,9 @@ const handleDetail = (record: any) => { }) } -// 编辑服务器 -const handleEdit = (record: any) => { - Message.info('编辑服务器功能待实现') - // TODO: 实现编辑服务器对话框 -} - -// 远程控制 - 跳转到独立页面 +// 远程控制 - 在新窗口打开 const handleRemoteControl = (record: any) => { - router.push({ + const url = router.resolve({ path: '/dc/remote', query: { id: record.id, @@ -554,7 +569,8 @@ const handleRemoteControl = (record: any) => { ip: record.ip, status: record.status, }, - }) + }).href + window.open(url, '_blank') } // 删除服务器 diff --git a/src/views/ops/pages/report/history/components/NetworkDeviceStatusPanel.vue b/src/views/ops/pages/report/history/components/NetworkDeviceStatusPanel.vue index b322f69..fc1a073 100644 --- a/src/views/ops/pages/report/history/components/NetworkDeviceStatusPanel.vue +++ b/src/views/ops/pages/report/history/components/NetworkDeviceStatusPanel.vue @@ -1,127 +1,81 @@ @@ -261,39 +347,22 @@ export default {