Skip to content

Commit

Permalink
fix: 修复集群管理问题 (merge request !1619)
Browse files Browse the repository at this point in the history
Squash merge branch 'fix_cluster_mange' into 'master'
fix: 修复集群管理问题
  • Loading branch information
hitozhang committed Jan 26, 2024
1 parent 8270362 commit 2abd4d5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bcs-ui/frontend/src/i18n/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,7 @@ ca:
button:
createBandWidth: 新建带宽包
tips:
requiredBandwidthPackage: ca.tips.requiredBandwidthPackage
requiredBandwidthPackage: 带宽包必填
googleCloud:
button:
create: 新建凭证
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const props = defineProps({
default: () => ({}),
},
});
const emits = defineEmits(['change']);
const emits = defineEmits(['change', 'account-type-change']);
const internetAccess = ref<IInternetAccess>({
publicIPAssigned: false,
Expand All @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
</bk-form-item>

<bk-form-item :label="$t('tke.label.count')">
Expand Down Expand Up @@ -291,6 +292,7 @@ const initData = ref({
},
});
const instanceItem = ref(initData.value);
const accountType = ref<'STANDARD'|'LEGACY'>();
const rules = ref({
zone: [
{
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion bcs-ui/frontend/src/views/cluster-manage/use-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ export default function () {
const vpcLoading = ref(false);
const vpcList = ref<Array<IVpcItem>>($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,
Expand Down

0 comments on commit 2abd4d5

Please sign in to comment.