From 7b74b110925a4fc9672a73abba8c79c21f101a4b Mon Sep 17 00:00:00 2001 From: Lorand Jakab Date: Thu, 29 Mar 2018 00:00:12 +0300 Subject: [PATCH] Remove the user interface feature DLUX is no longer maintained and will be archived, so remove the user interface feature to get rid of the dependency. This is required for becoming a Managed Project, since lispflowmapping can only depend on other Managed Projects, and DLUX didn't request to become managed. See https://lists.opendaylight.org/pipermail/release/2018-March/014520.html Change-Id: Ib89bdd3f8444515487ad1ac154a46ab7608e05d9 Signed-off-by: Lorand Jakab --- artifacts/pom.xml | 12 - commons/parent/pom.xml | 2 - features/features-lispflowmapping/pom.xml | 7 - features/odl-lispflowmapping-ui/pom.xml | 62 -- features/pom.xml | 1 - pom.xml | 1 - ui/bundle/pom.xml | 74 -- .../OSGI-INF/blueprint/blueprint.xml | 14 - ui/module/pom.xml | 17 - .../lispui/assets/data/locale-en_US.json | 67 -- .../resources/lispui/keys/key.create.tpl.html | 13 - .../resources/lispui/keys/key.get.tpl.html | 13 - .../resources/lispui/keys/key.table.tpl.html | 48 -- .../main/resources/lispui/keys/key.tpl.html | 6 - .../lispui/keys/lispui.key.controller.js | 49 -- .../resources/lispui/lispui.controller.js | 9 - .../main/resources/lispui/lispui.module.js | 124 ---- .../main/resources/lispui/lispui.services.js | 678 ------------------ .../src/main/resources/lispui/lispui.tpl.html | 16 - .../mappings/lispui.mapping.controller.js | 49 -- .../lispui/mappings/mapping.create.tpl.html | 13 - .../lispui/mappings/mapping.get.tpl.html | 13 - .../lispui/mappings/mapping.table.tpl.html | 50 -- .../lispui/mappings/mapping.tpl.html | 6 - .../src/main/resources/lispui/root.tpl.html | 11 - ui/pom.xml | 23 - 26 files changed, 1378 deletions(-) delete mode 100644 features/odl-lispflowmapping-ui/pom.xml delete mode 100644 ui/bundle/pom.xml delete mode 100644 ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 ui/module/pom.xml delete mode 100644 ui/module/src/main/resources/lispui/assets/data/locale-en_US.json delete mode 100644 ui/module/src/main/resources/lispui/keys/key.create.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/keys/key.get.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/keys/key.table.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/keys/key.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/keys/lispui.key.controller.js delete mode 100644 ui/module/src/main/resources/lispui/lispui.controller.js delete mode 100644 ui/module/src/main/resources/lispui/lispui.module.js delete mode 100644 ui/module/src/main/resources/lispui/lispui.services.js delete mode 100644 ui/module/src/main/resources/lispui/lispui.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/mappings/lispui.mapping.controller.js delete mode 100644 ui/module/src/main/resources/lispui/mappings/mapping.create.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/mappings/mapping.get.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/mappings/mapping.table.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/mappings/mapping.tpl.html delete mode 100644 ui/module/src/main/resources/lispui/root.tpl.html delete mode 100644 ui/pom.xml diff --git a/artifacts/pom.xml b/artifacts/pom.xml index f52903219..d1076edfd 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -71,11 +71,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mappingservice.lisp-proto ${project.version} - - ${project.groupId} - lispflowmapping-ui-bundle - ${project.version} - ${project.groupId} mappingservice.config @@ -139,13 +134,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html features xml - - ${project.groupId} - odl-lispflowmapping-ui - ${project.version} - features - xml - diff --git a/commons/parent/pom.xml b/commons/parent/pom.xml index 5e90526a2..79e77e052 100644 --- a/commons/parent/pom.xml +++ b/commons/parent/pom.xml @@ -31,8 +31,6 @@ 2.0.2 1.0.0 0.9.0-SNAPSHOT - 0.8.0-SNAPSHOT - 0.8.0-SNAPSHOT 0.5.0 1.8.0-SNAPSHOT 1.8.0-SNAPSHOT diff --git a/features/features-lispflowmapping/pom.xml b/features/features-lispflowmapping/pom.xml index fccf7ff91..1aef79902 100644 --- a/features/features-lispflowmapping/pom.xml +++ b/features/features-lispflowmapping/pom.xml @@ -74,12 +74,5 @@ and is available at http://www.eclipse.org/legal/epl-v10.html xml features - - ${project.groupId} - odl-lispflowmapping-ui - ${project.version} - xml - features - diff --git a/features/odl-lispflowmapping-ui/pom.xml b/features/odl-lispflowmapping-ui/pom.xml deleted file mode 100644 index 4bc99f463..000000000 --- a/features/odl-lispflowmapping-ui/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - 4.0.0 - - - org.opendaylight.odlparent - single-feature-parent - 3.0.2 - - - - org.opendaylight.lispflowmapping - odl-lispflowmapping-ui - 1.8.0-SNAPSHOT - feature - - ODL :: lispflowmapping :: ${project.artifactId} - - - - org.opendaylight.dlux - odl-dlux-core - 0.8.0-SNAPSHOT - xml - features - - - org.opendaylight.dluxapps - odl-dluxapps-yangutils - 0.8.0-SNAPSHOT - xml - features - - - org.opendaylight.dluxapps - odl-dluxapps-yangui - 0.8.0-SNAPSHOT - xml - features - - - ${project.groupId} - odl-lispflowmapping-mappingservice - ${project.version} - xml - features - - - ${project.groupId} - lispflowmapping-ui-bundle - ${project.version} - - - diff --git a/features/pom.xml b/features/pom.xml index fdc384731..920313e05 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -32,7 +32,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html odl-lispflowmapping-msmr odl-lispflowmapping-mappingservice-shell odl-lispflowmapping-neutron - odl-lispflowmapping-ui features-lispflowmapping diff --git a/pom.xml b/pom.xml index 9d690e0b7..1199376f0 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,6 @@ commons/unittest_tools artifacts mappingservice - ui features lispflowmapping-karaf - ODL :: lispflowmapping :: ${project.artifactId} - - - - org.opendaylight.dlux - loader - ${dlux.loader.version} - - - org.opendaylight.lispflowmapping - lispflowmapping-ui-module - ${project.version} - provided - - - - - - - target/generated-resources - - - src/main/resources - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - unpack-loader-resources - - unpack - - generate-resources - - - - org.opendaylight.lispflowmapping - lispflowmapping-ui-module - ${lispflowmapping.version} - true - ${project.build.directory}/generated-resources - - - META-INF\/** - false - - - - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 993f0702a..000000000 --- a/ui/bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/ui/module/pom.xml b/ui/module/pom.xml deleted file mode 100644 index 549c292f1..000000000 --- a/ui/module/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - 4.0.0 - - org.opendaylight.lispflowmapping - lispflowmapping-ui - 1.8.0-SNAPSHOT - - - lispflowmapping-ui-module - jar - - ODL :: lispflowmapping :: ${project.artifactId} - - diff --git a/ui/module/src/main/resources/lispui/assets/data/locale-en_US.json b/ui/module/src/main/resources/lispui/assets/data/locale-en_US.json deleted file mode 100644 index 17baf3aaf..000000000 --- a/ui/module/src/main/resources/lispui/assets/data/locale-en_US.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "LISP_KEYS": "Keys", - "LISP_ADD_KEY": "Add Key", - "LISP_GET_KEY": "Get Key", - "LISP_EDIT_KEY": "Edit Key", - - "LISP_MAPPINGS": "Mappings", - "LISP_ADD_MAPPING": "Add Mapping", - "LISP_GET_MAPPING": "Get Mapping", - "LISP_EDIT_MAPPING": "Edit Mapping", - - "LISP_TOPOLOGY": "View Topology", - - "LOADING_NODE": "Loading...", - "LOADING_ERROR": "Error at loading", - "LOADING_SUCCESS": "Load Success", - "ADD_KEY_ERROR": "Error Adding Key", - "ADD_KEY_SUCCESS": "Key Added", - "GET_KEY_ERROR": "Error Getting Key", - "GET_KEY_SUCCESS": "Get Key Complete", - "ADD_MAPPING_ERROR": "Error Adding Mapping", - "ADD_MAPPING_SUCCESS": "Mapping Added", - "GET_MAPPING_ERROR": "Error Getting Mapping", - "GET_MAPPING_SUCCESS": "Get Mapping Complete", - - "REFRESH_TABLE": "Refresh Table", - - "IID": "IID", - "EID": "EID", - "KEY_TYPE": "Key Type", - "AUTH_KEY": "Authkey", - "ACTIONS": "Actions", - "FLAGS": "Flags", - "TTL": "P/W/MP/MW", - "NO_KEY": "No Keys on Database", - "NUM_LOCATORS": "# Locators", - "LOCATOR_RECORD": "Locator Record", - "NO_MAPPINGS": "No Mappings on Database", - "EDIT": "Edit", - "VIEW": "View", - "DELETE": "Delete", - "ASK_DELETE_KEY": "Are you sure you want to delete this key?", - "ASK_DELETE_MAPPING": "Are you sure you want to delete this mapping?", - "YES": "Yes", - "NO": "No", - - "BACK": "Back", - "HIDE": "hide", - "SHOW": "show", - "LIST_SHOW_ALL": "show all", - "HIDE_SHOW_ALL": "hide all", - "YANGUI_LIST_LABEL": "list", - "LEAF_LIST_ADD_ELEM": "add leaf list element", - "LIST_ADD_ELEM": "add list item", - "SHOW_HIDE_LIST": "show / hide list", - "LIST_SHOW_ALL": "show all list items", - "LIST_DELETE_ITEM": "delete list item", - "LIST_INDEX_DUPLICATE": "duplicated index", - "LIST_PREV_ITEM": "show previous item", - "LIST_NEXT_ITEM": "show next item", - "SHOW_HIDE_CON": "show / hide container", - "SHOW_HIDE_ELEM": "show / hide element", - "LIST_ADD_ITEM": "add item", - "LIST_DELETE_ITEM": "delete item", - "NOT_VALID_VALUE": "value is not valid" - -} diff --git a/ui/module/src/main/resources/lispui/keys/key.create.tpl.html b/ui/module/src/main/resources/lispui/keys/key.create.tpl.html deleted file mode 100644 index e935360a4..000000000 --- a/ui/module/src/main/resources/lispui/keys/key.create.tpl.html +++ /dev/null @@ -1,13 +0,0 @@ -
-

{{ 'LISP_ADD_KEY' | translate }}

- {{ 'BACK' | translate }} -
-
-
- - - - {{ status.msg | translate }} - {{ status.rawMsg ? (' - ' + status.rawMsg) : '' }} - -
diff --git a/ui/module/src/main/resources/lispui/keys/key.get.tpl.html b/ui/module/src/main/resources/lispui/keys/key.get.tpl.html deleted file mode 100644 index 1ed075e20..000000000 --- a/ui/module/src/main/resources/lispui/keys/key.get.tpl.html +++ /dev/null @@ -1,13 +0,0 @@ -
-

{{ 'LISP_GET_KEY' | translate }}

- {{ 'BACK' | translate }} -
-
-
- - - - {{ status.msg | translate }} - {{ status.rawMsg ? (' - ' + status.rawMsg) : '' }} - -
diff --git a/ui/module/src/main/resources/lispui/keys/key.table.tpl.html b/ui/module/src/main/resources/lispui/keys/key.table.tpl.html deleted file mode 100644 index 7c0940b37..000000000 --- a/ui/module/src/main/resources/lispui/keys/key.table.tpl.html +++ /dev/null @@ -1,48 +0,0 @@ -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ 'VNI' | translate }}{{ 'EID' | translate }}{{ 'KEY_TYPE' | translate }}{{ 'AUTH_KEY' | translate }}{{ 'ACTIONS' | translate }}
{{ 'NO_KEY' | translate }}
{{ key.vni }}{{ key['eid-uri'] }}{{ key['mapping-authkey']['key-type'] | number }}{{ key['mapping-authkey']['key-string'] }} {{ 'VIEW' | translate }} | - {{ 'DELETE' | translate }} -
-
-
-

{{ 'ASK_DELETE_KEY' | translate }}

- - -
- -
diff --git a/ui/module/src/main/resources/lispui/keys/key.tpl.html b/ui/module/src/main/resources/lispui/keys/key.tpl.html deleted file mode 100644 index 9a08414b3..000000000 --- a/ui/module/src/main/resources/lispui/keys/key.tpl.html +++ /dev/null @@ -1,6 +0,0 @@ -
-

{{ 'LISP_KEYS' | translate }}

- {{ 'LISP_ADD_KEY' | translate }} - {{ 'LISP_GET_KEY' | translate }} -
-
diff --git a/ui/module/src/main/resources/lispui/keys/lispui.key.controller.js b/ui/module/src/main/resources/lispui/keys/lispui.key.controller.js deleted file mode 100644 index 2314d4314..000000000 --- a/ui/module/src/main/resources/lispui/keys/lispui.key.controller.js +++ /dev/null @@ -1,49 +0,0 @@ -define(['app/lispui/lispui.module', 'app/lispui/lispui.services'], function(lispui) { - - lispui.register.controller('KeysLispuiCtrl', ['$scope', 'LispuiDashboardSvc', 'LispuiNodeFormSvc', 'LispuiUtils', - function($scope, LispuiDashboardSvc, LispuiNodeFormSvc, LispuiUtils) { - $scope.data=[]; - - var loadTable = function () { - $scope.data=[]; - LispuiDashboardSvc.getKeys().then(function (keys) { - $scope.data = keys; - }) - }; - - var deleteKey = function (key) { - var postKey = LispuiDashboardSvc.getDeleteKey(key); - LispuiDashboardSvc.postDeleteKey().post('', postKey).then(function (success) { - $scope.loadTable(); - }) - } - - $scope.loadTable = loadTable; - $scope.expandSingleRow = LispuiDashboardSvc.expandSingleRow; - $scope.deleteKey = deleteKey; - loadTable(); - }]); - - lispui.register.controller('KeysCreateLispuiCtrl',['$scope', 'LispuiNodeFormSvc', - function($scope, LispuiNodeFormSvc) { - LispuiNodeFormSvc.initValues($scope); - LispuiNodeFormSvc.loadNode("add-key", $scope); - - $scope.getNodeName = LispuiNodeFormSvc.getNodeName; - $scope.buildRoot = LispuiNodeFormSvc.buildRoot($scope); - $scope.executeOperation = LispuiNodeFormSvc.executeOperation($scope); - - }]); - - lispui.register.controller('KeysGetLispuiCtrl',['$scope', 'LispuiNodeFormSvc', - function($scope, LispuiNodeFormSvc) { - LispuiNodeFormSvc.initValues($scope); - LispuiNodeFormSvc.loadNode("get-key", $scope); - - $scope.getNodeName = LispuiNodeFormSvc.getNodeName; - $scope.buildRoot = LispuiNodeFormSvc.buildRoot($scope); - $scope.executeOperation = LispuiNodeFormSvc.executeOperation($scope); - - }]); - -}); diff --git a/ui/module/src/main/resources/lispui/lispui.controller.js b/ui/module/src/main/resources/lispui/lispui.controller.js deleted file mode 100644 index 50d39d190..000000000 --- a/ui/module/src/main/resources/lispui/lispui.controller.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['app/lispui/lispui.module', 'app/lispui/lispui.services'], function(lispui) { - - lispui.register.controller('RootLispuiCtrl', function($scope) { - }); - - lispui.register.controller('VisualizeLispuiCtrl', function($scope, $rootScope) { - - }) -}); diff --git a/ui/module/src/main/resources/lispui/lispui.module.js b/ui/module/src/main/resources/lispui/lispui.module.js deleted file mode 100644 index e020fefbb..000000000 --- a/ui/module/src/main/resources/lispui/lispui.module.js +++ /dev/null @@ -1,124 +0,0 @@ -define(['angularAMD', - 'app/routingConfig', - 'angular-ui-router', - 'app/core/core.services', - 'common/yangutils/yangutils.module' -], function() { - - var lispui = angular.module('app.lispui', ['ui.router.state', - 'app.core', 'app.common.yangUtils', 'restangular' - ]); - - lispui.config(function($stateProvider, $controllerProvider, - $compileProvider, $provide, $translateProvider, $urlRouterProvider, - NavHelperProvider) { - - $urlRouterProvider.otherwise('/lispui/keys'); - - $translateProvider.useStaticFilesLoader({ - prefix: '/src/app/lispui/assets/data/locale-', - suffix: '.json' - }); - - lispui.register = { - controller: $controllerProvider.register, - directive: $compileProvider.directive, - service: $provide.service, - factory: $provide.factory - }; - - var access = routingConfig.accessLevels; - $stateProvider.state('main.lispui', { - url: 'lispui', - abstract: true, - views: { - 'content': { - templateUrl: '/src/app/lispui/root.tpl.html', - controller: 'RootLispuiCtrl' - } - } - }); - - $stateProvider.state('main.lispui.keys', { - url: '/keys', - views: { - 'lispui': { - templateUrl: '/src/app/lispui/keys/key.tpl.html', - controller: 'KeysLispuiCtrl' - } - } - }); - - $stateProvider.state('main.lispui.keys-create', { - url: '/keys-create', - views: { - 'lispui': { - templateUrl: '/src/app/lispui/keys/key.create.tpl.html', - controller: 'KeysCreateLispuiCtrl' - } - } - }); - - $stateProvider.state('main.lispui.keys-get', { - url: '/keys-get', - views: { - 'lispui': { - templateUrl: '/src/app/lispui/keys/key.get.tpl.html', - controller: 'KeysGetLispuiCtrl' - } - } - }); - - $stateProvider.state('main.lispui.mappings', { - url: '/mappings', - views: { - 'lispui': { - templateUrl: '/src/app/lispui/mappings/mapping.tpl.html', - controller: 'MappingsLispuiCtrl' - } - } - }); - - $stateProvider.state('main.lispui.mappings-create', { - url: '/mappings-create', - views: { - 'lispui': { - templateUrl: '/src/app/lispui/mappings/mapping.create.tpl.html', - controller: 'MappingsCreateLispuiCtrl' - } - } - }); - - $stateProvider.state('main.lispui.mappings-get', { - url: '/mappings-get', - views: { - 'lispui': { - templateUrl: '/src/app/lispui/mappings/mapping.get.tpl.html', - controller: 'MappingsGetLispuiCtrl' - } - } - }); - - NavHelperProvider.addToMenu('lispui', { - "link": "#/lispui/keys", - "title": "LISP UI", - "active": "main.lispui", - "icon": "icon-sitemap", - "page": { - "title": "LISP UI", - "description": "LISP UI" - } - }); - - NavHelperProvider.addControllerUrl( - 'app/lispui/lispui.controller'); - NavHelperProvider.addControllerUrl( - 'app/lispui/keys/lispui.key.controller'); - NavHelperProvider.addControllerUrl( - 'app/lispui/mappings/lispui.mapping.controller' - ); - - }); - - return lispui; -}); diff --git a/ui/module/src/main/resources/lispui/lispui.services.js b/ui/module/src/main/resources/lispui/lispui.services.js deleted file mode 100644 index d5db79c32..000000000 --- a/ui/module/src/main/resources/lispui/lispui.services.js +++ /dev/null @@ -1,678 +0,0 @@ -define(['app/lispui/lispui.module'], function(lispui) { - - lispui.register.factory('LispuiNodeFormSvc', ['$filter', - '$location', 'ApiBuilderService', 'constants', - 'EventDispatcherService', 'LispuiUtils', 'NodeWrapperService', - 'RequestBuilderService', 'SyncService', 'YangUiApisService', 'YangUtilsService', - 'YangUtilsRestangularService', - function($filter, $location, ApiBuilderService, constants, - EventDispatcherService, LispuiUtils, NodeWrapperService, - RequestBuilderService, SyncService, YangUiApisService, YangUtilsService, - YangUtilsRestangularService) { - var api = {}; - - api.initValues = function(scope) { - scope.currentPath = 'src/app/yangui/views/'; - scope.apiType = ''; - scope.node = null; - scope.selApi = null; - scope.selSubApi = null; - scope.filterRootNode = null; - scope.selectedOperation = null; - return scope; - }; - - ////////// Snippet originally from yangui.controller.js ////////// - // It has been changed to get only the node desired passed as an input of the function [type] - api.loadNode = function(type, scope) { - - loadingCallback(scope, ''); - YangUtilsService.generateNodesToApis(function(apis, - allNodes) { - scope.apis = apis; - scope.allNodes = allNodes; - console.info('got data', scope.apis, - allNodes); - scope.treeApis = YangUtilsService.generateApiTreeData( - apis); - console.info('tree api', scope.treeApis); - - // Select the api 'odl-mappingservice' - var numApis = scope.apis.length; - for (i = 0; i < numApis; i++) - if (scope.apis[i].module == - "odl-mappingservice") - scope.selApi = scope.apis[ - i]; - console.info('selApi:', scope.selApi); - - if (!scope.selApi) { - errorLoadingCallback(scope, - 'Error loading node' - ); - return null; - } - - // Select the subapi 'type' pass as an argument - var numSubApis = scope.selApi.subApis - .length; - for (j = 0; j < numSubApis; j++) - if (scope.selApi.subApis[j] - .node.label == type) - scope.selSubApi = scope - .selApi.subApis[j]; - console.info('selSubApi:', - scope.selSubApi); - - scope.apiType = scope.selSubApi - .pathArray[0].name === - 'operational' ? - 'operational/' : ''; - scope.node = scope.selSubApi.node; - console.info('node:', scope.node); - scope.filterRootNode = scope.selSubApi - .node; - scope.node.clear(); - if (scope.selSubApi && scope.selSubApi - .operations) { - scope.selectedOperation = - scope.selSubApi.operations[ - 0]; - } - successloadingCallback(scope, ''); - - }, function(e) { - errorLoadingCallback(scope, - 'Error loading node'); - console.error(e); - }); - - }; - ////////// End snippet originally from yangui.controller.js ////////// - - - ////////// Snippet originally from yangui.controller.js ////////// - api.executeOperation = function(scope) { - return function(operation, callback, - reqPath) { - var reqString = scope.selSubApi.buildApiRequestString(), - requestData = {}, - preparedRequestData = {}, - headers = { - "Content-Type": "application/yang.data+json" - }; - - reqString = reqPath ? reqPath.slice( - scope.selApi.basePath.length, - reqPath.length) : reqString; - var requestPath = scope.selApi.basePath + - reqString; - scope.node.buildRequest(RequestBuilderService, - requestData); - angular.copy(requestData, - preparedRequestData); - preparedRequestData = YangUtilsService.prepareRequestData( - preparedRequestData, - operation, reqString, scope - .selSubApi); - //requestWorkingCallback(); - - operation = operation === 'DELETE' ? - 'REMOVE' : operation; - - YangUtilsRestangularService.one('restconf') - .customOperation(operation.toLowerCase(), - reqString, null, headers, - preparedRequestData).then( - function(data) { - if (operation === - 'REMOVE') { - scope.node.clear(); - } - - if (data) { - scope.node.clear(); - var props = Object.getOwnPropertyNames( - data); - - props.forEach( - function(p) { - scope.node - .fill( - p, - data[ - p - ] - ); - }); - scope.node.expanded = - true; - } - - successCallback(scope, - scope.selSubApi - .node.label, '' - ); - - if (operation === 'GET') { - requestData = {}; - } - console.info('Success'); - - if (angular.isFunction( - callback)) { - callback(data); - } - - }, - function(resp) { - var errorMsg = ''; - if (resp.data && resp.data - .errors && resp.data - .errors.error && - resp.data.errors.error - .length) { - errorMsg = ': ' + - resp.data.errors - .error.map( - function(e) { - return e[ - 'error-message' - ]; - }).join( - ', '); - } - - errorCallback(scope, scope.selSubApi.node.label, errorMsg); - - if (operation === 'GET') { - requestData = {}; - } - - console.info( - 'error sending request to', - scope.selSubApi - .buildApiRequestString(), - 'reqString', - reqString, - 'got', resp.status, - 'data', resp.data - ); - } - ); - }; - } - ////////// End snippet originally from yangui.controller.js ////////// - - // Function required from the html view files imported from the yangui - api.getNodeName = function(localeLabel, label) { - return label; - }; - - ////////// Snippet originally from yangui.controller.js ////////// - api.buildRoot = function(scope) { - return function() { - scope.node.buildRequest(RequestBuilderService, {}); - }; - }; - ////////// End snippet originally from yangui.controller.js ////////// - - - var loadingCallback = function(scope, e) { - scope.status = { - show: true, - isWorking: true, - type: 'success', - msg: 'LOADING_NODE', - rawMsg: e || '' - }; - }; - - var errorLoadingCallback = function(scope, e) { - scope.status = { - show: true, - isWorking: false, - type: 'danger', - msg: 'LOADING_ERROR', - rawMsg: e || '' - }; - }; - - var successloadingCallback = function(scope, e) { - scope.status = { - show: true, - isWorking: false, - type: 'success', - msg: 'LOADING_SUCCESS', - rawMsg: e || '' - }; - - setTimeout(function() { - scope.status.show = false; - }, 2000); - }; - - var errorCallback = function(scope, type, e) { - var errortype = LispuiUtils.getLocale(type) - .concat('_ERROR'); - scope.status = { - show: true, - isWorking: false, - type: 'danger', - msg: errortype, - rawMsg: e || '' - }; - }; - - var successCallback = function(scope, type, e) { - var errortype = LispuiUtils.getLocale(type) - .concat('_SUCCESS'); - scope.status = { - show: true, - isWorking: false, - type: 'success', - msg: errortype, - rawMsg: e || '' - }; - }; - - return api; - - } - ]); - - lispui.register.factory('LispuiRestangular', function(Restangular, - ENV) { - return Restangular.withConfig(function( - RestangularConfig) { - RestangularConfig.setBaseUrl(ENV.getBaseURL( - "MD_SAL")); - }); - }); - - lispui.register.factory('LispuiDashboardSvc', ['LispuiNodeFormSvc', 'LispuiRestangular', 'LispuiUtils', - function(LispuiNodeFormSvc, LispuiRestangular, LispuiUtils) { - var api = {}; - - api.getAll = function() { - return LispuiRestangular.one('restconf').one( - 'config').one( - 'odl-mappingservice:mapping-database'); - }; - - api.postDeleteKey = function() { - return LispuiRestangular.one('restconf').one( - 'operations').one( - 'odl-mappingservice:remove-key'); - } - - api.postDeleteMapping = function() { - return LispuiRestangular.one('restconf').one( - 'operations').one( - 'odl-mappingservice:remove-mapping'); - } - - api.expandSingleRow = function(element, data, op) { - temp = element[op]; - for (k of data) { - k.detailHide = true; - k.deleteHide = true; - } - element[op] = !temp; - }; - - api.getOriginalKeys = function() { - return api.getAll().get().then(function( - data) { - var database = []; - for (vni of data['mapping-database']['virtual-network-identifier']) { - if (vni['authentication-key'] != null) { - for (key of vni['authentication-key']) { - console.log('vni', vni.vni) - key.vni = vni.vni; - database.push(key); - } - } - } - console.info('database,', database); - return database; - }); - }; - - api.getOriginalMappings = function() { - return api.getAll().get().then(function( - data) { - var database = []; - console.info('data:', data); - for (vni of data[ - 'mapping-database'][ - 'virtual-network-identifier' - ]) { - if (vni.mapping != null) { - for (mapping of vni.mapping) { - mapping.vni = vni.vni; - database.push(mapping); - } - } - } - console.info('database:', database); - return database; - }); - }; - - api.getKeys = function() { - return api.getOriginalKeys().then(function( - database) { - var data = [] - console.info('database:', - database); - for (key of database) { - key.data = LispuiUtils.getPrettyString(JSON.stringify(key)); - key.detailHide = true; - key.deleteHide = true; - key.url = key['eid-uri'].replace( - '/', '%2f'); - data.push(key); - } - console.info('keys:', data); - return data; - }); - }; - - api.getMappings = function() { - return api.getOriginalMappings().then( - function(database) { - var data = []; - for (mapping of database) { - mapping.data = LispuiUtils.getPrettyString(JSON.stringify(mapping)); - console.log(mapping.data); - mapping.detailHide = true; - mapping.deleteHide = true; - mapping.url = mapping['eid-uri'].replace('/', '%2f'); - var numLocators = 0; - var locatorString = ''; - var mainLocatorRecord = null; - var mappingRecord = mapping['mapping-record']; - console.info(mappingRecord); - if (mappingRecord.LocatorRecord) { - numLocators = mappingRecord.LocatorRecord - .length; - // Take the most important Locator - mainLocatorRecord = - mappingRecord.LocatorRecord[ - 0]; - for (i = 1; i < - numLocators; i++) { - if (mappingRecord.LocatorRecord[ - i].priority < - mainLocatorRecord - .priority || - (mappingRecord.LocatorRecord[ - i].priority == - mainLocatorRecord - .priority && - mappingRecord.LocatorRecord[ - i].weight > - mainLocatorRecord - .weight)) - mainLocatorRecord = - mappingRecord.LocatorRecord[ - i]; - } - locatorString += - LispuiUtils.renderLispAddress( - mainLocatorRecord - .rloc - ); - if (numLocators > 1) { - numLocators--; - locatorString += - ' (+' + - numLocators + - ')'; - } - - // FLAGS - var flags = ''; - var previous = false; - if (mainLocatorRecord.localLocator) { - flags += 'Local'; - previous = true; - } - if (mainLocatorRecord.rlocProbed) { - flags += previous ? - ' | Probed' : - 'Probed'; - previous = true; - } - if (mainLocatorRecord.routed) { - flags += previous ? - ' | Up' : 'Up'; - previous = true; - } - - // TTL - var ttl = ''; - ttl += - mainLocatorRecord.priority - .toString() + '/' + - mainLocatorRecord.weight - .toString(); - ttl += '/' + - mainLocatorRecord.multicastPriority - .toString() + '/' + - mainLocatorRecord.multicastWeight - .toString(); - mapping.ttl = ttl; - } else { - locatorString += - mapping.action; - } - mapping.locatorString = locatorString; - mapping.flags = flags; - - data.push(mapping); - } - console.info('mappings:', data); - return data; - }); - } - - api.getDeleteKey = function(key) { - var postKey = { - "input": {} - }; - /* - if (key.vni == '0' || Object.keys(key.LispAddressContainer)[0] == 'LcafSegmentAddr') { - postKey.input.LispAddressContainer = key.LispAddressContainer; - } else { - // In case the IID is not 0 and the LispAddressContainer is not coded as LCAF, code it as LcafSegmentAddr - postKey.input.LispAddressContainer = { - "LcafSegmentAddr": { - "afi": 16387, - "lcafType": 2, - "instanceId": parseInt(key.vni), - "iidMaskLength": 32, - "Address": key.LispAddressContainer - } - } - } - postKey.input['mask-length'] = key['mask-length']; - console.log('postKey', postKey); - */ - postKey.input.eid = key.eid; - return postKey; - } - - api.getDeleteMapping = function(mapping) { - var postMapping = { - "input": {} - }; - /* - if (mapping.vni == '0' || Object.keys(mapping.LispAddressContainer)[0] == 'LcafSegmentAddr') { - postMapping.input.LispAddressContainer = mapping.LispAddressContainer; - } else { - // In case the IID is not 0 and the LispAddressContainer is not coded as LCAF, code it as LcafSegmentAddr - postMapping.input.LispAddressContainer = { - "LcafSegmentAddr": { - "afi": 16387, - "lcafType": 2, - "instanceId": parseInt(mapping.vni), - "iidMaskLength": 32, - "Address": mapping.LispAddressContainer - } - } - } - postMapping.input['mask-length'] = mapping['maskLength']; - console.log('postMapping', postMapping); - */ - postMapping.input.eid = mapping['mapping-record'].eid; - return postMapping; - } - - return api; - } - ]); - - lispui.register.factory('LispuiUtils', ['$sce', - function($sce) { - var api = {}; - - api.getLocale = function(label) { - locale = ''; - - locale = label == 'add-key' ? 'ADD_KEY' : - locale; - locale = label == 'get-key' ? 'GET_KEY' : - locale; - locale = label == 'update-key' ? 'EDIT_KEY' : - locale; - locale = label == 'add-mapping' ? - 'ADD_MAPPING' : locale; - locale = label == 'get-mapping' ? - 'GET_MAPPING' : locale; - locale = label == 'update-mapping' ? - 'EDIT_MAPPING' : locale; - - return locale; - - }; - - api.getPrettyString = function(input) { - output = '

'; - length = input.length; - indx = 0; - - for (i = 0; i < length; i++) { - if (input[i] == '{' || input[i] == '[') { - output = output.concat(input[i]).concat('
'); - indx++; - for (j = 0; j < indx; j++) - output = output.concat('    '); - } else if (input[i] == '}' || input[i] == ']') { - output = output.concat('
'); - indx--; - for (j = 0; j < indx; j++) - output = output.concat('    '); - output = output.concat(input[i]); - } else if (input[i] == ',') { - output = output.concat(',
'); - for (j = 0; j < indx; j++) - output = output.concat('    '); - } else { - output = output.concat(input[i]); - if (input[i] == ':') - output = output.concat(' '); - } - - } - output = output.concat('

'); - // Return a trusted HTML for ng-bind-html - return $sce.trustAsHtml(output); - } - - api.renderLispAddress = function(lispAddress) { - var string = ''; - - if (!lispAddress) - return string; - - var addressType = lispAddress['address-type']; - addressType = addressType.replace(/.*\:/, ""); - addressType = addressType.replace(/-afi$/, ""); - addressType = addressType.replace(/-lcaf$/, ""); - - console.info(lispAddress); - console.info(addressType); - - if (addressType == "no-address") { - string += 'no:No Address Present'; - } else if (addressType == "ipv4" || addressType == "ipv4-prefix") { - string += 'ipv4:'; - string += lispAddress[addressType]; - } else if (addressType == "ipv6" || addressType == "ipv6-prefix") { - string += 'ipv6:'; - string += lispAddress[addressType]; - } else if (addressType == "mac") { - string += 'mac:'; - string += lispAddress[addressType]; - } else if (addressType == "distinguished-name") { - string += 'dn:'; - string += lispAddress[addressType]; - } else if (addressType == "as-number") { - string += 'as:AS'; - string += lispAddress[addressType]; - } else if (addressType == "afi-list") { - string += 'list:{'; - var addresses = lispAddress[addressType].address; - var first = true; - for (add of addresses) { - string += (first) ? '' : ','; - first = false; - delete add.name; - string += add; - } - string += '}'; - } else if (addressType == "instance-id") { - string += '[' + lispAddress[addressType].iid + '] '; - string += lispAddress[addressType].address; - } else if (addressType == "application-data") { - string += 'appdata:' - console.log(lispAddress[addressType].address); - string += lispAddress[addressType].address; - string += '!' + lispAddress[addressType].ipTos; - string += '!' + lispAddress[addressType].protocol; - string += '!' + lispAddress[addressType].localPortLow; - string += '-' + lispAddress[addressType].localPortHigh; - string += '!' + lispAddress[addressType].remotePortLow; - string += '-' + lispAddress[addressType].remotePortHigh; - } else if (addressType == "explicit-locator-path") { - string += 'elp:'; - string += '{'; - var hops = lispAddress[addressType].hop; - first = true; - for (hop of hops) { - string += (first) ? '' : '→'; - first = false; - string += hop.hop.address; - } - string += '}'; - } else if (addressType == "source-dest-key") { - string += 'srcdst:'; - string += lispAddress[addressType].source; - string += '|'; - string += lispAddress[addressType].dest; - } else if (addressType == "key-value-address") { - string += lispAddress[addressType].key; - string += '=>'; - string += lispAddress[addressType].value; - } - - return string; - } - - return api; - } - ]); - -}); diff --git a/ui/module/src/main/resources/lispui/lispui.tpl.html b/ui/module/src/main/resources/lispui/lispui.tpl.html deleted file mode 100644 index d52925a64..000000000 --- a/ui/module/src/main/resources/lispui/lispui.tpl.html +++ /dev/null @@ -1,16 +0,0 @@ - - -
-
-
-

Hello World!

-
-
-
-
diff --git a/ui/module/src/main/resources/lispui/mappings/lispui.mapping.controller.js b/ui/module/src/main/resources/lispui/mappings/lispui.mapping.controller.js deleted file mode 100644 index d5a949cc6..000000000 --- a/ui/module/src/main/resources/lispui/mappings/lispui.mapping.controller.js +++ /dev/null @@ -1,49 +0,0 @@ -define(['app/lispui/lispui.module', 'app/lispui/lispui.services'], function(lispui) { - - lispui.register.controller('MappingsLispuiCtrl', ['$scope', 'LispuiDashboardSvc', 'LispuiUtils', - function($scope, LispuiDashboardSvc, LispuiUtils) { - $scope.data = []; - - var loadTable = function () { - $scope.data = []; - LispuiDashboardSvc.getMappings().then(function (mappings) { - $scope.data = mappings; - }); - }; - - var deleteMapping = function (key) { - var postMapping = LispuiDashboardSvc.getDeleteMapping(key) - LispuiDashboardSvc.postDeleteMapping().post('', postMapping).then(function (success) { - $scope.loadTable(); - }) - } - - $scope.loadTable = loadTable; - $scope.expandSingleRow = LispuiDashboardSvc.expandSingleRow; - $scope.deleteMapping = deleteMapping - loadTable(); - }]); - - lispui.register.controller('MappingsCreateLispuiCtrl',['$scope', 'LispuiNodeFormSvc', - function($scope, LispuiNodeFormSvc) { - LispuiNodeFormSvc.initValues($scope); - LispuiNodeFormSvc.loadNode("add-mapping", $scope); - - $scope.getNodeName = LispuiNodeFormSvc.getNodeName; - $scope.buildRoot = LispuiNodeFormSvc.buildRoot($scope); - $scope.executeOperation = LispuiNodeFormSvc.executeOperation($scope); - - }]); - - lispui.register.controller('MappingsGetLispuiCtrl',['$scope', 'LispuiNodeFormSvc', - function($scope, LispuiNodeFormSvc) { - LispuiNodeFormSvc.initValues($scope); - LispuiNodeFormSvc.loadNode("get-mapping", $scope); - - $scope.getNodeName = LispuiNodeFormSvc.getNodeName; - $scope.buildRoot = LispuiNodeFormSvc.buildRoot($scope); - $scope.executeOperation = LispuiNodeFormSvc.executeOperation($scope); - - }]); - -}); diff --git a/ui/module/src/main/resources/lispui/mappings/mapping.create.tpl.html b/ui/module/src/main/resources/lispui/mappings/mapping.create.tpl.html deleted file mode 100644 index b624eca83..000000000 --- a/ui/module/src/main/resources/lispui/mappings/mapping.create.tpl.html +++ /dev/null @@ -1,13 +0,0 @@ -
-

{{ 'LISP_ADD_MAPPING' | translate }}

- {{ 'BACK' | translate }} -
-
-
- - - - {{ status.msg | translate }} - {{ status.rawMsg ? (' - ' + status.rawMsg) : '' }} - -
diff --git a/ui/module/src/main/resources/lispui/mappings/mapping.get.tpl.html b/ui/module/src/main/resources/lispui/mappings/mapping.get.tpl.html deleted file mode 100644 index 6f42e66f0..000000000 --- a/ui/module/src/main/resources/lispui/mappings/mapping.get.tpl.html +++ /dev/null @@ -1,13 +0,0 @@ -
-

{{ 'LISP_GET_MAPPING' | translate }}

- {{ 'BACK' | translate }} -
-
-
- - - - {{ status.msg | translate }} - {{ status.rawMsg ? (' - ' + status.rawMsg) : '' }} - -
diff --git a/ui/module/src/main/resources/lispui/mappings/mapping.table.tpl.html b/ui/module/src/main/resources/lispui/mappings/mapping.table.tpl.html deleted file mode 100644 index 88beda3e5..000000000 --- a/ui/module/src/main/resources/lispui/mappings/mapping.table.tpl.html +++ /dev/null @@ -1,50 +0,0 @@ -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ 'VNI' | translate }}{{ 'EID' | translate }}{{ 'LOCATOR' | translate }}{{ 'FLAGS' | translate }}{{ 'TTL' | translate }}{{ 'ACTIONS' | translate }}
{{ 'NO_MAPPINGS' | translate }}
{{ mapping.vni }}{{ mapping['eid-uri'] }}{{ mapping.locatorString }}{{ mapping.flags }}{{ mapping.ttl }} {{ 'VIEW' | translate }} | - {{ 'DELETE' | translate }} -
-
-
-

{{ 'ASK_DELETE_MAPPING' | translate }}

- - -
- -
diff --git a/ui/module/src/main/resources/lispui/mappings/mapping.tpl.html b/ui/module/src/main/resources/lispui/mappings/mapping.tpl.html deleted file mode 100644 index 288df5c1d..000000000 --- a/ui/module/src/main/resources/lispui/mappings/mapping.tpl.html +++ /dev/null @@ -1,6 +0,0 @@ -
-

{{ 'LISP_MAPPINGS' | translate }}

- {{ 'LISP_ADD_MAPPING' | translate }} - {{ 'LISP_GET_MAPPING' | translate }} -
-
diff --git a/ui/module/src/main/resources/lispui/root.tpl.html b/ui/module/src/main/resources/lispui/root.tpl.html deleted file mode 100644 index 39d3a5b7d..000000000 --- a/ui/module/src/main/resources/lispui/root.tpl.html +++ /dev/null @@ -1,11 +0,0 @@ - - -
diff --git a/ui/pom.xml b/ui/pom.xml deleted file mode 100644 index 1bbd9b738..000000000 --- a/ui/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4.0.0 - - org.opendaylight.lispflowmapping - lispflowmapping-commons - 1.8.0-SNAPSHOT - ../commons/parent - - - lispflowmapping-ui - pom - - ODL :: lispflowmapping :: ${project.artifactId} - - - - module - bundle - - -- 2.36.6