add validation check

Change-Id: I6d8a8193054d5679c3ca567c72305314d6c28d9c
This commit is contained in:
Xin 2016-03-14 15:52:17 -07:00
parent ebff7af4d0
commit e413a80d47
8 changed files with 41 additions and 40 deletions

View File

@ -1,4 +1,4 @@
<!--Copyright 2015 Cisco Systems, Inc. All rights reserved.--><!--Licensed under the Apache License, Version 2.0 (the "License"); you may--><!--not use this file except in compliance with the License. You may obtain--><!--a copy of the License at--><!--http://www.apache.org/licenses/LICENSE-2.0--><!--Unless required by applicable law or agreed to in writing, software--><!--distributed under the License is distributed on an "AS IS" BASIS, WITHOUT--><!--WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the--><!--License for the specific language governing permissions and limitations--><!--under the License.--><!doctype html> <html> <head> <meta charset="utf-8"> <title>KloudBuster</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel="stylesheet" href="styles/vendor.17ab9586.css"> <link rel="stylesheet" href="styles/main.553a3486.css"> </head> <body ng-app="kbWebApp"> <!--<img class="background" src="images/back.jpg">--> <!--[if lte IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your
experience.</p>
<![endif]--> <!-- Add your site or application content here --> <div class="header"> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <!--<img class="background" src="images/back.jpg">--> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#js-navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" ng-href="#/" style="font-family: Arial"> <span style="color:#DF314D">K</span>loudBuster <!--<img src="images/logo.jpg" alt="LOGO" height="50"/>--> </a> </div> <div class="collapse navbar-collapse" id="js-navbar-collapse"> <ul class="nav navbar-nav"> <li class="dropdown forHttp" id="scaletestnav"> <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <span id="scaletestname">Scale/Performance</span> <span class="caret">&nbsp;&nbsp;</span> </a> <ul class="dropdown-menu" role="menu"> <li class="" id="interactivenav"><a ng-href="#/InteractiveMode">Interactive Mode</a></li> <li class="divider"></li> <li class="" id="monitoringnav"><a ng-href="#/MonitoringMode">Monitoring Mode</a></li> </ul> </li> <li class="forStorage" id="storagemodenav"><a ng-href="#/StorageMode">Storage Mode</a></li> <li class="forStorage" id="storageconfignav"><a ng-href="#/StorageConfig">Configuration</a></li> <li class="forHttp" id="confignav"><a ng-href="#/Config">Configuration</a></li> <li class="" id="lognav"><a ng-href="#/Log">Log</a></li> <li class="" id="aboutnav"><a ng-href="#/About">About</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li id="loginnav"><a id="loginname" ng-href="#/Login">Log Out</a></li> </ul> </div> </div> </div> </div> <div class="container"> <div ng-view=""></div> </div> <!--<div class="footer">--> <!--<div class="container" style="text-align:center;">--> <!--&lt;!&ndash;<p><span class="glyphicon glyphicon-heart"></span>KloudBuster&ndash;&gt;--> <!--&lt;!&ndash;</p>&ndash;&gt;--> <!--</div>--> <!--</div>--> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID --> <!--<script>--> <!--!function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=l,A[l]=A[l]||function(){--> <!--(A[l].q=A[l].q||[]).push(arguments)},A[l].l=+new Date,a=n.createElement(g),--> <!--r=n.getElementsByTagName(g)[0],a.src=u,r.parentNode.insertBefore(a,r)--> <!--}(window,document,'script','https://www.google-analytics.com/analytics.js','ga');--> <!--ga('create', 'UA-XXXXX-X');--> <!--ga('send', 'pageview');--> <!--</script>--> <script src="scripts/vendor.3054de46.js"></script> <script src="scripts/scripts.5657ac49.js"></script> </body> </html>
<![endif]--> <!-- Add your site or application content here --> <div class="header"> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <!--<img class="background" src="images/back.jpg">--> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#js-navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" ng-href="#/" style="font-family: Arial"> <span style="color:#DF314D">K</span>loudBuster <!--<img src="images/logo.jpg" alt="LOGO" height="50"/>--> </a> </div> <div class="collapse navbar-collapse" id="js-navbar-collapse"> <ul class="nav navbar-nav"> <li class="dropdown forHttp" id="scaletestnav"> <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <span id="scaletestname">Scale/Performance</span> <span class="caret">&nbsp;&nbsp;</span> </a> <ul class="dropdown-menu" role="menu"> <li class="" id="interactivenav"><a ng-href="#/InteractiveMode">Interactive Mode</a></li> <li class="divider"></li> <li class="" id="monitoringnav"><a ng-href="#/MonitoringMode">Monitoring Mode</a></li> </ul> </li> <li class="forStorage" id="storagemodenav"><a ng-href="#/StorageMode">Storage Mode</a></li> <li class="forStorage" id="storageconfignav"><a ng-href="#/StorageConfig">Configuration</a></li> <li class="forHttp" id="confignav"><a ng-href="#/Config">Configuration</a></li> <li class="" id="lognav"><a ng-href="#/Log">Log</a></li> <li class="" id="aboutnav"><a ng-href="#/About">About</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li id="loginnav"><a id="loginname" ng-href="#/Login">Log Out</a></li> </ul> </div> </div> </div> </div> <div class="container"> <div ng-view=""></div> </div> <!--<div class="footer">--> <!--<div class="container" style="text-align:center;">--> <!--&lt;!&ndash;<p><span class="glyphicon glyphicon-heart"></span>KloudBuster&ndash;&gt;--> <!--&lt;!&ndash;</p>&ndash;&gt;--> <!--</div>--> <!--</div>--> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID --> <!--<script>--> <!--!function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=l,A[l]=A[l]||function(){--> <!--(A[l].q=A[l].q||[]).push(arguments)},A[l].l=+new Date,a=n.createElement(g),--> <!--r=n.getElementsByTagName(g)[0],a.src=u,r.parentNode.insertBefore(a,r)--> <!--}(window,document,'script','https://www.google-analytics.com/analytics.js','ga');--> <!--ga('create', 'UA-XXXXX-X');--> <!--ga('send', 'pageview');--> <!--</script>--> <script src="scripts/vendor.3054de46.js"></script> <script src="scripts/scripts.47b1cb37.js"></script> </body> </html>

