Skip to content

Commit

Permalink
perf(frontend): db-manage 路由调整 #6889
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Sep 12, 2024
1 parent 9eaaeca commit df6de8d
Show file tree
Hide file tree
Showing 1,109 changed files with 4,638 additions and 5,480 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import { UserPersonalSettings } from '@common/const';
import toolboxMenuConfig from '@views/mongodb-manage/toolbox-menu';
import toolboxMenuConfig from '@views/db-manage/mongodb/toolbox-menu';
import { makeMap } from '@utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
import { UserPersonalSettings } from '@common/const';
import toolboxMenuConfig from '@views/mysql/toolbox-menu';
import toolboxMenuConfig from '@views/db-manage/mysql/toolbox-menu';
import { makeMap } from '@utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
import { UserPersonalSettings } from '@common/const';
import toolboxMenuConfig from '@views/redis/toolbox-menu';
import toolboxMenuConfig from '@views/db-manage/redis/toolbox-menu';
import { makeMap } from '@utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import { UserPersonalSettings } from '@common/const';
import toolboxMenuConfig from '@views/sqlserver-manage/toolbox-menu';
import toolboxMenuConfig from '@views/db-manage/sqlserver/toolbox-menu';
import { makeMap } from '@utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
import { UserPersonalSettings } from '@common/const';
import toolboxMenuConfig from '@views/spider-manage/toolbox-menu';
import toolboxMenuConfig from '@views/db-manage/tendb-cluster/toolbox-menu';
import { makeMap } from '@utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import _ from 'lodash';
import { ref, watch } from 'vue';
import mysqlToolboxMenuConfig from '@views/mysql/toolbox-menu';
import mysqlToolboxMenuConfig from '@views/db-manage/mysql/toolbox-menu';
interface Props {
id: string;
Expand Down
36 changes: 4 additions & 32 deletions dbm-ui/frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,22 @@
import _ from 'lodash';
import { createRouter, createWebHistory, type Router, type RouteRecordRaw } from 'vue-router';

import type { BigdataFunctions, MongoFunctions } from '@services/model/function-controller/functionController';

import { useFunController, useGlobalBizs } from '@stores';
import { useGlobalBizs } from '@stores';

import BizPermission from '@views/BizPermission.vue';
import getDbConfRoutes from '@views/db-configure/routes';
// import getDbManageRoutes from '@views/db-manage/routes';
import getDbManageRoutes from '@views/db-manage/routes';
import getDbhaSwitchEventsRouters from '@views/dbha-switch-events/routes';
import getDutyRuleManageRoutes from '@views/duty-rule-manage/routes';
import getESRoutes from '@views/es-manage/routes';
import getHDFSRoutes from '@views/hdfs-manage/routes';
import getInfluxDBRoutes from '@views/influxdb-manage/routes';
import getInspectionRoutes from '@views/inspection-manage/routes';
import getKafkaRoutes from '@views/kafka-manage/routes';
import getMongoRoutes from '@views/mongodb-manage/routes';
import getDBMonitorAlarmRoutes from '@views/monitor-alarm-db/routes';
import getPlatMonitorAlarmRoutes from '@views/monitor-alarm-plat/routes';
import getMysqlRoutes from '@views/mysql/routes';
import getNotificationSettingRoutes from '@views/notification-setting/routes';
import getPasswordManageRoutes from '@views/password-manage/routes';
import getPlatformDbConfigureRoutes from '@views/platform-db-configure/routes';
import getPulsarRoutes from '@views/pulsar-manage/routes';
import getQuickSearchRoutes from '@views/quick-search/routes';
import getRedisRoutes from '@views/redis/routes';
import getResourceManageRoutes from '@views/resource-manage/routes';
import getRiakManage from '@views/riak-manage/routes';
import getServiceApplyRoutes from '@views/service-apply/routes';
import getSpiderManageRoutes from '@views/spider-manage/routes';
import getSqlServerRouters from '@views/sqlserver-manage/routes';
import getStaffManageRoutes from '@views/staff-manage/routes';
import getTaskHistoryRoutes from '@views/task-history/routes';
import getTemporaryPasswordModify from '@views/temporary-paassword-modify/routes';
Expand Down Expand Up @@ -101,12 +88,7 @@ export default () => {
bizPermission = true;
}

const { funControllerData } = useFunController();
const bigdataController = funControllerData.getFlatData<BigdataFunctions, 'bigdata'>('bigdata');
const mongdbController = funControllerData.getFlatData<MongoFunctions, 'mongodb'>('mongodb');

// getDbManageRoutes();

console.log('getDbManageRoutes = ', getDbManageRoutes());
const routes = [
{
path: rootPath,
Expand All @@ -128,30 +110,20 @@ export default () => {
{
path: `${rootPath}${currentBiz}`,
children: [
...getDbManageRoutes(),
...getDbConfRoutes(),
...getESRoutes(bigdataController),
...getDbhaSwitchEventsRouters(),
...getHDFSRoutes(bigdataController),
...getInfluxDBRoutes(bigdataController),
...getInspectionRoutes(),
...getKafkaRoutes(bigdataController),
...getDBMonitorAlarmRoutes(),
...getPlatMonitorAlarmRoutes(),
...getMysqlRoutes(funControllerData),
...getNotificationSettingRoutes(),
...getPulsarRoutes(bigdataController),
...getRedisRoutes(funControllerData),
...getSpiderManageRoutes(funControllerData),
...getStaffManageRoutes(),
...getTaskHistoryRoutes(),
...getWhitelistRoutes(),
...getTicketManageRoutes(),
...getTemporaryPasswordModify(),
...getRiakManage(bigdataController),
...getTicketFlowSettingBizRoutes(),
...getTicketFlowSettingGlobalRoutes(),
...getMongoRoutes(mongdbController),
...getSqlServerRouters(funControllerData),
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/views/db-configure/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const routes: RouteRecordRaw[] = [
meta: {
navName: t('新建模块'),
},
component: () => import('@views/spider-manage/apply/CreateModule.vue'),
component: () => import('@views/db-manage/tendb-cluster/apply/CreateModule.vue'),
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';

import TableEditSelect from '@views/mysql/common/edit/Select.vue';
import TableEditSelect from '@views/db-manage/mysql/common/edit/Select.vue';

interface Props {
modelValue: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
<script setup lang="ts">
import OperateColumn from '@components/render-table/columns/operate-column/index.vue';

import RenderDbName from '@views/mysql/common/edit-field/DbName.vue';
import RenderTableName from '@views/mysql/common/edit-field/TableName.vue';
import RenderDbName from '@views/db-manage/mysql/common/edit-field/DbName.vue';
import RenderTableName from '@views/db-manage/mysql/common/edit-field/TableName.vue';

import RenderBackupSource from './RenderBackupSource.vue';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@
import { useGlobalBizs } from '@stores';

import { ClusterTypes } from '@common/const';
import { checkDbConsole } from '@utils';

import ClusterTopo from '@components/cluster-details/ClusterTopo.vue';
import ClusterEventChange from '@components/cluster-event-change/EventChange.vue';
import MonitorDashboard from '@components/cluster-monitor/MonitorDashboard.vue';

import { checkDbConsole } from '@utils';

import BaseInfo from './components/BaseInfo.vue';
import NodeList from './components/node-list/Index.vue';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@
import RenderClusterRole from '@components/cluster-common/RenderRole.vue';
import RenderHostStatus from '@components/render-host-status/Index.vue';

import ClusterExpansion from '@views/es-manage/common/expansion/Index.vue';
import ClusterReplace from '@views/es-manage/common/replace/Index.vue';
import ClusterShrink from '@views/es-manage/common/shrink/Index.vue';
import ClusterExpansion from '@views/db-manage/elastic-search/common/expansion/Index.vue';
import ClusterReplace from '@views/db-manage/elastic-search/common/replace/Index.vue';
import ClusterShrink from '@views/db-manage/elastic-search/common/shrink/Index.vue';

import {
getSearchSelectorParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
import ClusterIpCopy from '@views/db-manage/common/cluster-ip-copy/Index.vue';
import RenderCellCopy from '@views/db-manage/common/render-cell-copy/Index.vue';
import RenderHeadCopy from '@views/db-manage/common/render-head-copy/Index.vue';
import ClusterExpansion from '@views/es-manage/common/expansion/Index.vue';
import ClusterShrink from '@views/es-manage/common/shrink/Index.vue';
import ClusterExpansion from '@views/db-manage/elastic-search/common/expansion/Index.vue';
import ClusterShrink from '@views/db-manage/elastic-search/common/shrink/Index.vue';

import {
getMenuListSearch,
Expand Down Expand Up @@ -1121,6 +1121,7 @@
}
}
}

.es-manage-sideslider {
.bk-modal-content {
max-height: calc(100vh - 120px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,29 @@
import type { RouteRecordRaw } from 'vue-router';

import type { BigdataFunctions } from '@services/model/function-controller/functionController';
import FunctionControllModel from '@services/model/function-controller/functionController';

import { t } from '@locales/index';

const routes: RouteRecordRaw[] = [
{
name: 'EsManage',
path: 'es-manage',
path: 'elastic-search',
meta: {
navName: t('ES_集群管理'),
},
redirect: {
name: 'EsList',
},
component: () => import('@views/es-manage/Index.vue'),
component: () => import('@views/db-manage/elastic-search/Index.vue'),
children: [
// {
// name: 'EsApply',
// path: 'apply',
// meta: {
// navName: t('申请ES集群部署'),
// },
// component: () => import('@views/es-manage/apply/Index.vue'),
// component: () => import('@views/db-manage/elastic-search/apply/Index.vue'),
// },
{
name: 'EsList',
Expand All @@ -44,12 +45,13 @@ const routes: RouteRecordRaw[] = [
navName: t('ES_集群管理'),
fullscreen: true,
},
component: () => import('@views/es-manage/list/Index.vue'),
component: () => import('@views/db-manage/elastic-search/list/Index.vue'),
},
],
},
];

export default function getRoutes(controller: Record<BigdataFunctions | 'bigdata', boolean>) {
export default function getRoutes(funControllerData: FunctionControllModel) {
const controller = funControllerData.getFlatData<BigdataFunctions, 'bigdata'>('bigdata');
return controller.es ? routes : [];
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@
import { useGlobalBizs } from '@stores';

import { ClusterTypes } from '@common/const';
import { checkDbConsole } from '@utils';

import ClusterTopo from '@components/cluster-details/ClusterTopo.vue';
import ClusterEventChange from '@components/cluster-event-change/EventChange.vue';
import MonitorDashboard from '@components/cluster-monitor/MonitorDashboard.vue';

import { checkDbConsole } from '@utils';

import BaseInfo from './components/BaseInfo.vue';
import NodeList from './components/node-list/Index.vue';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
import RenderClusterRole from '@components/cluster-common/RenderRole.vue';
import RenderHostStatus from '@components/render-host-status/Index.vue';

import ClusterExpansion from '@views/hdfs-manage/common/expansion/Index.vue';
import ClusterReplace from '@views/hdfs-manage/common/replace/Index.vue';
import ClusterShrink from '@views/hdfs-manage/common/shrink/Index.vue';
import ClusterExpansion from '@views/db-manage/hdfs/common/expansion/Index.vue';
import ClusterReplace from '@views/db-manage/hdfs/common/replace/Index.vue';
import ClusterShrink from '@views/db-manage/hdfs/common/shrink/Index.vue';

import {
getSearchSelectorParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
import ClusterIpCopy from '@views/db-manage/common/cluster-ip-copy/Index.vue';
import RenderCellCopy from '@views/db-manage/common/render-cell-copy/Index.vue';
import RenderHeadCopy from '@views/db-manage/common/render-head-copy/Index.vue';
import ClusterExpansion from '@views/hdfs-manage/common/expansion/Index.vue';
import ClusterShrink from '@views/hdfs-manage/common/shrink/Index.vue';
import ClusterExpansion from '@views/db-manage/hdfs/common/expansion/Index.vue';
import ClusterShrink from '@views/db-manage/hdfs/common/shrink/Index.vue';

import {
getMenuListSearch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,29 @@
import type { RouteRecordRaw } from 'vue-router';

import type { BigdataFunctions } from '@services/model/function-controller/functionController';
import FunctionControllModel from '@services/model/function-controller/functionController';

import { t } from '@locales/index';

const routes: RouteRecordRaw[] = [
{
name: 'HdfsManage',
path: 'hdfs-manage',
path: 'hdfs',
meta: {
navName: t('HDFS_集群管理'),
},
redirect: {
name: 'HdfsList',
},
component: () => import('@views/hdfs-manage/Index.vue'),
component: () => import('@views/db-manage/hdfs/Index.vue'),
children: [
// {
// name: 'HdfsApply',
// path: 'apply',
// meta: {
// navName: t('申请HDFS集群部署'),
// },
// component: () => import('@views/hdfs-manage/apply/Index.vue'),
// component: () => import('@views/db-manage/hdfs/apply/Index.vue'),
// },
{
name: 'HdfsList',
Expand All @@ -44,12 +45,13 @@ const routes: RouteRecordRaw[] = [
navName: t('HDFS_集群管理'),
fullscreen: true,
},
component: () => import('@views/hdfs-manage/list/Index.vue'),
component: () => import('@views/db-manage/hdfs/list/Index.vue'),
},
],
},
];

export default function getRoutes(controller: Record<BigdataFunctions | 'bigdata', boolean>) {
export default function getRoutes(funControllerData: FunctionControllModel) {
const controller = funControllerData.getFlatData<BigdataFunctions, 'bigdata'>('bigdata');
return controller.hdfs ? routes : [];
}
Loading

0 comments on commit df6de8d

Please sign in to comment.