Skip to content

Commit

Permalink
feat(frontend): po环境各db集群详情tab新增开关控制 #8367
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 25616
  • Loading branch information
jinquantianxia committed Dec 3, 2024
1 parent 6d77842 commit b35db5e
Show file tree
Hide file tree
Showing 18 changed files with 123 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,145 +42,7 @@ interface ControllerItem<T extends string> extends ControllerBaseInfo {
children: Record<T, ControllerBaseInfo>;
}

interface ControllerData {
addons: ControllerItem<AddonsFunctions>;
mysql: ControllerItem<MySQLFunctions>;
redis: ControllerItem<RedisFunctions>;
bigdata: ControllerItem<BigdataFunctions>;
monitor: ControllerItem<MonitorFunctions>;
mongodb: ControllerItem<MongoFunctions>;
sqlserver: ControllerItem<SqlServerFunctions>;

personalWorkbench: ControllerItem<string>;
'personalWorkbench.serviceApply': ControllerItem<string>;
'personalWorkbench.myTickets': ControllerItem<string>;
'personalWorkbench.myTodos': ControllerItem<string>;
observableManage: ControllerItem<string>;
'observableManage.DBHASwitchEvents': ControllerItem<string>;
'observableManage.healthReport': ControllerItem<string>;
globalConfigManage: ControllerItem<string>;
'globalConfigManage.dbConfig': ControllerItem<string>;
'globalConfigManage.versionFile': ControllerItem<string>;
'globalConfigManage.monitorStrategy': ControllerItem<string>;
'globalConfigManage.rotationManage': ControllerItem<string>;
'globalConfigManage.passwordSafe': ControllerItem<string>;
'globalConfigManage.staffManage': ControllerItem<string>;
'globalConfigManage.ticketFlowSetting': ControllerItem<string>;
'globalConfigManage.alarmGroup': ControllerItem<string>;
'globalConfigManage.whitelistManage': ControllerItem<string>;
resourceManage: ControllerItem<string>;
'resourceManage.resourceSpec': ControllerItem<string>;
'resourceManage.resourcePool': ControllerItem<string>;
'resourceManage.dirtyHostManage': ControllerItem<string>;
'resourceManage.resourceOperationRecord': ControllerItem<string>;
bizConfigManage: ControllerItem<string>;
'bizConfigManage.monitorStrategy': ControllerItem<string>;
'bizConfigManage.alarmGroup': ControllerItem<string>;
'bizConfigManage.dbConfigure': ControllerItem<string>;
'bizConfigManage.StaffManage': ControllerItem<string>;
'bizConfigManage.ticketFlowSetting': ControllerItem<string>;
databaseManage: ControllerItem<string>;
'databaseManage.missionManage': ControllerItem<string>;
'databaseManage.whitelistManage': ControllerItem<string>;
'databaseManage.temporaryPaasswordModify': ControllerItem<string>;
'mysql.haInstanceList': ControllerItem<string>;
'mysql.dataSubscription': ControllerItem<string>;
'mysql.permissionManage': ControllerItem<string>;
'mysql.partitionManage': ControllerItem<string>;
'mysql.toolbox.sqlExecute': ControllerItem<string>;
'mysql.toolbox.dbRename': ControllerItem<string>;
'mysql.toolbox.rollback': ControllerItem<string>;
'mysql.toolbox.flashback': ControllerItem<string>;
'mysql.toolbox.dbTableBackup': ControllerItem<string>;
'mysql.toolbox.dbBackup': ControllerItem<string>;
'mysql.toolbox.clientPermissionClone': ControllerItem<string>;
'mysql.toolbox.dbInstancePermissionClone': ControllerItem<string>;
'mysql.toolbox.slaveRebuild': ControllerItem<string>;
'mysql.toolbox.slaveAdd': ControllerItem<string>;
'mysql.toolbox.masterSlaveClone': ControllerItem<string>;
'mysql.toolbox.masterSlaveSwap': ControllerItem<string>;
'mysql.toolbox.proxyReplace': ControllerItem<string>;
'mysql.toolbox.proxyAdd': ControllerItem<string>;
'mysql.toolbox.masterFailover': ControllerItem<string>;
'mysql.toolbox.dbClear': ControllerItem<string>;
'mysql.toolbox.checksum': ControllerItem<string>;
'mysql.toolbox.openareaTemplate': ControllerItem<string>;
'tendbCluster.clusterManage.proxyScaleUp': ControllerItem<string>;
'tendbCluster.clusterManage.proxyScaleDown': ControllerItem<string>;
'tendbCluster.clusterManage.removeMNTNode': ControllerItem<string>;
'tendbCluster.clusterManage.removeReadonlyNode': ControllerItem<string>;
'tendbCluster.clusterManage.disable': ControllerItem<string>;
'tendbCluster.instanceManage': ControllerItem<string>;
'tendbCluster.partitionManage': ControllerItem<string>;
'tendbCluster.permissionManage': ControllerItem<string>;
'tendbCluster.toolbox.sqlExecute': ControllerItem<string>;
'tendbCluster.toolbox.dbRename': ControllerItem<string>;
'tendbCluster.toolbox.rollback': ControllerItem<string>;
'tendbCluster.toolbox.rollbackRecord': ControllerItem<string>;
'tendbCluster.toolbox.flashback': ControllerItem<string>;
'tendbCluster.toolbox.dbTableBackup': ControllerItem<string>;
'tendbCluster.toolbox.dbBackup': ControllerItem<string>;
'tendbCluster.toolbox.clientPermissionClone': ControllerItem<string>;
'tendbCluster.toolbox.dbInstancePermissionClone': ControllerItem<string>;
'tendbCluster.toolbox.addMnt': ControllerItem<string>;
'tendbCluster.toolbox.proxySlaveApply': ControllerItem<string>;
'tendbCluster.toolbox.masterSlaveSwap': ControllerItem<string>;
'tendbCluster.toolbox.masterFailover': ControllerItem<string>;
'tendbCluster.toolbox.capacityChange': ControllerItem<string>;
'tendbCluster.toolbox.proxyScaleDown': ControllerItem<string>;
'tendbCluster.toolbox.proxyScaleUp': ControllerItem<string>;
'tendbCluster.toolbox.dbClear': ControllerItem<string>;
'tendbCluster.toolbox.checksum': ControllerItem<string>;
'tendbCluster.toolbox.openareaTemplate': ControllerItem<string>;
'tendbCluster.toolbox.slaveRebuild': ControllerItem<string>;
'tendbCluster.toolbox.masterSlaveClone': ControllerItem<string>;
'redis.clusterManage.getAccess': ControllerItem<string>;
'redis.clusterManage.enableCLB': ControllerItem<string>;
'redis.clusterManage.DNSDomainToCLB': ControllerItem<string>;
'redis.clusterManage.enablePolaris': ControllerItem<string>;
'redis.clusterManage.disable': ControllerItem<string>;
'redis.clusterManage.enable': ControllerItem<string>;
'redis.clusterManage.delete': ControllerItem<string>;
'redis.instanceManage': ControllerItem<string>;
'redis.haClusterManage': ControllerItem<string>;
'redis.haInstanceManage': ControllerItem<string>;
'redis.toolbox.installModule': ControllerItem<string>;
'redis.toolbox.capacityChange': ControllerItem<string>;
'redis.toolbox.proxyScaleUp': ControllerItem<string>;
'redis.toolbox.proxyScaleDown': ControllerItem<string>;
'redis.toolbox.clusterShardChange': ControllerItem<string>;
'redis.toolbox.clusterTypeChange': ControllerItem<string>;
'redis.toolbox.slaveRebuild': ControllerItem<string>;
'redis.toolbox.masterSlaveSwap': ControllerItem<string>;
'redis.toolbox.dbReplace': ControllerItem<string>;
'redis.toolbox.versionUpgrade': ControllerItem<string>;
'redis.toolbox.rollback': ControllerItem<string>;
'redis.toolbox.rollbackRecord': ControllerItem<string>;
'redis.toolbox.recoverFromInstance': ControllerItem<string>;
'redis.toolbox.dataCopy': ControllerItem<string>;
'redis.toolbox.dataCopyRecord': ControllerItem<string>;
'mysql.haClusterList.clusterTopo': ControllerItem<string>;
'mysql.haClusterList.changeLog': ControllerItem<string>;
'mysql.singleClusterList.clusterTopo': ControllerItem<string>;
'mysql.singleClusterList.changeLog': ControllerItem<string>;
'tendbCluster.clusterManage.clusterTopo': ControllerItem<string>;
'tendbCluster.clusterManage.changeLog': ControllerItem<string>;
'redis.clusterManage.clusterTopo': ControllerItem<string>;
'redis.clusterManage.changeLog': ControllerItem<string>;
'redis.haClusterManage.clusterTopo': ControllerItem<string>;
'redis.haClusterManage.changeLog': ControllerItem<string>;
'es.clusterManage.clusterTopo': ControllerItem<string>;
'es.clusterManage.changeLog': ControllerItem<string>;
'kafka.clusterManage.clusterTopo': ControllerItem<string>;
'kafka.clusterManage.changeLog': ControllerItem<string>;
'hdfs.clusterManage.clusterTopo': ControllerItem<string>;
'hdfs.clusterManage.changeLog': ControllerItem<string>;
'pulsar.clusterManage.clusterTopo': ControllerItem<string>;
'pulsar.clusterManage.changeLog': ControllerItem<string>;
'personalWorkbench.myTickets.viewDetails': ControllerItem<string>;
}

