Skip to content

Commit

Permalink
Fix add subnet button bug in AdminWeb2
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed Aug 20, 2024
1 parent 33c2ec7 commit 5482cb0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api-runtime/rest-runtime/admin-web/html/vpc-subnet.html
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,21 @@ <h2>Add New Subnet</h2>
document.querySelectorAll('.vpc-tag-input, .subnet-tag-input').forEach(tagInput => tagInput.remove());
}

function showSubnetOverlay(vpcName) {
const region = '{{.RegionName}}';
const zone = '{{.Zone}}';

document.getElementById('subnetVPCName').value = vpcName;
document.getElementById('subnetVPCNameDisplay').value = vpcName;
document.getElementById('addSubnetZone').value = zone;
document.getElementById('addSubnetName').value = `${region}-${zone}-subnet-${Math.random().toString(36).substring(2, 5)}`;
document.getElementById('addSubnetCIDR').value = '10.0.2.0/24';

document.getElementById('subnet-overlay').style.display = 'flex';
document.addEventListener('keydown', handleEscSubnet);
clearSubnetFormFields();
}

function hideSubnetOverlay() {
document.getElementById('subnet-overlay').style.display = 'none';
document.removeEventListener('keydown', handleEscSubnet);
Expand Down

0 comments on commit 5482cb0

Please sign in to comment.