Skip to content

Commit

Permalink
feat(frontend): mysql proxy替换重构 #7006
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 19998
  • Loading branch information
JustaCattt authored and jinquantianxia committed Oct 9, 2024
1 parent fcd8de7 commit 5163b89
Show file tree
Hide file tree
Showing 25 changed files with 2,359 additions and 840 deletions.
80 changes: 74 additions & 6 deletions dbm-ui/frontend/src/components/instance-selector/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,44 @@
bk_cloud_name: string;
bk_host_id: number;
cluster_id: number;
cluster_name: string;
cluster_name?: string;
cluster_type: string;
create_at: string;
db_module_id: number;
db_module_name: string;
host_info: any;
id: number;
name: string;
instance_address: string;
instance_role: string;
ip: string;
port: number;
instance_address: string;
status?: string;
host_info?: any;
machine_type: string;
master_domain: string;
related_instances?: {
instance: string;
related_clusters: {
id: number;
name: string;
master_domain: string;
immute_domain: string;
cluster_type: string;
}[];
related_instances: {
cluster_id: number;
ip: string;
name: string;
phase: string;
port: number;
status: string;
instance: string;
bk_biz_id: number;
bk_cloud_id: number;
bk_host_id: number;
bk_instance_id: number;
admin_port: number;
}[];
spec_config?: TendbclusterMachineModel['spec_config'];
spec_id?: number;
role: string;
}

Expand Down Expand Up @@ -201,7 +223,7 @@
getSqlServerInstanceList as getSqlServerSingleInstanceList,
} from '@services/source/sqlserverSingleCluster';
import { getTendbclusterInstanceList, getTendbclusterMachineList } from '@services/source/tendbcluster';
import { getTendbhaInstanceList } from '@services/source/tendbha';
import { getTendbhaInstanceList, getTendbhaMachineList } from '@services/source/tendbha';
import { getTendbsingleInstanceList } from '@services/source/tendbsingle';

import { ClusterTypes } from '@common/const';
Expand All @@ -217,6 +239,7 @@
import SqlServerContent from './components/sqlserver/Index.vue';
import TendbClusterContent from './components/tendb-cluster/Index.vue';
import TendbClusterHostContent from './components/tendb-cluster-host/Index.vue';
import TendbhaHostContent from './components/tendb-ha-host/Index.vue';

export type TableSetting = ReturnType<typeof getSettings>;

Expand Down Expand Up @@ -511,6 +534,51 @@
content: ManualInputContent,
},
],
TendbhaHost: [
{
id: 'TendbhaHost',
name: t('主库主机'),
topoConfig: {
getTopoList: getMysqlClusterList,
},
tableConfig: {
getTableList: getTendbhaMachineList,
firsrColumn: {
label: t('主库主机'),
field: 'ip',
role: 'master',
},
columnsChecked: ['ip', 'related_instances', 'cloud_area', 'alive', 'host_name', 'os_name'],
},
previewConfig: {
displayKey: 'ip',
},
content: TendbhaHostContent,
},
{
id: 'manualInput',
name: t('手动输入'),
tableConfig: {
getTableList: getTendbhaMachineList,
firsrColumn: {
label: t('主库主机'),
field: 'ip',
role: 'master',
},
columnsChecked: ['ip', 'related_instances', 'cloud_area', 'alive', 'host_name', 'os_name'],
},
manualConfig: {
checkInstances: getTendbhaMachineList,
checkType: 'ip',
checkKey: 'ip',
activePanelId: 'TendbhaHost',
},
previewConfig: {
displayKey: 'ip',
},
content: ManualInputHostContent,
},
],
TendbClusterHost: [
{
id: 'TendbClusterHost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<span>{{ item.instance }}</span>
</div>
<BkButton
v-if="data.length >= 3"
v-if="data.length > 3"
class="ml-20"
text
theme="primary"
Expand Down Expand Up @@ -59,8 +59,8 @@
}
.show-all-icon {
font-size: 16px;
margin-left: 2px;
font-size: 16px;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
cluster_type: data.cluster_type,
db_module_id: data.db_module_id,
db_module_name: data.db_module_name,
master_domain: data.master_domain,
master_domain: data.master_domain || '',
related_clusters: data.related_clusters || [],
role: data.role
});

Expand Down
Loading

0 comments on commit 5163b89

Please sign in to comment.