Skip to content

Commit

Permalink
fix(frontend): 修复mysql定点构造目标集群手写输入id为0问题 TencentBlueKing#8152
Browse files Browse the repository at this point in the history
  • Loading branch information
JustaCattt authored and iSecloud committed Nov 26, 2024
1 parent 2605013 commit fa397ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/types/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
import('vue')
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
message: t('目标集群不能为空'),
},
{
validator: (value: string) => value.split(',').every((domain) => domainRegex.test(domain)),
validator: (value: string) => domainRegex.test(value),
message: t('目标集群输入格式有误'),
},
{
Expand All @@ -110,6 +110,7 @@
bk_biz_id: window.PROJECT_CONFIG.BIZ_ID,
}).then((data) => {
if (data.length === list.length) {
localClusterId.value = data[0].id;
return true;
}
return false;
Expand All @@ -129,6 +130,7 @@
bk_biz_id: window.PROJECT_CONFIG.BIZ_ID,
}).then((data) => {
if (data) {
localClusterId.value = data[0].id;
localClusterDomain.value = data[0].master_domain;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
message: t('目标集群不能为空'),
},
{
validator: (value: string) => value.split(',').every((domain) => domainRegex.test(domain)),
validator: (value: string) => domainRegex.test(value),
message: t('目标集群输入格式有误'),
},
{
Expand All @@ -98,6 +98,7 @@
bk_biz_id: window.PROJECT_CONFIG.BIZ_ID,
}).then((data) => {
if (data.length === list.length) {
localClusterId.value = data[0].id;
return true;
}
return false;
Expand All @@ -112,6 +113,7 @@
cluster_ids: [id],
}).then((data) => {
if (data?.results.length > 0) {
localClusterId.value = data.results[0]?.id;
localClusterDomain.value = data.results[0]?.master_domain;
}
});
Expand Down

0 comments on commit fa397ec

Please sign in to comment.