aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseshukm <seshu.kumar.m@huawei.com>2017-03-30 21:36:53 +0530
committerseshukm <seshu.kumar.m@huawei.com>2017-03-30 21:36:53 +0530
commitdd4cd17a7b61dfc4ae5d0c761bebdba476493204 (patch)
treea6613258d1950ea0f24088f47c3ae4f678d0bbab
parent1e7e41c2d219ed29c2a0fb56ca0879c2aab4c9ae (diff)
GUI Integration issue fix
Fix the issue of right container spacing for different pages. IssueId: CLIENT-189 Change-Id: I92819028ce4f4a485c1e67ebff53d77305a18caa Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
-rw-r--r--resmgr/src/main/webapp/resmgr/js/app.js30
-rw-r--r--resmgr/src/main/webapp/resmgr/sdn-resmgr/site/site.html9
-rw-r--r--resmgr/src/main/webapp/resmgr/templates/templateWidget_old.html226
3 files changed, 22 insertions, 243 deletions
diff --git a/resmgr/src/main/webapp/resmgr/js/app.js b/resmgr/src/main/webapp/resmgr/js/app.js
index b27d7846..f6cd34fd 100644
--- a/resmgr/src/main/webapp/resmgr/js/app.js
+++ b/resmgr/src/main/webapp/resmgr/js/app.js
@@ -362,7 +362,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
$scope.init = function() {
siteDataService.getAllSiteData()
.then(function (data) {
- $scope.data = data;
+ $scope.data = data.sites;
console.log("Data: ");
$log.info(data);
loadButtons();
@@ -390,10 +390,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
$scope.siteTableParams = new NgTableParams({count: 5, sorting: {name: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'}
- }, { counts:[5, 10, 20, 50], dataset: $scope.data.siteData});
+ }, { counts:[5, 10, 20, 50], dataset: $scope.data});
$scope.$watch('checkboxes.checked', function(value) {
- angular.forEach($scope.data.siteData, function(item) {
+ angular.forEach($scope.data, function(item) {
console.log(item.id);
if (angular.isDefined(item.id)) {
$scope.checkboxes.items[item.id] = value;
@@ -422,19 +422,23 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
var siteName = {"ErrMsg" : {"errmsg" : "Name is required.", "modalVar":"site.name", "errtag":"textboxErrName", "errfunc":"validatetextboxName", "required":true}};
$('#myModal #name').append($compile(Mustache.to_html(text, siteName.ErrMsg))($scope));
- var dropSimple_data = {
+//TODO check for the dropdown if possible based on static Site types
+ /*var dropSimple_data = {
"modalVar" : "site.type",
"labelField" : "itemLabel",
- "optionsValue" : $scope.data ? JSON.stringify($scope.data.dropdownsiteData.item): ""
+ "optionsValue" : "$scope.data ? JSON.stringify($scope.data.dropdownsiteData.item)"
};
- $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));
+ $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/
- var siteTenantName = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"site.tenatname"}};
- $('#myModal #tenantname').append($compile(Mustache.to_html(text, siteTenantName.ErrMsg))($scope));
+ var siteType = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"site.type"}};
+ $('#myModal #type').append($compile(Mustache.to_html(text, siteType.ErrMsg))($scope));
- var siteTenantType = {"ErrMsg" : {"errmsg" : "The tenanttype is required.", "modalVar":"site.tenanttype"}};
- $('#myModal #tenanttype').append($compile(Mustache.to_html(text, siteTenantType.ErrMsg))($scope));
+ var siteTenantName = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"site.tenantID"}};
+ $('#myModal #tenantID').append($compile(Mustache.to_html(text, siteTenantName.ErrMsg))($scope));
+
+ /*var siteTenantType = {"ErrMsg" : {"errmsg" : "The tenanttype is required.", "modalVar":"site.tenanttype"}};
+ $('#myModal #tenanttype').append($compile(Mustache.to_html(text, siteTenantType.ErrMsg))($scope));*/
var siteLocation = {"ErrMsg" : {"errmsg" : "Location is required.", "modalVar":"site.location", "placeholder":"Location"}};
$('#myModal #location').append($compile(Mustache.to_html(text, siteLocation.ErrMsg))($scope));
@@ -464,8 +468,8 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
$scope.showAddModal = function() {
console.log("Showing Modal to Add data");
$scope.site = {};
- //$("#myModal").modal();
- $("#myModal").modal({}).draggable();
+ $("#myModal").modal();
+ //$("#myModal").modal({}).draggable();
$scope.textboxErrName = false;
}
$scope.saveData = function(id) {
@@ -557,7 +561,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
$scope.editData = function(id) {
console.log("To be edited : " + id);
var dataFound = false;
- angular.forEach($scope.data.siteData, function(data) {
+ angular.forEach($scope.data, function(data) {
if(!dataFound) {
if (data.id == id) {
console.log("Found : " + data.name);
diff --git a/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/site.html b/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/site.html
index c6f2039d..3d9da037 100644
--- a/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/site.html
+++ b/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/site.html
@@ -34,13 +34,14 @@
<td title="'Type'" filter="{ type: 'text'}" sortable="'type'">
{{siteData.type}}
</td>
- <td title="'Tenant Name'" filter="{ tenantName: 'text'}" sortable="'tenantName'">
- {{siteData.tenantName}}
+ <td title="'Tenant Name'" filter="{ tenantID: 'text'}" sortable="'tenantID'">
+ {{siteData.tenantID}}
</td>
</td>
- <td title="'Tenant Type'" filter="{ tenantType: 'text'}" sortable="'tenantType'">
+ <!-- TODO check if tenant type is required in future-->
+ <!-- <td title="'Tenant Type'" filter="{ tenantType: 'text'}" sortable="'tenantType'">
{{siteData.tenantType}}
- </td>
+ </td>-->
<td title="'Location'" filter="{ location: 'text'}" sortable="'location'">
{{siteData.location}}
</td>
diff --git a/resmgr/src/main/webapp/resmgr/templates/templateWidget_old.html b/resmgr/src/main/webapp/resmgr/templates/templateWidget_old.html
deleted file mode 100644
index fb2528db..00000000
--- a/resmgr/src/main/webapp/resmgr/templates/templateWidget_old.html
+++ /dev/null
@@ -1,226 +0,0 @@
-<!--
-
- Copyright 2016-2017, Huawei Technologies Co., Ltd.
-
- 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.
-
--->
-
-<!-- Default Buttons <button class="btnDefault" ng-click="{{clickAction}}">{{title}}</button>-->
-<script id="defaultButtons" type="text/html">
- <input type="button" class="btnDefault btnmrg" ng-click="{{clickAction}}" value="{{title}}"/>
-</script>
-
-<script id="defaultIconButtons" type="text/html">
- <button id="iconBtn" type="button" class="btnDefault btnmrg {{type}}" ng-click="{{clickAction}}">{{title}}
- <span class="glyphicon {{gType}} pull-{{iconPosition}}"></span>
- </button>
-</script>
-
-<!-- Visual Buttons -->
-<script id="visualButtons" type="text/html">
- <button type="button" class="btn btn-{{type}}">{{title}}</button>
-</script>
-
-<!-- Different sized Buttons -->
-<script id="sizeButtons" type="text/html">
- <button type="button" class="btn btn-{{type}} {{size}}">{{title}}</button>
-</script>
-
-<!-- Icon Buttons -->
-<script id="iconButtons" type="text/html">
- <button type="button" class="btn btn-{{type}}">{{title}}
- <span class="glyphicon {{gType}}"></span>
- </button>
-</script>
-
-<!--Dropdown template-->
-<script id="dropDown" type="text/html">
- <div class="drop{{position}}">
- <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{{title}}
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu">
- {{#items}}<li><a href="#">{{itemLabel}}</a></li>{{/items}}
- </ul>
- </div>
-</script>
-
-<script id="dropDownHeader" type="text/html">
- <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{{title}}
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu">
- {{#items}}
- {{#isheader}}<li class="divider"></li><li class="dropdown-header">{{itemLabel}}</li><li class="divider"></li>{{/isheader}}
- {{^isheader}}<li><a href="#">{{itemLabel}}</a></li>{{/isheader}}
- {{/items}}
- </ul>
-</script>
-
-<script id="simpleDropdownTmpl" type="text/html">
- <div class="dropdownplain">
- <ul class="nav navbar-nav">
- <li>
- <a class="dropdown-toggle" data-toggle="dropdown">{{title}} <span class="glyphicon glyphicon-chevron-down pull-right"></span></a>
- <ul class="dropdown-menu">
- {{#items}}<li><a target="_blank">{{itemLabel}}</a></li>{{/items}}
- </ul>
- </li>
- </ul>
- </div>
-</script>
-
-
-<!--Radio Buttons-->
-<script id="radioButtons" type="text/html">
- <div>
- <input class="magic-radio" type="radio" name="radio" id="radio{{id}}"/>
- <label for="radio{{id}}">{{label}}</label></br>
- </div>
-</script>
-
-<!--Check boxes template-->
-<script id="checkBoxes" type="text/html">
- <div class="funkyradio-{{type}}">
- <input type="checkbox" name="check" id="checkbox{{id}}" {{#checked}}checked{{/checked}} />
- <label for="checkbox{{id}}">{{label}}</label>
- </div>
-</script>
-
-<!--text-->
-<script id="textfield" type="text/html">
- <div class="css-form">
- <input id ="textbox" name="textbox" class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="text" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}> {{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--email-->
-<script id="email" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="email" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--url-->
-<script id="url" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="url" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--password-->
-<script id="password" type="text/html">
- <div class="css-form">
-
-
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="password" pattern=".{3,}" maxlength="{{#maxLength}}{{maxLength}}{{/maxLength}}{{^maxLength}}9{{/maxLength}}" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--numeric-->
-<script id="numeric" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="number" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}/>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--dot-->
-<script id="dot" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="datetime-local" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--date-->
-<script id="dateinput" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="date" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--Month-->
-<script id="monthinput" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="month" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-
-<!--Week-->
-<script id="weekinput" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="week" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--time-->
-<script id="timeinput" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="time" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--ipv4-->
-<script id="ipv4" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" type="ipv4" placeholder="{{placeholder}}" ng-model="{{modalVar}}" pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--ipv6-->
-<script id="ipv6" type="text/html">
- <div class="css-form">
- <input class="form-control inputfield" placeholder="{{placeholder}}" ng-model="{{modalVar}}" type="ipv6" pattern="^([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--textarea-->
-<script id="textarea" type="text/html">
- <div class="css-form">
- <textarea class="form-control inputfield" rows="4" cols="50" placeholder="{{placeholder}}" ng-model="{{modalVar}}" ng-blur="{{errfunc}}({{modalVar}})" {{#required}}required{{/required}}></textarea>{{#required}}<span class="staricon">*</span>{{/required}}
- <span class="errMsg" ng-show="{{errtag}}">{{errmsg}}</span>
- </div>
-</script>
-
-<!--note-->
-<script id="note" type="text/html">
-
- <a id="noteanchor" href="#/home/textarea" title="Note" data-toggle="popover" data-trigger="focus" data-placement="{{placement}}">
- <span class="glyphicon glyphicon-info-sign "></span></a>
-</script>
-
-<!-- list -->
-<script id="list" type="text/html">
-
- {{#items}}
-
- <div>
- <button type="button" class="btn btn-primary btn-block" ng-click="loadSubMenuPage('{{id}}', '{{level}}', '{{row}}')">{{title}}</button>
- </div>
-
- {{/items}}
-
-</script>