diff --git a/dbm-ui/frontend/.vscode/settings.json b/dbm-ui/frontend/.vscode/settings.json index 1e37538ab6..69bce4736a 100644 --- a/dbm-ui/frontend/.vscode/settings.json +++ b/dbm-ui/frontend/.vscode/settings.json @@ -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" -} \ No newline at end of file + "editor.defaultFormatter": "esbenp.prettier-vscode" +} diff --git a/dbm-ui/frontend/src/locales/en.json b/dbm-ui/frontend/src/locales/en.json index ba68044f4a..615442193c 100644 --- a/dbm-ui/frontend/src/locales/en.json +++ b/dbm-ui/frontend/src/locales/en.json @@ -1644,5 +1644,6 @@ "分片集群": "Sharded Cluster", "主从管理": "HA Management", "DB 重命名:database 重命名": "DB Rename:database rename", - "这行勿动!新增翻译请在上一行添加!": "" + "这行勿动!新增翻译请在上一行添加!": "", + "待替换的主机重复": "" } diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index eaebbbbd9b..198c95bc79 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3931,5 +3931,6 @@ "请输入或选择主机": "请输入或选择主机", "目标主机输入格式有误": "目标主机输入格式有误", "含n个同机关联集群": "含 {n} 个同机关联集群", - "这行勿动!新增翻译请在上一行添加!": "" + "这行勿动!新增翻译请在上一行添加!": "", + "待替换的主机重复": "待替换的主机重复" } diff --git a/dbm-ui/frontend/src/services/model/redis/redis-machine.ts b/dbm-ui/frontend/src/services/model/redis/redis-machine.ts index 879505809a..7fb7996fb8 100644 --- a/dbm-ui/frontend/src/services/model/redis/redis-machine.ts +++ b/dbm-ui/frontend/src/services/model/redis/redis-machine.ts @@ -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() { diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/Index.vue new file mode 100644 index 0000000000..8ab1811d22 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/Index.vue @@ -0,0 +1,48 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/Index.vue new file mode 100644 index 0000000000..d3f8bed28a --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/Index.vue @@ -0,0 +1,603 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/Index.vue new file mode 100644 index 0000000000..7546105cbd --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/Index.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/RenderHost.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/RenderHost.vue new file mode 100644 index 0000000000..f6a2aa8a42 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/RenderHost.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/RenderSlaveHost.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/RenderSlaveHost.vue new file mode 100644 index 0000000000..c485b15ef0 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/RenderSlaveHost.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/Row.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/Row.vue new file mode 100644 index 0000000000..eaf043f8a1 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page1/components/Row.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page2/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page2/Index.vue new file mode 100644 index 0000000000..d5a20cff35 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_ADD_SLAVE/pages/page2/Index.vue @@ -0,0 +1,89 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/toolbox-field/edit-host/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/common/toolbox-field/edit-host/Index.vue new file mode 100644 index 0000000000..baf2412d89 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/common/toolbox-field/edit-host/Index.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/routes.ts b/dbm-ui/frontend/src/views/db-manage/redis/routes.ts index 51fc092d65..01541f2d95 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/routes.ts +++ b/dbm-ui/frontend/src/views/db-manage/redis/routes.ts @@ -17,10 +17,28 @@ import FunctionControllModel, { type RedisFunctions, } from '@services/model/function-controller/functionController'; +import { TicketTypes } from '@common/const'; + import { checkDbConsole } from '@utils'; import { t } from '@locales/index'; +const createRouteItem = ( + ticketType: TicketTypes, + meta: { + navName: string; + skeleton?: string; + }, +) => ({ + name: ticketType, + path: `${ticketType}/:page?`, + meta: { + fullscreen: true, + ...meta, + }, + component: () => import(`@views/db-manage/redis/${ticketType}/Index.vue`), +}); + const redisInstallModuleRoute = { name: 'RedisInstallModule', path: 'install-module/:page?', @@ -57,14 +75,17 @@ const redisProxyScaleDownRoute = { component: () => import('@views/db-manage/redis/proxy-scale-down/Index.vue'), }; -const redisDBCreateSlaveRoute = { - name: 'RedisDBCreateSlave', - path: 'db-create-slave/:page?', - meta: { - navName: t('重建从库'), - }, - component: () => import('@views/db-manage/redis/db-create-slave/Index.vue'), -}; +// const redisDBCreateSlaveRoute = { +// name: 'RedisDBCreateSlave', +// path: 'db-create-slave/:page?', +// meta: { +// navName: t('重建从库'), +// }, +// component: () => import('@views/db-manage/redis/db-create-slave/Index.vue'), +// }; +const redisDBCreateSlaveRoute = createRouteItem(TicketTypes.REDIS_CLUSTER_ADD_SLAVE, { + navName: t('重建从库'), +}); const redisMasterFailoverRoute = { name: 'RedisMasterFailover', diff --git a/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts b/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts index 70909211bb..73a51848b7 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts +++ b/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts @@ -11,6 +11,8 @@ * the specific language governing permissions and limitations under the License. */ +import { TicketTypes } from '@common/const'; + import { t } from '@locales/index'; export interface MenuItem { @@ -40,7 +42,7 @@ export default [ children: [ { name: t('重建从库'), - id: 'RedisDBCreateSlave', + id: TicketTypes.REDIS_CLUSTER_ADD_SLAVE, parentId: 'common-manage', dbConsoleValue: 'redis.toolbox.slaveRebuild', },