aboutsummaryrefslogtreecommitdiffstats
path: root/resmgr/src
diff options
context:
space:
mode:
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>2017-02-17 11:18:27 +0530
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>2017-02-17 11:18:27 +0530
commit26bec51b43097aa27a975fc0206276e282d0b657 (patch)
treebd91e4d0b105c663c91fab216714c64a63467fe7 /resmgr/src
parentaff333a1e7a95a6d4d43a95d82129dc30a2ac78f (diff)
Resource Manager sdno port
Template file with the resmgr Port code. Issue-Id : SDNO-1202 Change-Id: Ifd0a9f49c472ebc6320cc400b3f2d4ff3d2936ad Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
Diffstat (limited to 'resmgr/src')
-rw-r--r--resmgr/src/main/webapp/sdn-resmgr/port/port.html133
-rw-r--r--resmgr/src/main/webapp/sdn-resmgr/port/portRest.js95
2 files changed, 228 insertions, 0 deletions
diff --git a/resmgr/src/main/webapp/sdn-resmgr/port/port.html b/resmgr/src/main/webapp/sdn-resmgr/port/port.html
new file mode 100644
index 00000000..741b4722
--- /dev/null
+++ b/resmgr/src/main/webapp/sdn-resmgr/port/port.html
@@ -0,0 +1,133 @@
+<!--/* Copyright 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.
+*/-->
+
+
+<h4>{{title}}</h4>
+
+<br><br>
+<div id="portAction" ng-init="init()">
+
+</div>
+<br>
+<br>
+
+<table ng-table="portTableParams" class="table table-bordered table-striped customtable" show-filter="true">
+ <tr ng-repeat="portData in $data">
+ <td header="'ng-table/headers/checkbox.html'">
+ <input type="checkbox" ng-model="checkboxes.items[portData.id]" />
+ </td>
+ <td title="'Name'" filter="{ name: 'text'}" sortable="'name'">
+ {{portData.name}}
+ </td>
+ <td title="'ME'" filter="{ me: 'number'}" sortable="'me'">
+ {{portData.me}}
+ </td>
+ <td title="'Type'" filter="{ type: 'text'}" sortable="'type'">
+ {{portData.type}}
+ </td>
+ <td title="'LayerRate'" filter="{ layerrate: 'text'}" sortable="'layerrate'">
+ {{portData.layerrate}}
+ </td>
+ <td title="'Edge Point'" filter="{ Edgepoint: 'text'}" sortable="'Edgepoint'">
+ {{portData.Edgepoint}}
+ </td>
+ <td title="'Port Index'" filter="{ portindex: 'text'}" sortable="'portindex'">
+ {{portData.portindex}}
+ </td>
+ <td title="'IP Address'" filter="{ ipaddress: 'number'}" sortable="'ipaddress'">
+ {{portData.ipaddress}}
+ </td>
+ <td title="'Admin State'" filter="{ adminState: 'text'}" sortable="'adminState'">
+ {{portData.adminState}}
+ </td>
+ <td title="'Operating State'" filter="{ operatingState: 'text'}" sortable="'operatingState'">
+ {{portData.operatingState}}
+ </td>
+ <td title="'Action'">
+ <span ng-click="editData(portData.id)" style="cursor: pointer;margin: 0 5px"> <img src="framework/images/edit.png" height="15" align="left"/></span>
+ <span ng-click="deleteData(portData.id)" style="cursor: pointer;margin: 0 5px"><img src="framework/images/delete.png" height="15" align="middle"/></span>
+
+ </td>
+ </tr>
+</table>
+
+
+<script type="text/ng-template" id="ng-table/headers/checkbox.html">
+ <input type="checkbox" ng-model="checkboxes.checked" name="filter-checkbox" value="" />
+</script>
+
+<div id="myTable"></div>
+
+
+
+
+<!-- Modal -->
+<div id="myModal" class="modal fade" role="dialog">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h5 class="modal-title">Modal Header</h5>
+ </div>
+ <form name="portForm" method="post">
+ <div class="modal-body">
+
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Name</label>
+ <div id="name" class="col-xs-8">
+ </div>
+ </div>
+
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">me</label>
+ <div id="me" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Type</label>
+ <div id="type" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Layer Rate</label>
+ <div id="layerrate" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Edge Point</label>
+ <div id="Edgepoint" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Port Index</label>
+ <div id="portindex" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Ip Address</label>
+ <div id="ipaddress" class="col-xs-8" >
+ </div>
+ </div>
+
+ <div id="footerBtns" class="modal-footer">
+ </div>
+ </form>
+ </div>
+
+
+ </div>
+</div> \ No newline at end of file
diff --git a/resmgr/src/main/webapp/sdn-resmgr/port/portRest.js b/resmgr/src/main/webapp/sdn-resmgr/port/portRest.js
new file mode 100644
index 00000000..c6c59d0b
--- /dev/null
+++ b/resmgr/src/main/webapp/sdn-resmgr/port/portRest.js
@@ -0,0 +1,95 @@
+/* Copyright 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.
+ */
+
+app.factory("portDataService", function($http,DataService, $log){
+ var uri = 'http://192.168.9.13:18008';
+ uri += "/openoapi/sdnobrs/v1/logical-termination-points";
+ return {
+ getAllPortData : function() {
+ /*console.log("hi in dataservice");
+ return $http({
+ url: 'http://localhost:3000/portAPI/getAllPortData',
+ method: 'GET',
+ data:null,
+ headers: {'Content-Type': 'application/json'}
+ }).then(function(response){
+ $log.info("in data service data is :"+response);
+ console.log(response.data);
+ return response.data;
+ });*/
+ return DataService.get(uri)
+ .then(function(response){
+ $log.info("in get data service data is :"+response);
+ console.log(response);
+ return response;
+ });
+ },
+ deletePortData : function(id) {
+ /*return $http({
+ url: 'http://localhost:3000/portAPI/deletePortData',
+ method: 'POST',
+ data: {'nameList':nameList},
+ headers: {'Content-Type': 'application/json'}
+ }).then(function(response){
+ console.log("Successfully Deleted..");
+ $log.info(response);
+ return response.data;
+ });*/
+ return DataService.delete(uri+"/"+id)
+ .then(function(response){
+ $log.info("in delete data service data is :"+response);
+ console.log(response);
+ return response;
+ });
+ },
+ editPortData : function(portData) {
+ /*return $http({
+ url: 'http://localhost:3000/siteAPI/editSiteData',
+ method: 'POST',
+ data: {'siteData':siteData},
+ headers: {'Content-Type': 'application/json'}
+ }).then(function(response){
+ console.log("Successfully edited.. Data returned in DataService is");
+ console.log(response.data);
+ return response.data;
+ });*/
+
+ return DataService.put(uri, portData)
+ .then(function(response){
+ console.log("Successfully edited.. Data returned in DataService is");
+ console.log(response);
+ return response;
+ });
+ },
+ addPortData : function(portData) {
+ /*return $http({
+ url: 'http://localhost:3000/siteAPI/addSiteData',
+ method: 'POST',
+ data: {'siteData':siteData},
+ headers: {'Content-Type': 'application/json'}
+ }).then(function(response){
+ console.log("Successfully edited.. Data returned in DataService is");
+ console.log(response.data);
+ return response.data;
+ });*/
+ return DataService.post(uri, portData)
+ .then(function(response){
+ console.log("Successfully added.. Data returned in DataService is");
+ console.log(response);
+ return response;
+ });
+ }
+ }
+}); \ No newline at end of file