export type ExtractedControllerDataKeys = Extract<keyof ControllerData, string>;
export type ExtractedControllerDataKeys = Extract<keyof FunctionController, string>;

export default class FunctionController {
addons: ControllerItem<AddonsFunctions>;
Expand Down Expand Up @@ -319,16 +181,48 @@ export default class FunctionController {
'pulsar.clusterManage.clusterTopo': ControllerItem<string>;
'pulsar.clusterManage.changeLog': ControllerItem<string>;
'personalWorkbench.myTickets.viewDetails': ControllerItem<string>;
'mysql.haClusterList.basicInfo': ControllerItem<string>;
'mysql.singleClusterList.basicInfo': ControllerItem<string>;
'tendbCluster.clusterManage.basicInfo': ControllerItem<string>;
'redis.clusterManage.baseInfo': ControllerItem<string>;
'redis.haClusterManage.baseInfo': ControllerItem<string>;
'sqlserver.haClusterList.clusterTopo': ControllerItem<string>;
'sqlserver.haClusterList.basicInfo': ControllerItem<string>;
'sqlserver.haClusterList.changeLog': ControllerItem<string>;
'sqlserver.singleClusterList.clusterTopo': ControllerItem<string>;
'sqlserver.singleClusterList.basicInfo': ControllerItem<string>;
'sqlserver.singleClusterList.changeLog': ControllerItem<string>;
'es.clusterManage.nodeList': ControllerItem<string>;
'es.clusterManage.baseInfo': ControllerItem<string>;
'hdfs.clusterManage.nodeList': ControllerItem<string>;
'hdfs.clusterManage.baseInfo': ControllerItem<string>;
'kafka.clusterManage.nodeList': ControllerItem<string>;
'kafka.clusterManage.baseInfo': ControllerItem<string>;
'mongodb.replicaSetList.clusterTopo': ControllerItem<string>;
'mongodb.replicaSetList.basicInfo': ControllerItem<string>;
'mongodb.replicaSetList.changeLog': ControllerItem<string>;
'mongodb.sharedClusterList.clusterTopo': ControllerItem<string>;
'mongodb.sharedClusterList.basicInfo': ControllerItem<string>;
'mongodb.sharedClusterList.changeLog': ControllerItem<string>;
'pulsar.clusterManage.nodeList': ControllerItem<string>;
'pulsar.clusterManage.baseInfo': ControllerItem<string>;
'doris.clusterManage.clusterTopo': ControllerItem<string>;
'doris.clusterManage.baseInfo': ControllerItem<string>;
'doris.clusterManage.changeLog': ControllerItem<string>;
'doris.clusterManage.nodeList': ControllerItem<string>;
'riak.clusterManage.clusterTopo': ControllerItem<string>;
'riak.clusterManage.baseInfo': ControllerItem<string>;
'riak.clusterManage.changeLog': ControllerItem<string>;
'riak.clusterManage.nodeList': ControllerItem<string>;

constructor(payload = {} as ControllerData) {
constructor(payload = {} as FunctionController) {
this.addons = payload.addons;
this.mysql = payload.mysql;
this.redis = payload.redis;
this.mongodb = payload.mongodb;
this.bigdata = payload.bigdata;
this.monitor = payload.monitor;
this.sqlserver = payload.sqlserver;

this.personalWorkbench = payload.personalWorkbench;
this.observableManage = payload.observableManage;
this.globalConfigManage = payload.globalConfigManage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@
class="detail-tab"
type="card-tab">
<BkTabPanel
v-if="checkDbConsole('doris.clusterManage.clusterTopo')"
:label="t('集群拓扑')"
name="topo" />
<BkTabPanel
v-if="checkDbConsole('doris.clusterManage.nodeList')"
:label="t('节点列表')"
name="nodeList" />
<BkTabPanel
v-if="checkDbConsole('doris.clusterManage.baseInfo')"
:label="t('基本信息')"
name="baseInfo" />
<BkTabPanel
v-if="checkDbConsole('doris.clusterManage.changeLog')"
:label="t('变更记录')"
name="record" />
<BkTabPanel
Expand Down Expand Up @@ -75,6 +79,8 @@
import ClusterEventChange from '@views/db-manage/common/cluster-event-change/EventChange.vue';
import MonitorDashboard from '@views/db-manage/common/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 @@ -15,17 +15,21 @@
<div class="doris-list-page">
<div class="header-action">
<AuthButton
v-db-console="'doris.clusterManage.instanceApply'"
action-id="doris_apply"
class="mb16"
theme="primary"
@click="handleGoApply">
{{ t('申请实例') }}
</AuthButton>
<DropdownExportExcel
v-db-console="'doris.clusterManage.batchOperation'"
:has-selected="hasSelected"
:ids="selectedIds"
type="doris" />
<ClusterIpCopy :selected="selected" />
<ClusterIpCopy
v-db-console="'doris.clusterManage.batchCopy'"
:selected="selected" />
<DbSearchSelect
class="mb16"
:data="serachData"
Expand Down Expand Up @@ -667,7 +671,9 @@
render: ({ data }: { data: DorisModel }) => {
if (data.isOnline) {
return [
<OperationBtnStatusTips data={data}>
<OperationBtnStatusTips
data={data}
v-db-console="doris.clusterManage.scaleUp">
<auth-button
text
theme="primary"
Expand All @@ -679,7 +685,9 @@
{ t('扩容') }
</auth-button>
</OperationBtnStatusTips>,
<OperationBtnStatusTips data={data}>
<OperationBtnStatusTips
data={data}
v-db-console="doris.clusterManage.scaleDown">
<auth-button
text
theme="primary"
Expand All @@ -696,6 +704,7 @@
text
theme="primary"
action-id="doris_access_entry_view"
v-db-console="doris.clusterManage.getAccess"
permission={data.permission.doris_access_entry_view}
resource={data.id}
class="ml-16"
Expand All @@ -714,14 +723,14 @@
),
content: () => (
<>
<bk-dropdown-item>
<bk-dropdown-item v-db-console="doris.clusterManage.manage">
<a
href={data.access_url}
target="_blank">
{t('管理')}
</a>,
</bk-dropdown-item>
<bk-dropdown-item>
<bk-dropdown-item v-db-console="doris.clusterManage.disable">
<OperationBtnStatusTips data={data}>
<auth-button
text
Expand All @@ -735,7 +744,7 @@
</auth-button>
</OperationBtnStatusTips>
</bk-dropdown-item>
<bk-dropdown-item>
<bk-dropdown-item v-db-console="doris.clusterManage.delete">
<OperationBtnStatusTips data={data}>
<auth-button
v-bk-tooltips={{
Expand All @@ -760,7 +769,9 @@
];
}
return [
<OperationBtnStatusTips data={data}>
<OperationBtnStatusTips
data={data}
v-db-console="doris.clusterManage.enable">
<auth-button
text
theme="primary"
Expand All @@ -772,7 +783,9 @@
{ t('启用') }
</auth-button>
</OperationBtnStatusTips>,
<OperationBtnStatusTips data={data}>
<OperationBtnStatusTips
data={data}
v-db-console="doris.clusterManage.delete">
<auth-button
text
theme="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
:label="t('集群拓扑')"
name="topo" />
<BkTabPanel
v-if="checkDbConsole('es.clusterManage.nodeList')"
:label="t('节点列表')"
name="nodeList" />
<BkTabPanel
v-if="checkDbConsole('es.clusterManage.baseInfo')"
:label="t('基本信息')"
name="baseInfo" />
<BkTabPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
:label="t('集群拓扑')"
name="topo" />
<BkTabPanel
v-if="checkDbConsole('hdfs.clusterManage.nodeList')"
:label="t('节点列表')"
name="nodeList" />
<BkTabPanel
v-if="checkDbConsole('hdfs.clusterManage.baseInfo')"
:label="t('基本信息')"
name="baseInfo" />
<BkTabPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
:label="t('集群拓扑')"
name="topo" />
<BkTabPanel
v-if="checkDbConsole('kafka.clusterManage.nodeList')"
:label="t('节点列表')"
name="nodeList" />
<BkTabPanel
v-if="checkDbConsole('kafka.clusterManage.baseInfo')"
:label="t('基本信息')"
name="baseInfo" />
<BkTabPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@
class="content-tabs"
type="card-tab">
<BkTabPanel
v-if="checkDbConsole('mongodb.replicaSetList.clusterTopo')"
:label="t('集群拓扑')"
name="topo" />
<BkTabPanel
v-if="checkDbConsole('mongodb.replicaSetList.basicInfo')"
:label="t('基本信息')"
name="info" />
<BkTabPanel
v-if="checkDbConsole('mongodb.replicaSetList.changeLog')"
:label="t('变更记录')"
name="record" />
<BkTabPanel
Expand Down Expand Up @@ -144,6 +147,8 @@
import AccessEntry from '@views/db-manage/mongodb/components/AccessEntry.vue';
import CapacityChange from '@views/db-manage/mongodb/components/CapacityChange.vue';

import { checkDbConsole } from '@utils';

import BaseInfo from './BaseInfo.vue';

interface Props {
Expand Down
Loading

0 comments on commit b35db5e

Please sign in to comment.