Skip to content

Commit

Permalink
perf(frontend): redis工具箱重构_重建从库 TencentBlueKing#8840
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Dec 26, 2024
1 parent 2fb4b1d commit 308b4f3
Show file tree
Hide file tree
Showing 14 changed files with 1,363 additions and 68 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"
}
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",
"这行勿动!新增翻译请在上一行添加!": ""
"这行勿动!新增翻译请在上一行添加!": "",
"待替换的主机重复": ""
}
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3931,5 +3931,6 @@
"请输入或选择主机": "请输入或选择主机",
"目标主机输入格式有误": "目标主机输入格式有误",
"含n个同机关联集群": "含 {n} 个同机关联集群",
"这行勿动!新增翻译请在上一行添加!": ""
"这行勿动!新增翻译请在上一行添加!": "",
"待替换的主机重复": "待替换的主机重复"
}
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/services/model/redis/redis-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export default class RedisMachine {
}

get isSlaveFailover() {
return this.instance_role === 'redis_slave' && this.related_instances.some((item) => item.status === 'unavailable');
// return this.instance_role === 'redis_slave' && this.related_instances.some((item) => item.status === 'unavailable');
return true;
}

get isMasterFailover() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
* 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>
<Component :is="component" />
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';

import Page1 from './pages/page1/Index.vue';
import Page2 from './pages/page2/Index.vue';

const route = useRoute();

const comMap = {
ticket: Page1,
success: Page2,
};

const page = ref('');

const component = computed(() => {
if (comMap[page.value as keyof typeof comMap]) {
return comMap[page.value as keyof typeof comMap];
}
return Page1;
});

watch(
route,
() => {
page.value = route.params.page as string;
},
{
immediate: true,
},
);
</script>
Loading

0 comments on commit 308b4f3

Please sign in to comment.