From 3867c43b1f6764fd1d3ef13df006136601727072 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jan 2025 16:35:55 +0900 Subject: [PATCH 1/2] Disabled VPC CIDR input in GCP --- .../admin-web/html/vpc-subnet.html | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html b/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html index c42303600..c31e0465d 100644 --- a/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html +++ b/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html @@ -1018,19 +1018,11 @@

System ID (Managed by CSP)

} function showOverlay() { - const region = '{{.RegionName}}'; const regionId = '{{.Region}}'; const defaultZone = '{{.Zone}}'; - const vpcNameInput = document.getElementById('vpcName'); - const subnetNameInput = document.getElementById('subnetName'); const zoneSelect = document.getElementById('subnetZone'); const connConfig = document.getElementById('connConfig').value; - vpcNameInput.value = `${region}-vpc-${Math.random().toString(36).substring(2, 5)}`; - document.getElementById('vpcCIDR').value = '10.0.0.0/16'; - subnetNameInput.value = `${region}-${defaultZone}-subnet-${Math.random().toString(36).substring(2, 5)}`; - document.getElementById('subnetCIDR').value = '10.0.1.0/24'; - fetch(`/spider/regionzone/${regionId}?ConnectionName=${connConfig}`) .then(response => response.json()) .then(data => { @@ -1075,12 +1067,16 @@

System ID (Managed by CSP)

const vpcNameInput = document.getElementById('vpcName'); const subnetNameInput = document.getElementById('subnetName'); const zoneInput = document.getElementById('subnetZone'); + const connConfig = document.getElementById('connConfig').value; + const vpcCIDRInput = document.getElementById('vpcCIDR'); + const subnetCIDRInput = document.getElementById('subnetCIDR'); vpcNameInput.value = `${region}-vpc-${Math.random().toString(36).substring(2, 5)}`; - document.getElementById('vpcCIDR').value = '10.0.0.0/16'; + vpcCIDRInput.value = '10.0.0.0/16'; + disableGCPCIDR(connConfig); zoneInput.value = zone; subnetNameInput.value = `${region}-${zone}-subnet-${Math.random().toString(36).substring(2, 5)}`; - document.getElementById('subnetCIDR').value = '10.0.1.0/24'; + subnetCIDRInput.value = '10.0.1.0/24'; document.querySelectorAll('.vpc-tag-input, .subnet-tag-input').forEach(tagInput => tagInput.remove()); } @@ -1761,5 +1757,16 @@

System ID (Managed by CSP)

selection.removeAllRanges(); } + function disableGCPCIDR(connConfig){ + // GCP일 경우 CIDR 입력란 비활성화 + const vpcCIDRInput = document.getElementById('vpcCIDR'); + if (connConfig.toLowerCase().includes('gcp')) { + vpcCIDRInput.disabled = true; + vpcCIDRInput.value = 'CIDR input is disabled for GCP.'; // 메시지를 입력란에 추가 + vpcCIDRInput.style.color = 'gray'; // 메시지 색상 변경 + vpcCIDRInput.style.backgroundColor = '#f0f0f0'; // 배경 색상 변경 + } + } + From e9b15a18e8198c613b76a50bf9a4337d1cb1dae5 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jan 2025 17:20:46 +0900 Subject: [PATCH 2/2] Disabled VPC CIDR Input in GCP with no comments and using provider --- .../rest-runtime/admin-web/html/vpc-subnet.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html b/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html index c31e0465d..12c61b251 100644 --- a/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html +++ b/api-runtime/rest-runtime/admin-web/html/vpc-subnet.html @@ -1757,14 +1757,14 @@

System ID (Managed by CSP)

selection.removeAllRanges(); } + // Disable VPC CIDR Input in GCP function disableGCPCIDR(connConfig){ - // GCP일 경우 CIDR 입력란 비활성화 const vpcCIDRInput = document.getElementById('vpcCIDR'); - if (connConfig.toLowerCase().includes('gcp')) { + if (currentProvider == 'GCP') { vpcCIDRInput.disabled = true; - vpcCIDRInput.value = 'CIDR input is disabled for GCP.'; // 메시지를 입력란에 추가 - vpcCIDRInput.style.color = 'gray'; // 메시지 색상 변경 - vpcCIDRInput.style.backgroundColor = '#f0f0f0'; // 배경 색상 변경 + vpcCIDRInput.value = 'NA'; + vpcCIDRInput.style.color = 'gray'; + vpcCIDRInput.style.backgroundColor = '#f0f0f0'; } }