View File

@ -443,42 +443,47 @@ angular.module('kbWebApp')
$scope.changeConfig = function() {
if($scope.status==="READY"|| $scope.status==="") {
kbCookie.setConfig($scope.config);
if ($scope.server.$valid == true && $scope.general.$valid == true && $scope.client.$valid == true) {
kbCookie.setConfig($scope.config);
if($scope.availability_zone==3) {
$scope.topology = {"servers_rack": [], "clients_rack": []};
for (var t in $scope.listC) {
$scope.topology.servers_rack.push($scope.listC[t].firstName);
if ($scope.availability_zone == 3) {
$scope.topology = {"servers_rack": [], "clients_rack": []};
for (var t in $scope.listC) {
$scope.topology.servers_rack.push($scope.listC[t].firstName);
}
for (var t in $scope.listB) {
$scope.topology.clients_rack.push($scope.listB[t].firstName);
}
kbCookie.setTopology($scope.topology);
//console.log($scope.topology);
}
for (var t in $scope.listB) {
$scope.topology.clients_rack.push($scope.listB[t].firstName);
else {
kbCookie.setTopology({"servers_rack": "", "clients_rack": ""});
}
kbCookie.setTopology($scope.topology);
//console.log($scope.topology);
$scope.chaCon = {"kb_cfg": {}, "topo_cfg": {}};
$scope.chaCon.kb_cfg = kbCookie.getConfig();
$scope.chaCon.topo_cfg = kbCookie.getTopology();
console.log($scope.chaCon);
kbHttp.putMethod("/config/running_config/" + $scope.sessionID, $scope.chaCon)
.then(
function (response) { // .resolve
console.log("change running config");
//showAlert.showAlert("Configuration updated successfully!");
},
function (response) { // .reject
//console.log("change running config error:");
//console.log(response);
showAlert.showAlert("Failed to update configuration!");
}
)
}
else{
kbCookie.setTopology({"servers_rack":"", "clients_rack": ""});
showAlert.showAlert("Please check your inputs!");
}
$scope.chaCon = {"kb_cfg": {},"topo_cfg":{}};
$scope.chaCon.kb_cfg = kbCookie.getConfig();
$scope.chaCon.topo_cfg = kbCookie.getTopology();
console.log($scope.chaCon);
kbHttp.putMethod("/config/running_config/" + $scope.sessionID, $scope.chaCon)
.then(
function (response) { // .resolve
console.log("change running config");
//showAlert.showAlert("Configuration updated successfully!");
},
function (response) { // .reject
//console.log("change running config error:");
//console.log(response);
showAlert.showAlert("Failed to update configuration!");
}
)
}
else{
//console.log("config not allow to change now!");

View File

@ -110,7 +110,7 @@ angular.module('kbWebApp')
$scope.setConfig = function(ifRun) {
var deferred = $q.defer();
if($scope.status==="READY") {
if ($scope.status === "READY") {
kbCookie.setConfig($scope.config);
$scope.chaCon = {"kb_cfg": {}};
$scope.chaCon.kb_cfg = kbCookie.getConfig();
@ -131,7 +131,7 @@ angular.module('kbWebApp')
if (ifRun != 1) {
if (response.status == 400)
showAlert.showAlert("Error while parsing configurations! Please check your inputs!");
else if(response.status == 403)
else if (response.status == 403)
showAlert.showAlert("Cannot update configuration if KloudBuster is busy or in error state");
else if (response.status == -1)
showAlert.showAlert("Error while connecting kloudbuster server!");

View File

@ -27,6 +27,7 @@
</div>
<br/>
<div class="row-fluid" id="stagingConfig2">
<div id="dashboard_links" class="col-md-3">
<ul class="nav nav-pills nav-stacked">

View File

@ -11,7 +11,6 @@
<!--WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the-->
<!--License for the specific language governing permissions and limitations-->
<!--under the License.-->
<div class="md-padding dialogdemoBasicUsage" id="popupContainer" ng-cloak=""></div>
<div class="row">

View File

@ -13,9 +13,7 @@
<!--under the License.-->
<!--<alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)" style="background-color:#ffcc99;color:white">{{alert.msg}}</alert>-->
<!--<h6></h6>-->
<div class="row">
<div class="col-md-8">
</div>
@ -52,8 +50,7 @@
<i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': !status1.open, 'glyphicon-chevron-up': status1.open}"></i>
</accordion-heading>
<div class="col-lg-14" id="stagingConfig">
<form class="bs-component" name="interactive_staging_settings">
<form class="bs-component" name="interactive_staging_settings" novalidate>
<md-content layout-padding style="padding:0">
<md-input-container class="col-md-12" style="padding-top:0">
<label>Tenants</label>

View File

@ -46,7 +46,6 @@
</div>
</div>
</div>
<div class="supercontainer">
<div class="container">
<div id="sidebar">