From 68fdc7631612f13e8247bc811ee706bc6a9f600e Mon Sep 17 00:00:00 2001 From: Seshu-Kumar-M Date: Wed, 19 Apr 2017 19:28:39 +0800 Subject: SDN COntroller and BRS issues IssueId: CLIENT-197 Change-Id: I049af87e53ed6171f5c316785ec5a7a5012b9daa Signed-off-by: Seshu-Kumar-M --- .../extsys/sdncontroller/bak/controller.html | 20 +- .../main/webapp/extsys/sdncontroller/css/style.css | 33 +++ .../main/webapp/extsys/sdncontroller/index.html | 5 +- .../src/main/webapp/extsys/sdncontroller/js/app.js | 104 +++++++--- .../main/webapp/extsys/sdncontroller/js/rest.js | 2 +- .../extsys/sdncontroller/templates/controller.html | 1 + .../sdncontroller/templates/templateContainer.html | 79 ++++++++ .../templates/templateFunctional.html | 82 ++++++++ .../templates/templateNotification.html | 48 +++++ .../sdncontroller/templates/templateWidget.html | 222 +++++++++++++++++++++ 10 files changed, 552 insertions(+), 44 deletions(-) create mode 100644 extsys/src/main/webapp/extsys/sdncontroller/css/style.css create mode 100644 extsys/src/main/webapp/extsys/sdncontroller/templates/templateContainer.html create mode 100644 extsys/src/main/webapp/extsys/sdncontroller/templates/templateFunctional.html create mode 100644 extsys/src/main/webapp/extsys/sdncontroller/templates/templateNotification.html create mode 100644 extsys/src/main/webapp/extsys/sdncontroller/templates/templateWidget.html (limited to 'extsys') diff --git a/extsys/src/main/webapp/extsys/sdncontroller/bak/controller.html b/extsys/src/main/webapp/extsys/sdncontroller/bak/controller.html index 144a9bec..5397e6e0 100644 --- a/extsys/src/main/webapp/extsys/sdncontroller/bak/controller.html +++ b/extsys/src/main/webapp/extsys/sdncontroller/bak/controller.html @@ -22,17 +22,17 @@ - - - - - - - - + + + + + + + + + - + - + \ No newline at end of file diff --git a/extsys/src/main/webapp/extsys/sdncontroller/js/app.js b/extsys/src/main/webapp/extsys/sdncontroller/js/app.js index c6f601c2..25fb256b 100644 --- a/extsys/src/main/webapp/extsys/sdncontroller/js/app.js +++ b/extsys/src/main/webapp/extsys/sdncontroller/js/app.js @@ -27,6 +27,12 @@ var app = angular.module("ControllerApp", ["ui.router", "ngTable"]) } }); })*/ + .run(function($rootScope, $location, $state, $stateParams) { + $rootScope.$on('$viewContentLoaded', function() { + //call it here + loadTemplate(); + }); + }) .config(function($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvider) { //$routeProvider.caseInsensitiveMatch = true; $urlMatcherFactoryProvider.caseInsensitive(true); @@ -54,8 +60,8 @@ var app = angular.module("ControllerApp", ["ui.router", "ngTable"]) $log.info(data); loadButtons(); }, function (reason) { - $scope.message = "Error is :" + JSON.stringify(reason); + loadButtons(); }); } @@ -63,27 +69,13 @@ var app = angular.module("ControllerApp", ["ui.router", "ngTable"]) var def_button_tpl = $(modelTemplate).filter('#defaultButtons').html(); var def_iconbutton_tpl = $(modelTemplate).filter('#defaultIconButtons').html(); var dialog = $(modelTemplate).filter('#dialog').html(); - var add_data = {"title":"Create", "type":"btn btn-default", "gType": "plus-icon", "iconPosition":"left", "clickAction":"showAddModal()"}; + var add_data = {"title":"Create", "type":"btn btn-default", "gType": "plus-icon", "iconPosition":"left", "clickAction":"showAddModal()"}; // var delete_data = {"title":"Delete Selected", "type":"btn btn-default", "gType": "delete-icon", "iconPosition":"left", "clickAction":"deleteData()"}; var addhtml = Mustache.to_html(def_iconbutton_tpl, add_data); //var deletehtml = Mustache.to_html(def_iconbutton_tpl, delete_data); $('#extsysAction').html($compile(addhtml)($scope)); //$('#extsysAction').append($compile(deletehtml)($scope)); - $scope.checkboxes = { 'checked': false, items: {} }; - - //var data = [{id: 1, name: "Moroni", age: 50}, {id: 2, name: "ABC", age: 30}, {id: 3, name: "Morhoni", age: 10}, {id: 4, name: "DABC", age: 31}, {id: 5, name: "Noor", age: 30}, {id: 6, name: "ABCD", age: 40}, {id: 7, name: "DABC", age: 31}, {id: 8, name: "Noor", age: 30}, {id: 9, name: "ABCD", age: 40}, {id: 10, name: "DABC", age: 31}, {id: 11, name: "Noor", age: 30}, {id: 12, name: "ABCD", age: 40}]; - $scope.controllerTableParams = 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.controllerData}); - - /*$scope.$watch('checkboxes.checked', function(value) { - angular.forEach($scope.data.controllerData, function(item) { - console.log("#######"+item.id); - if (angular.isDefined(item.id)) { - $scope.checkboxes.items[item.id] = value; - } - }); - });*/ var modelSubmit_data = {"title":"OK", "clickAction":"saveData(ext.id)"}; var modelSubmit_html = Mustache.to_html(def_button_tpl, modelSubmit_data); @@ -120,29 +112,33 @@ var app = angular.module("ControllerApp", ["ui.router", "ngTable"]) /*var extProtocol = {"ErrMsg" : {"textboxErr" : "Protocol is required.", "modalVar":"ext.protocol"}}; $('#myModal #protocol').append($compile(Mustache.to_html(text, extProtocol.ErrMsg))($scope));*/ - var dropdowndata_protocol = { + /*var dropdowndata_protocol = { "modalVar" : "ext.Protocol", "labelField" : "itemLabel", - "optionsValue" : JSON.stringify($scope.data.dropdownProtocolData.item) + "optionsValue" : JSON.stringify($scope.data ? $scope.data.dropdownProtocolData.item : "") }; - console.log("dropdown data:"+$scope.data.dropdownProtocolData.item); + //console.log("dropdown data:"+$scope.data.dropdownProtocolData.item); + + $('#myModal #protocol').append($compile(Mustache.to_html(dropDown, dropdowndata_protocol))($scope));*/ - $('#myModal #protocol').append($compile(Mustache.to_html(dropDown, dropdowndata_protocol))($scope)); + var dropdownResponse=[{"id":"netconf","name":"netconf"},{"id":"snmp","name":"snmp"}]; + var dropdownInfo = translateToDropdownInfo(dropdownResponse); + $('#myModal #protocolDD').html(dropdownInfo); var extProductName = {"ErrMsg" : {"textboxErr" : "ProductName is required.", "modalVar":"ext.productName"}}; $('#myModal #ProductName').append($compile(Mustache.to_html(text, extProductName.ErrMsg))($scope)); - /*var extType = {"ErrMsg" : {"textboxErr" : "Type is required.", "modalVar":"ext.type"}}; - $('#myModal #type').append($compile(Mustache.to_html(text, extType.ErrMsg))($scope));*/ + var extType = {"ErrMsg" : {"textboxErr" : "Type is required.", "modalVar":"ext.type"}}; + $('#myModal #type').append($compile(Mustache.to_html(text, extType.ErrMsg))($scope)); - var dropdowndata_type = { + /*var dropdowndata_type = { "modalVar" : "ext.Type", "labelField" : "itemLabel", - "optionsValue" : JSON.stringify($scope.data.dropdownTypeData.item) + "optionsValue" : JSON.stringify($scope.data?$scope.data.dropdownTypeData.item:"") }; - $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropdowndata_type))($scope)); + $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropdowndata_type))($scope));*/ @@ -156,6 +152,20 @@ var app = angular.module("ControllerApp", ["ui.router", "ngTable"]) var extOperation = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"ext.operation", "placeholder":"Hard Disk"}}; $('#myModal #Operation').append($compile(Mustache.to_html(text, extOperation.ErrMsg))($scope));*/ + $scope.checkboxes = { 'checked': false, items: {} }; + + //var data = [{id: 1, name: "Moroni", age: 50}, {id: 2, name: "ABC", age: 30}, {id: 3, name: "Morhoni", age: 10}, {id: 4, name: "DABC", age: 31}, {id: 5, name: "Noor", age: 30}, {id: 6, name: "ABCD", age: 40}, {id: 7, name: "DABC", age: 31}, {id: 8, name: "Noor", age: 30}, {id: 9, name: "ABCD", age: 40}, {id: 10, name: "DABC", age: 31}, {id: 11, name: "Noor", age: 30}, {id: 12, name: "ABCD", age: 40}]; + $scope.controllerTableParams = 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.controllerData}); + + /*$scope.$watch('checkboxes.checked', function(value) { + angular.forEach($scope.data.controllerData, function(item) { + console.log("#######"+item.id); + if (angular.isDefined(item.id)) { + $scope.checkboxes.items[item.id] = value; + } + }); + });*/ } @@ -199,6 +209,17 @@ var app = angular.module("ControllerApp", ["ui.router", "ngTable"]) $state.reload(); } + function translateToDropdownInfo(dropdowndata) { + var options = ''; + var i; + for (i = 0; i < dropdowndata.length; i += 1) { + var option = ''; + options = options + option; + } + + return options; + } /*$scope.checkAll = function () { @@ -335,22 +356,43 @@ function loadTemplate() { }); }*/ -var modelTemplate = ""; +/*var modelTemplate = ""; function loadTemplate() { - $.get('framework/template.html', function (template) { + *//*$.get('/openoui/framework/template.html', function (template) { + modelTemplate += template; + });*//* + $.get('/openoui/framework/templateContainer.html', function (template) { + modelTemplate += template; + }); + $.get('/openoui/framework/templateWidget.html', function (template) { + //console.log("Template is : "+template); + modelTemplate += template; + }); + $.get('/openoui/framework/templateNotification.html', function (template) { + modelTemplate += template; + }); + $.get('/openoui/framework/templateFunctional.html', function (template) { modelTemplate += template; }); - $.get('framework/templateContainer.html', function (template) { +}*/ + +var modelTemplate = ""; +function loadTemplate() { + + /*$.get('/openoui/resmgr/templates/template.html', function (template) { + modelTemplate += template; + });*/ + $.get('/openoui/extsys/sdncontroller/templates/templateContainer.html', function (template) { modelTemplate += template; }); - $.get('framework/templateWidget.html', function (template) { + $.get('/openoui/extsys/sdncontroller/templates/templateWidget.html', function (template) { //console.log("Template is : "+template); modelTemplate += template; }); - $.get('framework/templateNotification.html', function (template) { + $.get('/openoui/extsys/sdncontroller/templates/templateNotification.html', function (template) { modelTemplate += template; }); - $.get('framework/templateFunctional.html', function (template) { + $.get('/openoui/extsys/sdncontroller/templates/templateFunctional.html', function (template) { modelTemplate += template; }); } diff --git a/extsys/src/main/webapp/extsys/sdncontroller/js/rest.js b/extsys/src/main/webapp/extsys/sdncontroller/js/rest.js index 47b94c64..1279c424 100644 --- a/extsys/src/main/webapp/extsys/sdncontroller/js/rest.js +++ b/extsys/src/main/webapp/extsys/sdncontroller/js/rest.js @@ -18,7 +18,7 @@ app.factory("controllerDataService", function($http, DataService, $log){ - var uri = 'http://192.168.9.13:18008'; + var uri = ''; return { getControllerData : function() { /*return $http({ diff --git a/extsys/src/main/webapp/extsys/sdncontroller/templates/controller.html b/extsys/src/main/webapp/extsys/sdncontroller/templates/controller.html index faa336d1..3e914d0e 100644 --- a/extsys/src/main/webapp/extsys/sdncontroller/templates/controller.html +++ b/extsys/src/main/webapp/extsys/sdncontroller/templates/controller.html @@ -130,6 +130,7 @@
+
diff --git a/extsys/src/main/webapp/extsys/sdncontroller/templates/templateContainer.html b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateContainer.html new file mode 100644 index 00000000..ef6f01c6 --- /dev/null +++ b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateContainer.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/extsys/src/main/webapp/extsys/sdncontroller/templates/templateFunctional.html b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateFunctional.html new file mode 100644 index 00000000..ff2f53f0 --- /dev/null +++ b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateFunctional.html @@ -0,0 +1,82 @@ + + + + + + \ No newline at end of file diff --git a/extsys/src/main/webapp/extsys/sdncontroller/templates/templateNotification.html b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateNotification.html new file mode 100644 index 00000000..97f26e37 --- /dev/null +++ b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateNotification.html @@ -0,0 +1,48 @@ + + + + \ No newline at end of file diff --git a/extsys/src/main/webapp/extsys/sdncontroller/templates/templateWidget.html b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateWidget.html new file mode 100644 index 00000000..bb8eef48 --- /dev/null +++ b/extsys/src/main/webapp/extsys/sdncontroller/templates/templateWidget.html @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg