Updated Branches: refs/heads/autoscale 0ad5838b4 -> e5fa68903
CS-15885: cloudstack 3.0 UI - autoscale - add UI-side validation - at least one condition is required in Scale Up/Down Policy. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e5fa6890 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e5fa6890 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e5fa6890 Branch: refs/heads/autoscale Commit: e5fa6890330061ac984b3ead930b483c67108378 Parents: 0ad5838 Author: Jessica Wang <[email protected]> Authored: Wed Aug 8 16:44:49 2012 -0700 Committer: Jessica Wang <[email protected]> Committed: Wed Aug 8 16:46:47 2012 -0700 ---------------------------------------------------------------------- ui/scripts/autoscaler.js | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e5fa6890/ui/scripts/autoscaler.js ---------------------------------------------------------------------- diff --git a/ui/scripts/autoscaler.js b/ui/scripts/autoscaler.js index 54a1646..42e5829 100644 --- a/ui/scripts/autoscaler.js +++ b/ui/scripts/autoscaler.js @@ -799,14 +799,33 @@ } } + //Scale Up Policy + if(args.data.scaleUpDuration == null || args.data.scaleUpDuration.length == 0) { + args.response.error("Duration of Scale Up Policy is required."); + return; + } if(args.data.scaleUpDuration < args.data.interval) { args.response.error("Duration of Scale Up Policy can not be less than Polling Interval."); return; + } + if(scaleUpData.length == 0) { + args.response.error("At least one condition is required in Scale Up Policy."); + return; + } + + //Scale Down Policy + if(args.data.scaleDownDuration == null || args.data.scaleDownDuration.length == 0) { + args.response.error("Duration of Scale Down Policy is required."); + return; } if(args.data.scaleDownDuration < args.data.interval) { args.response.error("Duration of Scale Down Policy can not be less than Polling Interval."); return; - } + } + if(scaleDownData.length == 0) { + args.response.error("At least one condition is required in Scale Down Policy."); + return; + } //validation (end) ***** var scaleVmProfileResponse = [];
