From 2abd4d556b5c14418b2235945b97f31334379e05 Mon Sep 17 00:00:00 2001 From: hitozhang Date: Fri, 26 Jan 2024 12:02:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=9B=86=E7=BE=A4?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=97=AE=E9=A2=98=20(merge=20request=20!1619?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Squash merge branch 'fix_cluster_mange' into 'master' fix: 修复集群管理问题 --- bcs-ui/frontend/src/i18n/zh-CN.yaml | 2 +- .../src/views/cluster-manage/add/form/internet-access.vue | 5 ++++- .../cluster-manage/add/tencent/apply-node-config.vue | 8 ++++++-- bcs-ui/frontend/src/views/cluster-manage/use-cloud.ts | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bcs-ui/frontend/src/i18n/zh-CN.yaml b/bcs-ui/frontend/src/i18n/zh-CN.yaml index 62b0b82a86..1e3a28d1d8 100644 --- a/bcs-ui/frontend/src/i18n/zh-CN.yaml +++ b/bcs-ui/frontend/src/i18n/zh-CN.yaml @@ -2476,7 +2476,7 @@ ca: button: createBandWidth: 新建带宽包 tips: - requiredBandwidthPackage: ca.tips.requiredBandwidthPackage + requiredBandwidthPackage: 带宽包必填 googleCloud: button: create: 新建凭证 diff --git a/bcs-ui/frontend/src/views/cluster-manage/add/form/internet-access.vue b/bcs-ui/frontend/src/views/cluster-manage/add/form/internet-access.vue index ca3a935e2f..7ac9e612c5 100644 --- a/bcs-ui/frontend/src/views/cluster-manage/add/form/internet-access.vue +++ b/bcs-ui/frontend/src/views/cluster-manage/add/form/internet-access.vue @@ -110,7 +110,7 @@ const props = defineProps({ default: () => ({}), }, }); -const emits = defineEmits(['change']); +const emits = defineEmits(['change', 'account-type-change']); const internetAccess = ref({ publicIPAssigned: false, @@ -137,6 +137,9 @@ watch(internetAccess, () => { // 账户类型 const { accountType, getCloudAccountType, getCloudBwps } = useCloud(); +watch(accountType, () => { + emits('account-type-change', accountType.value); +}); // 免费分配公网IP watch(() => internetAccess.value.publicIPAssigned, (publicIPAssigned) => { diff --git a/bcs-ui/frontend/src/views/cluster-manage/add/tencent/apply-node-config.vue b/bcs-ui/frontend/src/views/cluster-manage/add/tencent/apply-node-config.vue index 892188ef4b..0b8268d594 100644 --- a/bcs-ui/frontend/src/views/cluster-manage/add/tencent/apply-node-config.vue +++ b/bcs-ui/frontend/src/views/cluster-manage/add/tencent/apply-node-config.vue @@ -170,7 +170,8 @@ :cloud-i-d="cloudID" :value="instanceItem.internetAccess" class="mb-[20px]" - @change="(v) => instanceItem.internetAccess = v" /> + @change="(v) => instanceItem.internetAccess = v" + @account-type-change="(v) => accountType = v" /> @@ -291,6 +292,7 @@ const initData = ref({ }, }); const instanceItem = ref(initData.value); +const accountType = ref<'STANDARD'|'LEGACY'>(); const rules = ref({ zone: [ { @@ -326,7 +328,9 @@ const rules = ref({ trigger: 'custom', message: $i18n.t('ca.tips.requiredBandwidthPackage'), validator() { - if (instanceItem.value.internetAccess.internetChargeType === 'BANDWIDTH_PACKAGE') { + if (instanceItem.value.internetAccess.publicIPAssigned + && instanceItem.value.internetAccess.internetChargeType === 'BANDWIDTH_PACKAGE' + && accountType.value === 'STANDARD') { return !!instanceItem.value.internetAccess.bandwidthPackageId; } return true; diff --git a/bcs-ui/frontend/src/views/cluster-manage/use-cloud.ts b/bcs-ui/frontend/src/views/cluster-manage/use-cloud.ts index 2ad6126b3e..c05602e07a 100644 --- a/bcs-ui/frontend/src/views/cluster-manage/use-cloud.ts +++ b/bcs-ui/frontend/src/views/cluster-manage/use-cloud.ts @@ -160,7 +160,8 @@ export default function () { const vpcLoading = ref(false); const vpcList = ref>($store.state.cloudMetadata.vpcList); const handleGetVPCList = async ({ region, cloudAccountID, cloudID }) => { - if (!region || !cloudAccountID || !cloudID) return; + // gcpCloud 不支持vpc获取 + if (!region || !cloudAccountID || !cloudID || cloudID === 'gcpCloud') return; vpcLoading.value = true; vpcList.value = await cloudVPC({ $cloudId: cloudID,