diff --git a/dbm-ui/frontend/src/components/cluster-selector/Index.vue b/dbm-ui/frontend/src/components/cluster-selector/Index.vue index f6dbe5ca12..7564a59318 100644 --- a/dbm-ui/frontend/src/components/cluster-selector/Index.vue +++ b/dbm-ui/frontend/src/components/cluster-selector/Index.vue @@ -128,25 +128,15 @@ setup lang="tsx" generic=" - T extends - | RedisModel - | TendbhaModel - | TendbclusterModel - | TendbsingleModel - | MongodbModel - | SqlServerHaModel - | SqlServerSingleModel + T extends { + id: number; + master_domain: string; + isOffline: boolean; + } "> import _ from 'lodash'; import { useI18n } from 'vue-i18n'; - import MongodbModel from '@services/model/mongodb/mongodb'; - import TendbhaModel from '@services/model/mysql/tendbha'; - import TendbsingleModel from '@services/model/mysql/tendbsingle'; - import RedisModel from '@services/model/redis/redis'; - import SqlServerHaModel from '@services/model/sqlserver/sqlserver-ha'; - import SqlServerSingleModel from '@services/model/sqlserver/sqlserver-single'; - import TendbclusterModel from '@services/model/tendbcluster/tendbcluster'; import { getMongoList } from '@services/source/mongodb'; import { getRedisList } from '@services/source/redis'; import { getHaClusterList } from '@services/source/sqlserveHaCluster'; diff --git a/dbm-ui/frontend/src/components/editable-table/Column.vue b/dbm-ui/frontend/src/components/editable-table/Column.vue index e85fd9fbb2..013024d774 100644 --- a/dbm-ui/frontend/src/components/editable-table/Column.vue +++ b/dbm-ui/frontend/src/components/editable-table/Column.vue @@ -164,7 +164,7 @@ required: true, validator: defaultValidator.required, message: `${label}不能为空`, - trigger: 'change', + trigger: 'blur', }); } if (props.email) { @@ -487,10 +487,7 @@ .bk-editable-table-field-cell { position: relative; - display: flex; height: 100%; - min-height: 40px; - align-items: center; } .bk-editable-table-column-error { diff --git a/dbm-ui/frontend/src/components/editable-table/Index.vue b/dbm-ui/frontend/src/components/editable-table/Index.vue index 959d60c138..18e44945f0 100644 --- a/dbm-ui/frontend/src/components/editable-table/Index.vue +++ b/dbm-ui/frontend/src/components/editable-table/Index.vue @@ -56,6 +56,7 @@ import Block from './edit/Block.vue'; import DatePicker from './edit/DatePicker.vue'; import Input from './edit/Input.vue'; + import Operate from './edit/Operate.vue'; import Select from './edit/Select.vue'; import TagInput from './edit/TagInput.vue'; import Textarea from './edit/Textarea.vue'; @@ -97,7 +98,7 @@ getColumnRelateRowIndexByInstance: (columnInstance: ComponentInternalInstance) => number; }> = Symbol.for('bk-editable-table'); - export { Block, Column, DatePicker, Input, Row, Select, TagInput, Textarea, TimePicker, useColumn }; + export { Block, Column, DatePicker, Input, Operate, Row, Select, TagInput, Textarea, TimePicker, useColumn }; diff --git a/dbm-ui/frontend/src/components/editable-table/types.ts b/dbm-ui/frontend/src/components/editable-table/types.ts index 34b65a81f3..627b8f6f9d 100644 --- a/dbm-ui/frontend/src/components/editable-table/types.ts +++ b/dbm-ui/frontend/src/components/editable-table/types.ts @@ -7,5 +7,5 @@ export interface IRule { pattern?: RegExp; validator?: (value: any) => Promise | boolean | string; message: (() => string) | string; - trigger: 'change' | 'blur'; + trigger: string; } diff --git a/dbm-ui/frontend/src/components/resource-host-owner/Index.vue b/dbm-ui/frontend/src/components/resource-host-owner/Index.vue index 2aa7905f2e..cef6b883fb 100644 --- a/dbm-ui/frontend/src/components/resource-host-owner/Index.vue +++ b/dbm-ui/frontend/src/components/resource-host-owner/Index.vue @@ -28,8 +28,8 @@ const { t } = useI18n(); - const isForBiz = computed(() => props.data.for_biz.bk_biz_id); - const isForDb = computed(() => props.data.resource_type && props.data.resource_type !== 'PUBLIC'); + const isForBiz = computed(() => props.data?.for_biz.bk_biz_id); + const isForDb = computed(() => props.data?.resource_type && props.data.resource_type !== 'PUBLIC'); diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue new file mode 100644 index 0000000000..4c9abe40ca --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue @@ -0,0 +1,217 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Index.vue new file mode 100644 index 0000000000..7d5a04e740 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Index.vue @@ -0,0 +1,32 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/components/RenderCluster.vue b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/components/RenderCluster.vue new file mode 100644 index 0000000000..7b435a4b46 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/components/RenderCluster.vue @@ -0,0 +1,182 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/components/RenderHost.vue b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/components/RenderHost.vue new file mode 100644 index 0000000000..4b2ec0b858 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/components/RenderHost.vue @@ -0,0 +1,119 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/routes.ts b/dbm-ui/frontend/src/views/db-manage/mysql/routes.ts index b485753e7a..f17a261339 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/routes.ts +++ b/dbm-ui/frontend/src/views/db-manage/mysql/routes.ts @@ -16,12 +16,22 @@ import type { RouteRecordRaw } from 'vue-router'; import type { MySQLFunctions } from '@services/model/function-controller/functionController'; import FunctionControllModel from '@services/model/function-controller/functionController'; -import { AccountTypes } from '@common/const'; +import { AccountTypes, TicketTypes } from '@common/const'; import { checkDbConsole } from '@utils'; import { t } from '@locales/index'; +const createRouteItem = (ticketType: TicketTypes, navName: string) => ({ + name: ticketType, + path: `${ticketType}/:page?`, + meta: { + navName, + fullscreen: true, + }, + component: () => import(`@views/db-manage/mysql/${ticketType}/Index.vue`), +}); + export const mysqlToolboxChildrenRouters: RouteRecordRaw[] = [ { name: 'MySQLExecute', @@ -63,14 +73,7 @@ export const mysqlToolboxChildrenRouters: RouteRecordRaw[] = [ }, component: () => import('@views/db-manage/mysql/slave-rebuild/index.vue'), }, - { - name: 'MySQLSlaveAdd', - path: 'slave-add/:page?', - meta: { - navName: t('添加从库'), - }, - component: () => import('@views/db-manage/mysql/slave-add/Index.vue'), - }, + createRouteItem(TicketTypes.MYSQL_ADD_SLAVE, t('添加从库')), { name: 'MySQLMasterSlaveClone', path: 'master-slave-clone/:page?', diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/toolbox-menu.ts b/dbm-ui/frontend/src/views/db-manage/mysql/toolbox-menu.ts index 0cc3d9fffe..8109b4c184 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/toolbox-menu.ts +++ b/dbm-ui/frontend/src/views/db-manage/mysql/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 MenuChild { @@ -110,7 +112,7 @@ export default [ }, { name: t('添加从库'), - id: 'MySQLSlaveAdd', + id: TicketTypes.MYSQL_ADD_SLAVE, parentId: 'migrate', dbConsoleValue: 'mysql.toolbox.slaveAdd', },