Skip to content

Commit

Permalink
feat(frontend): 新增单据通知设置页面 TencentBlueKing#8335
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Dec 13, 2024
1 parent 5b1c48e commit 81255d1
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 58 deletions.
70 changes: 14 additions & 56 deletions dbm-ui/frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,19 @@
{
"eslint.validate": ["javascript", "javascriptreact", "html", "vue"],
"eslint.alwaysShowStatus": true,
"files.eol": "\n",
"editor.unfoldOnClickAfterEndOfLine": true,
"editor.tabSize": 2,
"diffEditor.ignoreTrimWhitespace": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"editor.fontLigatures": false,
"editor.fontVariations": false,
"i18n-lazyer.defaultFolder": "/src/locales",
"search.smartCase": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"css.validate": false,
"stylelint.enable": true,
"scss.validate": false,
"stylelint.validate": ["css", "scss", "vue"],
"preCI.localCodeCheck.filter.whitePath": "",
"preCI.localCodeCheck.filter.skipPath": "",
"preCI.localCodeCheck.checkerSet.JS": ["standard_js"],
"peacock.remoteColor": "#45e35f",
"bk-code-ai.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#65c89b",
"activityBar.background": "#65c89b",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#945bc4",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#65c89b",
"statusBar.background": "#42b883",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#359268",
"statusBarItem.remoteBackground": "#42b883",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#42b883",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#42b88399",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#42b883"
}
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
12 changes: 12 additions & 0 deletions dbm-ui/frontend/src/layout/components/ConfigManage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@
{{ t('单据协作设置') }}
</span>
</BkMenuItem>
<BkMenuItem
key="TicketNotice"
v-db-console="'bizConfigManage.ticketNotice'">
<template #icon>
<DbIcon type="db-config" />
</template>
<span
v-overflow-tips.right
class="text-overflow">
{{ t('单据通知') }}
</span>
</BkMenuItem>
</BkMenuGroup>
<BkMenuGroup :name="t('设置')">
<BkMenuItem
Expand Down
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1644,5 +1644,6 @@
"分片集群": "Sharded Cluster",
"主从管理": "HA Management",
"DB 重命名:database 重命名": "DB Rename:database rename",
"这行勿动!新增翻译请在上一行添加!": ""
"这行勿动!新增翻译请在上一行添加!": "",
"单据通知": ""
}
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import getTicketCooperationSettingRoutes from '@views/ticket-cooperation-setting
import getTicketFlowSettingBizRoutes from '@views/ticket-flow-setting-biz/routes';
import getTicketFlowSettingGlobalRoutes from '@views/ticket-flow-setting-global/routes';
import getTicketManageRoutes from '@views/ticket-manage/routes';
import getTicketNoticeRoutes from '@views/ticket-notice/routes';
import getTicketSelfApplyRoutes from '@views/ticket-self-apply/routes';
import getTicketSelfManageRoutes from '@views/ticket-self-manage/routes';
import getTicketSelfTodoRoutes from '@views/ticket-self-todo/routes';
Expand Down Expand Up @@ -129,6 +130,7 @@ export default () => {
...getTicketFlowSettingBizRoutes(),
...getTicketCooperationSettingRoutes(),
...getTicketFlowSettingGlobalRoutes(),
...getTicketNoticeRoutes(),
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,144 @@ interface ControllerItem<T extends string> extends ControllerBaseInfo {
children: Record<T, ControllerBaseInfo>;
}

export type ExtractedControllerDataKeys = Extract<keyof FunctionController, string>;
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.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 default class FunctionController {
addons: ControllerItem<AddonsFunctions>;
Expand Down Expand Up @@ -83,6 +220,7 @@ export default class FunctionController {
'bizConfigManage.StaffManage': ControllerItem<string>;
'bizConfigManage.ticketFlowSetting': ControllerItem<string>;
'bizConfigManage.ticketCooperationSetting': ControllerItem<string>;
'bizConfigManage.ticketNotice': ControllerItem<string>;
databaseManage: ControllerItem<string>;
'databaseManage.missionManage': ControllerItem<string>;
'databaseManage.whitelistManage': ControllerItem<string>;
Expand Down
78 changes: 78 additions & 0 deletions dbm-ui/frontend/src/views/ticket-notice/Index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
*
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
-->

<template>
<SmartAction
class="apply-doris-page"
:offset-target="getSmartActionOffsetTarget">
<BkTable :data="tableData">
<template
v-for="column in columns"
:key="column.label">
<BkTableColumn
:field="column.field"
:index="column.index"
:label="column.label"
:width="column.width" />
</template>
</BkTable>
<template #action>
<div>
<BkButton
class="w-88"
:loading="isSubmitting"
theme="primary"
@click="handleSubmit">
{{ t('提交') }}
</BkButton>
<BkButton
class="ml8 w-88"
:disabled="isSubmitting"
@click="handleReset">
{{ t('重置') }}
</BkButton>
</div>
</template>
</SmartAction>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n';

const { t } = useI18n();

const tableData = ref([]);
const isSubmitting = ref(false);

const columns = [
{ label: '序号', type: 'index', width: '120px', index: 0 },
{ label: '名称/内网IP', field: 'ip', width: '320px', index: 1 },
];

const getSmartActionOffsetTarget = () => document.querySelector('.bk-form-content');

const handleSubmit = () => {};

const handleReset = () => {};
</script>

<style lang="less" scoped>
.apply-doris-page {
display: block;

.db-card {
& ~ .db-card {
margin-top: 20px;
}
}
}
</style>
31 changes: 31 additions & 0 deletions dbm-ui/frontend/src/views/ticket-notice/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
*
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at https://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import { checkDbConsole } from '@utils';

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

const routes = [
{
name: 'TicketNotice',
path: 'ticket-notice',
meta: {
navName: t('单据通知'),
fullscreen: true,
},
component: () => import('@views/ticket-notice/Index.vue'),
},
];

export default function getRoutes() {
return checkDbConsole('bizConfigManage.ticketNotice') ? routes : [];
}

0 comments on commit 81255d1

Please sign in to comment.