Skip to content

Commit

Permalink
fix button hiding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
knguyen100000010 committed Feb 21, 2024
1 parent 68c839b commit b472082
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions deploy-board/deploy_board/templates/groups/asg_policy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ aria-hidden="true">
var instanceWarmup = config["instanceWarmup"].trim()

if (/^-?\d+$/.test(minAdjustmentMagnitude) == false) {
alert("minAdjustmentMagnitude must be a positive integer or 0")
alert("minAdjustmentMagnitude must be >= 1")
return false
}

if (/^-?\d+$/.test(instanceWarmup) == false) {
if (/^-?\d+$/.test(instanceWarmup) == false && instanceWarmup.length != 0) {
alert("instanceWarmup must be a positive integer or 0")
return false
}
Expand All @@ -477,7 +477,7 @@ aria-hidden="true">
alert("minAdjustmentMagnitude must be greater than 0")
return false
}

instanceWarmup = parseInt(instanceWarmup)
if (instanceWarmup < 0) {
alert("instanceWarmup must be >= 0")
Expand Down Expand Up @@ -717,7 +717,7 @@ aria-hidden="true">
data-loading-text="Saving...">
<span class="glyphicon glyphicon-floppy-save"></span> Save
</button>
<button id="addTargetScalingBtnId" onclick="addTargetScaling(event)" class="btn btn-primary"
<button id="addTargetScalingBtnHomePageId" onclick="addTargetScaling(event)" class="btn btn-primary"
data-loading-text="Creating..."> Add
</button>
</div>
Expand All @@ -743,17 +743,18 @@ aria-hidden="true">

var asgAlarmElement = document.getElementById("asMetricsId")
var asgAlarmButtonElement = document.getElementById("resetAsMetricsBtnDivId")
var createTargetScalingButton = document.getElementById("addTargetScalingBtnId")
var createTargetScalingButton = document.getElementById("addTargetScalingBtnHomePageId")

if (policyType == "target-tracking-scaling") {
createTargetScalingButton.style.display = "block"
asgAlarmElement.style.display = "none"
asgAlarmButtonElement.style.display = "none"
}
else {
// careful when changing the order here
createTargetScalingButton.style.display = "none"
asgAlarmElement.style.display = "block"
asgAlarmButtonElement.style.display = "block"
createTargetScalingButton.style.display = "none"
}

evt.currentTarget.className += " button-gray";
Expand Down

0 comments on commit b472082

Please sign in to comment.