summaryrefslogtreecommitdiffstats
path: root/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser
diff options
context:
space:
mode:
authordemx8as6 <martin.skorupski@highstreet-technologies.com>2018-07-10 18:07:44 +0200
committerTimoney, Dan (dt5972) <dt5972@att.com>2018-07-11 16:30:28 -0400
commit27fb2d06608fbb070ae2c15a5580a4f5b2423d15 (patch)
treeccd717991b4e556b67f1fd2cacb345b4d174b41f /sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser
parent60315525ab5e7c12a9f47c409092e8dba6ad656d (diff)
Add seed code for sdnr app based on ONF Centennial
At this point in time all the Carbon code from ONF Centennial is added to ONAP. Later it needs to be refactored and modified for ODL Oxygen. Change-Id: Iff85dd940c05c3827f1c4e6f9542ecd060c58a46 Issue-ID: SDNC-374 Signed-off-by: demx8as6 <martin.skorupski@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser')
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/pom.xml89
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml19
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/pom.xml14
-rwxr-xr-xsdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnBrowser.pngbin0 -> 2838 bytes
-rwxr-xr-xsdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnConfig.pngbin0 -> 2838 bytes
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser-custom.css24
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.controller.js1090
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.module.js53
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.services.js37
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/frame.tpl.html191
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpClockViewer.tpl.html66
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpPorts.tpl.html23
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpDefaultDsConfigView.tpl.html45
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpPortConfigView.tpl.html53
-rw-r--r--sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/pom.xml22
15 files changed, 1726 insertions, 0 deletions
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/pom.xml b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/pom.xml
new file mode 100644
index 00000000..7499a987
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/pom.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>mwtnBrowser</artifactId>
+ <groupId>com.highstreet.technologies.odl.dlux</groupId>
+ <version>0.5.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>mwtnBrowser-bundle</artifactId>
+ <name>${prefix} ${project.artifactId}</name>
+ <packaging>bundle</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${osgi.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${osgi.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${apache.felix.compendium}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>loader</artifactId>
+ <version>${dlux.loader.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.highstreet.technologies.odl.dlux</groupId>
+ <artifactId>mwtnBrowser-module</artifactId>
+ <version>0.5.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>target/generated-resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <!--loader Resources -->
+ <execution>
+ <id>unpack-loader-resources</id>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
+ <groupId>com.highstreet.technologies.odl.dlux</groupId>
+ <includeArtifactIds>mwtnBrowser-module</includeArtifactIds>
+ <excludes>META-INF\/**</excludes>
+ <excludeTransitive>true</excludeTransitive>
+ <ignorePermissions>false</ignorePermissions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-Package>org.osgi.service.http,
+ org.osgi.framework;version="1.0.0",
+ org.opendaylight.dlux.loader
+ </Import-Package>
+ <Export-Package></Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml
new file mode 100644
index 00000000..383b124b
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -0,0 +1,19 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <reference id="httpService" availability="mandatory" activation="eager" interface="org.osgi.service.http.HttpService"/>
+ <reference id="loader" availability="mandatory" activation="eager" interface="org.opendaylight.dlux.loader.DluxModuleLoader"/>
+
+ <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.opendaylight.dlux.loader.DluxModule">
+ <property name="httpService" ref="httpService"/>
+ <property name="loader" ref="loader"/>
+ <property name="moduleName" value="mwtnBrowser"/>
+ <property name="url" value="/src/app/mwtnBrowser"/>
+ <property name="directory" value="/mwtnBrowser"/>
+ <property name="requireJs" value="app/mwtnBrowser/mwtnBrowser.module"/>
+ <property name="angularJs" value="app.mwtnBrowser"/>
+ <property name="cssDependencies">
+ <list>
+ <value>src/app/mwtnBrowser/mwtnBrowser-custom.css</value>
+ </list>
+ </property>
+ </bean>
+</blueprint> \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/pom.xml b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/pom.xml
new file mode 100644
index 00000000..7c33ed89
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>mwtnBrowser-module</artifactId>
+ <name>${prefix} ${project.artifactId}</name>
+ <packaging>jar</packaging>
+ <parent>
+ <artifactId>mwtnBrowser</artifactId>
+ <groupId>com.highstreet.technologies.odl.dlux</groupId>
+ <version>0.5.1-SNAPSHOT</version>
+ </parent>
+</project> \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnBrowser.png b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnBrowser.png
new file mode 100755
index 00000000..ae596db7
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnBrowser.png
Binary files differ
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnConfig.png b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnConfig.png
new file mode 100755
index 00000000..ae596db7
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/images/mwtnConfig.png
Binary files differ
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser-custom.css b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser-custom.css
new file mode 100644
index 00000000..15c398c1
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser-custom.css
@@ -0,0 +1,24 @@
+/**
+ * Add your application related css here
+ */
+
+.json-formatter-row .constructor-name {
+ cursor: pointer;
+ color: #333333;
+}
+
+.json-formatter-row .toggler:after {
+ color: darkgreen;
+ font-weight: bold;
+ display: inline-block;
+ transition: transform .1s ease-in;
+ content: ">"
+}
+
+.owl span.key-text {
+ color: #333333;
+}
+
+.owl span.colon {
+ color: #333333;
+} \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.controller.js b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.controller.js
new file mode 100644
index 00000000..76d3148d
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.controller.js
@@ -0,0 +1,1090 @@
+/*
+ * @copyright 2017 highstreet technologies GmbH and others. All rights reserved.
+ *
+ * @license
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+define(['app/mwtnBrowser/mwtnBrowser.module',
+ 'app/mwtnBrowser/mwtnBrowser.services'],
+ function(mwtnBrowserApp) {
+
+ var getControlType = function(type) {
+ var result = 'text'
+ switch (type) {
+ case 'boolean':
+ result = 'checkbox';
+ break;
+ case 'number':
+ result = 'number';
+ break;
+ case 'string':
+ case 'array':
+ case 'object':
+ break;
+ default:
+ var message = 'Check control type for ' + type;
+ $mwtnLog.warning({ component: COMPONENT, message: message });
+ }
+ return result;
+ };
+
+ mwtnBrowserApp.register.controller('ptpDefaultDsViewController', ['$scope', '$uibModalInstance', '$mwtnGlobal', '$mwtnCommons', '$mwtnDatabase', '$mwtnLog', 'defaultDs',
+ function ($scope, $uibModalInstance, $mwtnGlobal, $mwtnCommons, $mwtnDatabase, $mwtnLog, defaultDs) {
+
+ var vm = this;
+ var COMPONENT = 'ptpDefaultDsViewController';
+ $scope.data = defaultDs;
+
+ $scope.getType = $mwtnGlobal.getType;
+
+
+ $mwtnCommons.getPtpDefaultDs(defaultDs).then(function (success) {
+
+ $scope.configuredData = success;
+ $scope.viewData = $mwtnGlobal.getViewData($scope.configuredData['default-ds']);
+
+ $mwtnDatabase.getSchema().then(function(schema){
+ var ordered = {};
+ var clone = JSON.parse(JSON.stringify($scope.viewData));
+ var keys = Object.keys(clone).map(function(key){
+ if ($mwtnGlobal.getType(key) !== 'string') {
+ console.log('key', key);
+ return;
+ }
+ var item = clone[key];
+ if (!schema[key]) {
+ var message = 'No schema information for ' + key;
+ $mwtnLog.warning({ component: COMPONENT, message: message });
+ item['order-number'] = $mwtnCommons.getOrderNumber(97, item);
+ item.description = 'No description available.';
+ item.visible = true;
+ return key;
+ }
+ if (schema[key].controlType === undefined) {
+ item.controlType = getControlType(item.type);
+ } else {
+ item.controlType = schema[key].controlType;
+ }
+ item.unit = schema[key].unit;
+ item['is-read-only'] = schema[key]['is-read-only'];
+ if (schema[key].min) {
+ item.min = schema[key].min;
+ }
+ if (schema[key].max) {
+ item.max = schema[key].max;
+ if (item.unit) {
+ item.unit = schema[key].min + '..' + schema[key].max + ' ' + item.unit;
+ } else {
+ item.unit = schema[key].min + '..' + schema[key].max;
+ }
+ }
+
+
+ item['order-number'] = $mwtnCommons.getOrderNumber(schema[key]['order-number'], item);
+ item.description = schema[key].description;
+ if (item.description === undefined || item.description === '') {
+ item.description = 'No description available.';
+ }
+ // hide complex types for now -> TODO
+ if (item.type === 'array' || item.type === 'object') {
+ item.visible = false;
+ }
+ return key;
+ }).sort(function(a,b){
+ if (clone[a]['order-number'] < clone[b]['order-number']) return -1;
+ if (clone[a]['order-number'] > clone[b]['order-number']) return 1;
+ return 0;
+ }).map(function(key){
+ ordered[key] = clone[key];
+ });
+ $scope.viewData = ordered;
+ }, function(error){
+ $scope.empty = true;
+ });
+
+ }, function (error) {
+ $scope.configuredData = undefined;
+ $mwtnLog.error({ component: COMPONENT, message: 'Requesting PTP default ds ' + JSON.stringify($scope.data) + ' failed!' });
+ });
+
+ $scope.$watch('viewData', function(newValue, oldValue) {
+ if (oldValue && newValue !== oldValue) {
+ Object.keys(newValue).filter(function(key){
+ return newValue[key]['is-read-only'] !== true && newValue[key].controlType === 'number' ;
+ }).map(function(key){
+ if (newValue[key].value < newValue[key].min) newValue[key].value = newValue[key].min;
+ if (newValue[key].value > newValue[key].max) newValue[key].value = newValue[key].max;
+ if (!newValue[key].value) newValue[key].value = newValue[key].min;
+ });
+ }
+ }, true);
+
+ $scope.newData = {};
+ $scope.ok = function () {
+ $scope.processing = true;
+ $scope.newData = {};
+ Object.keys($scope.viewData).map(function(key){
+ $scope.newData[key] = $scope.viewData[key].value;
+ });
+
+ $mwtnCommons.setPtpDefaultDs($scope.data, $scope.newData).then(function(success){
+ $scope.applied = {text: 'Applied: ' + new Date().toISOString(), class:'mwtnSuccess'};
+ $scope.processing = false;
+ }, function(error){
+ $scope.applied = {text: 'Error: ' + new Date().toISOString(), class:'mwtnError'};
+ $scope.processing = false;
+ $mwtnLog.error({component: COMPONENT, message: JSON.stringify(error)});
+ });
+
+ };
+
+ $scope.cancel = function () {
+ $uibModalInstance.close($scope.newData);
+ };
+
+ // events
+
+
+ }]);
+
+ mwtnBrowserApp.register.controller('ptpPortConfigViewController', ['$scope', '$uibModalInstance', '$mwtnGlobal', '$mwtnCommons', '$mwtnDatabase', '$mwtnLog', 'valueData',
+ function ($scope, $uibModalInstance, $mwtnGlobal, $mwtnCommons, $mwtnDatabase, $mwtnLog, data) {
+
+ var vm = this;
+ var COMPONENT = 'ptpPortConfigViewController';
+
+ $scope.data = data;
+
+ $scope.getType = $mwtnGlobal.getType;
+ console.warn(JSON.stringify(data));
+ $mwtnCommons.getPtpPort(data).then(function (success) {
+
+ $scope.configuredData = success;
+
+ $scope.viewData = $mwtnGlobal.getViewData($scope.configuredData['port-ds-list'][0]);
+ $mwtnDatabase.getSchema().then(function(schema){
+ var ordered = {};
+ var clone = JSON.parse(JSON.stringify($scope.viewData));
+ var keys = Object.keys(clone).map(function(key){
+ if ($mwtnGlobal.getType(key) !== 'string') {
+ console.log('key', key);
+ return;
+ }
+ var item = clone[key];
+ if (!schema[key]) {
+ var message = 'No schema information for ' + key;
+ $mwtnLog.warning({ component: COMPONENT, message: message });
+ item['order-number'] = $mwtnCommons.getOrderNumber(97, item);
+ item.description = 'No description available.';
+ item.visible = true;
+ return key;
+ }
+ if (schema[key].controlType === undefined) {
+ item.controlType = getControlType(item.type);
+ } else {
+ item.controlType = schema[key].controlType;
+ }
+ item.unit = schema[key].unit;
+ console.warn(key, schema[key]['is-read-only']);
+ item['is-read-only'] = schema[key]['is-read-only'];
+ if (schema[key].min) {
+ item.min = schema[key].min;
+ }
+ if (schema[key].max) {
+ item.max = schema[key].max;
+ if (item.unit) {
+ item.unit = schema[key].min + '..' + schema[key].max + ' ' + item.unit;
+ } else {
+ item.unit = schema[key].min + '..' + schema[key].max;
+ }
+ }
+
+
+ item['order-number'] = $mwtnCommons.getOrderNumber(schema[key]['order-number'], item);
+ item.description = schema[key].description;
+ if (item.description === undefined || item.description === '') {
+ item.description = 'No description available.';
+ }
+ // hide complex types for now -> TODO
+ if (item.type === 'array' || item.type === 'object') {
+ item.visible = false;
+ }
+ return key;
+ }).sort(function(a,b){
+ if (clone[a]['order-number'] < clone[b]['order-number']) return -1;
+ if (clone[a]['order-number'] > clone[b]['order-number']) return 1;
+ return 0;
+ }).map(function(key){
+ ordered[key] = clone[key];
+ });
+ $scope.viewData = ordered;
+ }, function(error){
+ $scope.empty = true;
+ });
+
+ }, function (error) {
+ $scope.configuredData = undefined;
+ $mwtnLog.error({ component: COMPONENT, message: 'Requesting PTP port ' + JSON.stringify($scope.data) + ' failed!' });
+ });
+
+ $scope.$watch('viewData', function(newValue, oldValue) {
+ if (oldValue && newValue !== oldValue) {
+ Object.keys(newValue).filter(function(key){
+ return newValue[key]['is-read-only'] !== true && newValue[key].controlType === 'number' ;
+ }).map(function(key){
+ if (newValue[key].value < newValue[key].min) newValue[key].value = newValue[key].min;
+ if (newValue[key].value > newValue[key].max) newValue[key].value = newValue[key].max;
+ if (!newValue[key].value) newValue[key].value = newValue[key].min;
+ });
+ }
+ }, true);
+
+ $scope.newData = {};
+ $scope.ok = function () {
+ $scope.processing = true;
+ $scope.newData = {};
+ Object.keys($scope.viewData).map(function(key){
+ $scope.newData[key] = $scope.viewData[key].value;
+ });
+
+ $mwtnCommons.setPtpPort($scope.data, $scope.newData).then(function(success){
+ $scope.applied = {text: 'Applied: ' + new Date().toISOString(), class:'mwtnSuccess'};
+ $scope.processing = false;
+ }, function(error){
+ $scope.applied = {text: 'Error: ' + new Date().toISOString(), class:'mwtnError'};
+ $scope.processing = false;
+ $mwtnLog.error({component: COMPONENT, message: JSON.stringify(error)});
+ });
+
+ };
+
+ $scope.cancel = function () {
+ $uibModalInstance.close($scope.newData);
+ };
+
+ // events
+
+
+ }]);
+
+ mwtnBrowserApp.register.controller('mwtnPtpPortsController', ['$scope', '$filter', '$uibModal', '$mwtnGlobal', '$mwtnCommons', '$mwtnLog',
+ function ($scope, $filter, $uibModal, $mwtnGlobal, $mwtnCommons, $mwtnLog) {
+ var vm = this;
+ var COMPONENT = 'mwtnPtpPortsController';
+
+ $scope.info = false;
+ var data = JSON.parse(JSON.stringify($scope.data));
+ if (!data) {
+ var message = 'No data to be displayed!";'
+ $mwtnLog.info({ component: COMPONENT, message: message });
+ data = [{'message':message}];
+ }
+
+ if ($mwtnGlobal.getType(data) !== 'array') {
+ var message = 'Data must be of type "array"!';
+ $mwtnLog.info({ component: COMPONENT, message: message });
+ data = [{'message':message}];
+ }
+
+ if (data.length === 0) {
+ var message = 'Data list must have at least one entry!';
+ $mwtnLog.info({ component: COMPONENT, message: message });
+ data = [{'message':message}];
+ }
+
+ if ($mwtnGlobal.getType(data[0]) !== 'object') {
+ data = data.map(function(item){
+ return {value: item};
+ });
+ }
+
+ $scope.ptpPorts = [];
+
+ $scope.gridOptions = JSON.parse(JSON.stringify($mwtnCommons.gridOptions));
+ $scope.gridOptions.data = 'ptpPorts';
+ $scope.highlightFilteredHeader = $mwtnCommons.highlightFilteredHeader;
+
+ // $scope.getTableHeight = function() {
+ // var rowHeight = 30;
+ // var headerHeight = 40;
+ // var maxCount = 12;
+ // var rowCount = $scope.gridOptions.data.length + 2;
+ // if (rowCount > maxCount) {
+ // return {
+ // height: (maxCount * rowHeight + headerHeight) + 'px'
+ // };
+ // }
+ // return {}; // use auto-resize feature
+ // };
+
+ var getCellTemplate = function(field) {
+ var object = ['transmission-mode-list', 'performance-data'];
+ if (object.contains(field)) {
+ return ['<div class="ui-grid-cell-contents">',
+ '<i class="fa fa-info-circle pointer" aria-hidden="true"',
+ ' ng-click="grid.appScope.show(grid.getCellValue(row, col))"></i> ',
+ '{{grid.getCellValue(row, col)}}</div>'].join('');
+ } else if (field === 'action') {
+ return [
+ '<a class="vCenter" ng-class="{attention: grid.appScope.hover, hidden: onfAirInterfaceRevision}" >',
+ ' <i class="fa fa-pencil-square-o pointer" aria-hidden="true" ng-click="grid.appScope.show(row.entity)"></i>',
+ '</a>' ].join('<span>&nbsp;</span>');
+ } else {
+ return '<div class="ui-grid-cell-contents">{{grid.getCellValue(row, col)}}</div>';
+ }
+ };
+
+ $scope.show = function(value){
+ var type = $mwtnGlobal.getType(value);
+ // if (type === 'object')
+ var modalInstance = $uibModal.open({
+ animation: true,
+ ariaLabelledBy: 'modal-title',
+ ariaDescribedBy: 'modal-body',
+ templateUrl: 'src/app/mwtnBrowser/templates/ptpPortConfigView.tpl.html',
+ controller: 'ptpPortConfigViewController',
+ size: 'huge',
+ resolve: {
+ valueData: function () {
+ return {networkElement: $scope.networkElement, value:value};
+ }
+ }
+ });
+ modalInstance.result.then(function(object) {
+ console.warn(JSON.stringify(object));
+ $scope.ptpPorts.map(function(row, index){
+ if (row['port-number'] === object['port-number']) {
+ console.log($scope.ptpPorts[index]['onf-ptp-dataset:master-only']);
+ $scope.ptpPorts[index] = object;
+ console.log($scope.ptpPorts[index]['onf-ptp-dataset:master-only']);
+ };
+ });
+ }, function () {
+ // ignore;
+ });
+ };
+
+ var enable = data.length > 10;
+ $scope.gridOptions.columnDefs = Object.keys(data[0]).map(function (field) {
+ var type = $mwtnGlobal.getType(data[0][field]);
+ var labelId = $mwtnGlobal.getLabelId(field);
+ var displayName = $filter('translate')(labelId);
+ var visible = $mwtnGlobal.getVisibilityOf(field);
+ if (labelId.contains('$$') || labelId === 'MWTN_SPEC') {
+ visible = false;
+ }
+ return {
+ field: field,
+ type: type,
+ displayName: displayName,
+ enableSorting: true,
+ enableFiltering: enable,
+ headerCellClass: $scope.highlightFilteredHeader,
+ cellTemplate: getCellTemplate(field),
+ cellClass: type,
+ visible: visible
+ };
+ });
+ $scope.gridOptions.columnDefs.push({
+ field: 'action',
+ displayName: 'Action',
+ enableSorting: false,
+ enableFiltering: false,
+ headerCellClass: $scope.highlightFilteredHeader,
+ cellTemplate: getCellTemplate('action'),
+ width: 100,
+ visible: true,
+ pinnedRight : true
+
+ });
+ if ($scope.gridOptions.data.length < 10) {
+ $scope.gridOptions.minRowsToShow = data.length; // 10 is default
+ }
+ $scope.ptpPorts = data.map(function(item){
+ item.action = '';
+ return item;
+ });
+ // .sort(function(a, b){
+ // if (a.type === 'object') return -1;
+ // if (a.type === 'array' ) return -2;
+ // return 0;
+ // })
+
+ $scope.myClipboard = {
+ data: $scope.data,
+ supported: true,
+ getJson: function () {
+ return JSON.stringify(this.data, null, ' ');
+ },
+ copyToClipboard: function () {
+ var message = 'Copied to clipboard! ' + this.getJson();
+ $mwtnLog.info({ component: COMPONENT, message: message });
+ },
+ error: function (err) {
+ $mwtnLog.error({ component: COMPONENT, message: err });
+ }
+ };
+ }]);
+
+ mwtnBrowserApp.register.directive('mwtnPtpPorts', function () {
+ return {
+ restrict: 'E',
+ scope: {
+ data: '=',
+ path: '=',
+ networkElement: '='
+ },
+ controller: 'mwtnPtpPortsController',
+ controllerAs: 'vm',
+ templateUrl: 'src/app/mwtnBrowser/templates/mwtnPtpPorts.tpl.html'
+ };
+ });
+
+ mwtnBrowserApp.register.controller('mwtnPtpClockViewerController', ['$scope', '$timeout', '$uibModal', '$mwtnGlobal', '$mwtnCommons', '$mwtnDatabase', '$mwtnLog', '$mwtnBrowser',
+ function ($scope, $timeout, $uibModal, $mwtnGlobal, $mwtnCommons, $mwtnDatabase, $mwtnLog, $mwtnBrowser) {
+ var vm = this;
+ var COMPONENT = 'mwtnPtpClockViewerController';
+ if ($scope.data) {
+ $scope.replace = false;
+ if ($scope.path && $scope.path.endsWith('-configuration') ) {
+ $scope.replace = true;
+ }
+ $scope.viewData = $mwtnGlobal.getViewData($scope.data, $scope.ne);
+ var path = [undefined, undefined, undefined];
+ if ($scope.path) {
+ path = $scope.path.split($mwtnCommons.separator);
+ }
+
+ var processData = function(schema) {
+ var ordered = {};
+ var clone = JSON.parse(JSON.stringify($scope.viewData));
+ var keys = Object.keys(clone).map(function(key){
+ if ($mwtnGlobal.getType(key) !== 'string') {
+ console.log('key', key);
+ return;
+ }
+ var item = clone[key];
+ if (!schema[key]) {
+ var message = 'No schema information for ' + key;
+ $mwtnLog.warning({ component: COMPONENT, message: message });
+ item['order-number'] = $mwtnCommons.getOrderNumber(97, item);
+ item.description = 'No description available.';
+ item.visible = true;
+ return key;
+ }
+ item.unit = schema[key].unit;
+ item.description = schema[key].description;
+ item['order-number'] = $mwtnCommons.getOrderNumber(schema[key]['order-number'], item);
+ if (item.description === undefined || item.description === '') {
+ item.description = 'No description available.';
+ }
+ return key;
+ }).sort(function(a,b){
+ if (clone[a]['order-number'] < clone[b]['order-number']) return -1;
+ if (clone[a]['order-number'] > clone[b]['order-number']) return 1;
+ return 0;
+ }).map(function(key){
+ if ($mwtnGlobal.getType( clone[key].value ) === 'object') {
+ Object.keys(clone[key].value).filter(function(subKey){
+ return subKey.endsWith('-identity');
+ }).map(function(subKey){
+ var clockId = clone[key].value[subKey];
+ if ($mwtnGlobal.getType(clockId) === 'object') {
+ if (clockId['clock-identity']) {
+ var ascii = clockId['clock-identity'].base64ToHex();
+ clone[key].value[subKey]['clock-identity'] = [clone[key].value[subKey]['clock-identity'], '(ascii:', ascii, ')'].join(' ');
+ }
+ } else {
+ var ascii = clone[key].value[subKey].base64ToHex();
+ clone[key].value[subKey] = [clone[key].value[subKey], '(ascii:', ascii, ')'].join(' ');
+ }
+ });
+ ordered[key] = clone[key];
+ } else {
+ ordered[key] = clone[key];
+ }
+ });
+ $scope.info = false;
+ if (Object.keys(ordered).length === 0) {
+ $scope.info = 'An empty object is displayed. Please check if the NetConf server has send an empty object.';
+ }
+ return ordered;
+ };
+
+
+ $mwtnDatabase.getSchema().then(function(schema){
+ $scope.schema = schema;
+ $scope.viewData = processData($scope.schema);
+ }, function(error){
+ // ignore;
+ });
+ }
+
+ $scope.show = function(value){
+ var type = $mwtnGlobal.getType(value);
+ var modalInstance = $uibModal.open({
+ animation: true,
+ ariaLabelledBy: 'modal-title',
+ ariaDescribedBy: 'modal-body',
+ templateUrl: 'src/app/mwtnBrowser/templates/ptpDefaultDsConfigView.tpl.html',
+ controller: 'ptpDefaultDsViewController',
+ size: 'huge',
+ resolve: {
+ defaultDs: function () {
+ return {networkElement: $scope.networkElement, value:value};
+ }
+ }
+ });
+ modalInstance.result.then(function(object) {
+ $mwtnBrowser.refreshPTP();
+ }, function () {
+ // ignore;
+ });
+ };
+ }]);
+
+ mwtnBrowserApp.register.directive('mwtnPtpClockViewer', function () {
+ return {
+ restrict: 'E',
+ scope: {
+ data: '=',
+ path: '=',
+ ne: '=', // flag if ne class
+ networkElement: '='
+ },
+ controller: 'mwtnPtpClockViewerController',
+ controllerAs: 'vm',
+ templateUrl: 'src/app/mwtnBrowser/templates/mwtnPtpClockViewer.tpl.html'
+ };
+ });
+
+
+ mwtnBrowserApp.register.controller('mwtnBrowserCtrl', ['$scope', '$rootScope', '$mwtnLog', '$mwtnCommons', '$mwtnEthernet', '$mwtnBrowser', '$translate', 'OnfNetworkElement', 'PtpClock', 'LogicalTerminationPoint',
+ function($scope, $rootScope, $mwtnLog, $mwtnCommons, $mwtnEthernet, $mwtnBrowser, $translate, OnfNetworkElement, PtpClock, LogicalTerminationPoint) {
+
+ var COMPONENT = 'mwtnBrowserCtrl';
+ $mwtnLog.info({component: COMPONENT, message: 'mwtnBrowserCtrl started!'});
+ $rootScope.section_logo = 'src/app/mwtnBrowser/images/mwtnBrowser.png'; // Add your topbar logo location here such as 'assets/images/logo_topology.gif'
+
+ var pacTemplate = {
+ 'layer-protocol': 'unknown'
+ };
+
+ $scope.fcDeletion = {
+ nodeId: $scope.networkElementId,
+ ltp:'',
+ info: 'handle with care, no further warning, qualified user expected ;)'
+ };
+ $scope.deleteForwardingConstruct = function() {
+ $scope.fcDeletion.nodeId = $scope.networkElementId;
+ $scope.fcDeletion.info = 'Processing ...';
+ $scope.fcDeletion.error = undefined;
+ if ($scope.fcDeletion.ltp === undefined || $scope.fcDeletion.ltp === '') {
+ $scope.fcDeletion.error = 'Please select a valid LTP#1.!';
+ return;
+ }
+ $mwtnEthernet.deleteForwardingConstruct($scope.fcDeletion).then(function(success){
+ console.log(success);
+ $scope.fcDeletion.info = success;
+ }, function(error){
+ console.log(error);
+ $scope.fcDeletion.error = error;
+ });
+ }
+
+ $scope.fcCreation = {
+ nodeId: $scope.networkElementId,
+ ltp1:'',
+ ltp2:'',
+ vlan:42,
+ info:'handle with care, no further warning, qualified user expected ;)'
+ };
+ $scope.createForwardingConstruct = function() {
+ console.warn(JSON.stringify($scope.networkElementId));
+ console.warn(JSON.stringify($scope.networkElement));
+ $scope.fcCreation.nodeId = $scope.networkElementId;
+ $scope.fcCreation.info = 'Processing ...';
+ $scope.fcCreation.error = undefined;
+ if ($scope.fcCreation.ltp1 === undefined || $scope.fcCreation.ltp1 === '') {
+ $scope.fcCreation.error = 'Please select a valid LTP#1!';
+ return;
+ }
+ if ($scope.fcCreation.ltp2 === undefined || $scope.fcCreation.ltp2 === '') {
+ $scope.fcCreation.error = 'Please select a valid LTP#2!';
+ return;
+ }
+ if ($scope.fcCreation.vlan === undefined) {
+ $scope.fcCreation.error = 'Please select a valid vlan-id!';
+ return;
+ }
+ if ($scope.fcCreation.ltp1 === $scope.fcCreation.ltp2) {
+ $scope.fcCreation.error = 'Please select different LTPs. Loopback is not supported yet!';
+ return;
+ }
+ $mwtnEthernet.createForwardingConstruct($scope.fcCreation).then(function(success){
+ console.log(success);
+ $scope.fcCreation.info = success;
+ }, function(error){
+ console.log(error);
+ $scope.fcCreation.error = error;
+ });
+ }
+
+ // get important infromation from yang modules
+ console.error('help');
+ $mwtnBrowser.getModules().then(function(success){
+
+ var pacOrder = [
+ 'onf-otn-odu-conditional-packages:otn-odu-termination-pac',
+ 'onf-otn-odu-conditional-packages:otn-odu-connection-pac',
+ 'onf-ethernet-conditional-packages:ethernet-pac',
+ 'microwave-model:mw-air-interface-diversity-pac',
+ 'microwave-model:mw-air-interface-hsb-end-point-pac',
+ 'microwave-model:mw-air-interface-hsb-fc-switch-pac',
+ 'onf-core-model-conditional-packages:holder-pac',
+ 'onf-core-model-conditional-packages:connector-pac',
+ 'onf-core-model-conditional-packages:equipment-pac',
+ 'microwave-model:mw-ethernet-container-pac',
+ 'MicrowaveModel-ObjectClasses-EthernetContainer:MW_EthernetContainer_Pac',
+ 'microwave-model:mw-ethernet-container-pac',
+ 'microwave-model:mw-tdm-container-pac',
+ 'microwave-model:mw-pure-ethernet-structure-pac',
+ 'microwave-model:mw-hybrid-mw-structure-pac',
+ 'MicrowaveModel-ObjectClasses-PureEthernetStructure:MW_PureEthernetStructure_Pac',
+ 'microwave-model:mw-air-interface-pac',
+ 'MicrowaveModel-ObjectClasses-AirInterface:MW_AirInterface_Pac'
+ ];
+
+ $scope.modules = success;
+ $scope.orderedPacs = [];
+ $scope.parts = [];
+ Object.keys(success).map(function(module){
+ Object.keys(success[module]).filter(function(key){
+ return key.endsWith('-pac') || key.endsWith('_Pac');
+ }).map(function(pacName){
+ $scope.orderedPacs.push([module, pacName].join(':'));
+ // sort
+ $scope.orderedPacs.sort(function(a, b) {
+ if (!pacOrder.indexOf(a)) console.warn(a);
+ if (!pacOrder.indexOf(b)) console.warn(b);
+ if(pacOrder.indexOf(a) > pacOrder.indexOf(b)) return 1;
+ if(pacOrder.indexOf(a) < pacOrder.indexOf(b)) return -1;
+ return 0;
+ })
+
+ if (pacName === 'mw-air-interface-pac') {
+ $scope.parts = Object.keys(success[module][pacName]).filter(function(conditionalPackage){
+ return success[module][pacName][conditionalPackage]['local-name'];
+ }).map(function(conditionalPackage){
+ return success[module][pacName][conditionalPackage]['local-name'];
+ });
+ }
+ });
+ });
+ }, function(error){
+ $scope.modules = undefined;
+ $scope.orderedPacs = undefined;
+ $scope.parts = undefined;
+ });
+
+ /**
+ * @function updateNe
+ * A function, which updates onfNetworkElement by new data.
+ * @param {*} data New data recieved from OpenDaylight via RestConf
+ */
+ var updateNe = function(data) {
+ if (!data) return;
+ // update onfNetworkElement
+ switch ($scope.mountpoint.onfCoreModelRevision) {
+ case '2016-03-23':
+ $scope.onfNetworkElement = JSON.parse(JSON.stringify(data['network-element'][0]));
+ $scope.onfLtps = data['network-element'][0].ltp;
+ $scope.onfNetworkElement.ltp = undefined;
+ break;
+ case '2016-08-09':
+ case '2016-08-11':
+ case '2017-02-17':
+ case '2017-03-20':
+ case '2017-10-20':
+ // console.log(JSON.stringify(data));
+ $scope.onfNetworkElement = new OnfNetworkElement(data['network-element']);
+ var fd = $scope.onfNetworkElement.getForwardingDomain();
+ $scope.forwardingDomain = undefined;
+ $scope.forwardingConstructs = undefined;
+ if (fd && fd.length > 0) {
+ $scope.forwardingDomain = fd[0]; // $mwtnBrowser.getViewData(fd[0]);
+ $scope.forwardingConstructs = [];
+ if (fd[0].fc) {
+ fd[0].fc.map(function(id){
+ $mwtnBrowser.getForwardingConstruct($scope.networkElement, id).then(function(fc){
+
+ // TODO make robust
+ if (fc['forwarding-construct'] && fc['forwarding-construct'][0]) {
+ var item = fc['forwarding-construct'][0];
+ if (item['fc-port'] &&
+ item['fc-port'][0] && item['fc-port'][0].ltp && item['fc-port'][0].ltp[0] &&
+ item['fc-port'][1] && item['fc-port'][1].ltp && item['fc-port'][1].ltp[0]) {
+ $scope.forwardingConstructs.push( {
+ uuid: item.uuid,
+ 'fc-port#1': $scope.onfNetworkElement.getLtp( item['fc-port'][0].ltp[0] ).getLabel(),
+ 'fc-port#2': $scope.onfNetworkElement.getLtp( item['fc-port'][1].ltp[0] ).getLabel()
+ });
+ }
+ }
+ });
+ });
+ }
+ }
+ $scope.onfLtps = $scope.onfNetworkElement.getLogicalTerminationPoints();
+ // $scope.onfNetworkElement.ltp = undefined;
+ break;
+ default:
+ $mwtnLog.info({component: COMPONENT, message: ['The ONF CoreModel revision', $scope.mountpoint.onfCoreModelRevision, ' is not supported (yet)!'].join(' ')});
+ $scope.onfNetworkElement = {};
+ $scope.onfLtps = {};
+ }
+
+ var order = $mwtnBrowser.layerProtocolNameOrder;
+ // update onfLTPs
+ $scope.onfLtps.sort(function(a, b){
+ if(order[a.getLayer()] < order[b.getLayer()]) return -1;
+ if(order[a.getLayer()] > order[b.getLayer()]) return 1;
+ if(a.getId() < b.getId()) return -1;
+ if(a.getId() > b.getId()) return 1;
+ return 0;
+ });
+
+ // calculate conditional packages
+ $scope.pacs = {};
+ $scope.onfLtps.map(function(ltp) {
+ ltp.getLayerProtocols().map(
+ /**
+ * A function processing a layer-protocol object
+ * @param {LayerProtocol} lp A layer-protocol object
+ */
+ function(lp) {
+ var template = JSON.parse(JSON.stringify(pacTemplate));
+ template['layer-protocol'] = lp.getId();
+ var conditionalPackage = lp.getConditionalPackage(true);
+ // console.log(conditionalPackage);
+ if (conditionalPackage !== '') {
+ if ($scope.pacs[conditionalPackage] === undefined) {
+ // create missing pac array
+ $scope.pacs[conditionalPackage] = [];
+ }
+ $scope.pacs[conditionalPackage].push(template);
+ console.error(conditionalPackage, JSON.stringify(template));
+ } else {
+ $mwtnLog.info({component: COMPONENT, message: 'No conditional package for ' + ltp.getLabel() });
+ }
+ });
+ });
+
+ // sort the conditional packages
+ if ($scope.orderedPacs) {
+ $scope.orderedPacs.filter(function(item){
+ return $scope.pacs[item] !== undefined;
+ }).map(function(item){
+ $scope.pacs[item].sort(function(a, b){
+ if(a['layer-protocol'] < b['layer-protocol']) return -1;
+ if(a['layer-protocol'] > b['layer-protocol']) return 1;
+ return 0;
+ });
+ });
+ }
+ data.revision = undefined;
+ };
+
+ var updateNetworkElementCurrentProblems = function(data) {
+ if (data && data['network-element-current-problems'] && data['network-element-current-problems']['current-problem-list'] ) {
+ data.revision = undefined;
+ $scope.neCurrentProblems = data['network-element-current-problems']['current-problem-list'];
+ } else {
+ $scope.neCurrentProblems = [];
+ }
+ };
+
+ var updateLtp = function(data) {
+ $scope.onfLtps.map(function(ltp){
+ if (ltp.getData().uuid === data.data.ltp[0].uuid) {
+ ltp = new LogicalTerminationPoint(data.data.ltp[0]);
+ }
+ });
+ };
+
+ /**
+ * @deprecated since all conditaional packages are handle the same way even for
+ * 3rd and 4th PoC model - 2nd PoC model not supported any more.
+ * @param {*} lpId
+ * @param {*} part
+ * @param {*} data
+ */
+ var updateAirInterface = function(lpId, part, data) {
+ // console.log(JSON.stringify(data), lpId);
+ $scope.airinterfaces.map(function(airinterface){
+ // console.log(JSON.stringify(airinterface));
+ if (airinterface['layer-protocol'] === lpId) {
+ if (Object.keys(data)[0].startsWith('air-interface')) {
+ airinterface[part] = data;
+ } else if (part === 'Capability') {
+ // 2. PoC
+ // console.log(part, JSON.stringify(data));
+ airinterface[part] = data['mw-air-interface-pac'][0]['air-interface-capability-list'];
+ } else if (part === 'CurrentProblems') {
+ // 2. PoC
+ // console.log(part, JSON.stringify(data));
+ airinterface[part] = data['mw-air-interface-pac'][0]['air-interface-current-problem-list'];
+ }
+ }
+ });
+ data.revision = undefined;
+ };
+
+ /**
+ * @deprecated since all conditaional packages are handle the same way even for
+ * 3rd and 4th PoC model - 2nd PoC model not supported any more.
+ * @param {*} lpId
+ * @param {*} part
+ * @param {*} data
+ */
+ var updateStructure = function(lpId, part, data) {
+ // console.log(JSON.stringify(data), lpId);
+ $scope.structures.map(function(structure){
+ // console.log(JSON.stringify(structure));
+ if (structure['layer-protocol'] === lpId) {
+ if (Object.keys(data)[0].contains('tructure')) {
+ structure[part] = data;
+ } else if (part === 'Capability') {
+ // 2. PoC
+ // console.log(part, JSON.stringify(data));
+ structure[part] = data['mw-structure-pac'][0]['structure.capability-list'];
+ } else if (part === 'CurrentProblems') {
+ // 2. PoC
+ // console.log(part, JSON.stringify(data));
+ structure[part] = data['mw-structure-pac'][0]['structure-current-problem-list'];
+ }
+ }
+ });
+ data.revision = undefined;
+ };
+
+ /**
+ * @deprecated since all conditaional packages are handle the same way even for
+ * 3rd and 4th PoC model - 2nd PoC model not supported any more.
+ * @param {*} lpId
+ * @param {*} part
+ * @param {*} data
+ */
+ var updateContainer = function(lpId, part, data) {
+ // console.log(JSON.stringify(data), lpId);
+ $scope.containers.map(function(container){
+ // console.log(JSON.stringify(container));
+ if (container['layer-protocol'] === lpId) {
+ if (Object.keys(data)[0].contains('ontainer') ) {
+ container[part] = data;
+ } else if (part === 'Capability') {
+ // 2. PoC
+ // console.log(part, JSON.stringify(data));
+ container[part] = data['mw-container-pac'][0]['container-capability-list'];
+ } else if (part === 'CurrentProblems') {
+ // 2. PoC
+ // console.log(part, JSON.stringify(data));
+ container[part] = data['mw-container-pac'][0]['container-current-problem-list'];
+ }
+ }
+ });
+ data.revision = undefined;
+ };
+
+ /**
+ * Creates a template of a conditional packages with its subclasses
+ * @param {{pacId: string, layerProtocolId: string, partId:string}} spec - Specification object of a conditional package subclass
+ */
+ var initPac = function(spec) {
+ $scope.pacs[spec.pacId].filter(function(conditionalPackage){
+ return conditionalPackage['layer-protocol'] === spec.layerProtocolId;
+ }).map(function(pac){
+ $scope.parts.map(function(localName){
+ pac[localName] = {id:$mwtnBrowser.getPartGlobalId(spec, localName),localName: localName, data:'No data available'}
+ });
+ });
+ };
+
+ /**
+ * Updates an existing template of a conditional packages with its subclasses
+ * @param {{pacId: string, layerProtocolId: string, partId:string}} spec - Specification object of a conditional package subclass
+ */
+ var updateSubClassData = function(spec, data) {
+ $scope.pacs[spec.pacId].filter(function(conditionalPackage){
+ return conditionalPackage['layer-protocol'] === spec.layerProtocolId;
+ }).map(function(conditionalPackage){
+ conditionalPackage[$mwtnBrowser.getPartLocalId(spec)].data = data[$mwtnBrowser.yangify(spec.partId)];
+ });
+ };
+
+ var updatePart = function(spec, data) {
+ switch (spec.pacId) {
+ case 'ne':
+ updateNe(data);
+ break;
+ case 'forwardingDomain':
+ // TODO $scope.forwardingDomain = new ForwardingDomain(data);
+ break;
+ case 'neCurrentProblems':
+ updateNetworkElementCurrentProblems(data);
+ break;
+ case 'clock':
+ if (data) {
+ $scope.clock = new PtpClock(data);
+ } else {
+ $scope.clock = undefined;
+ }
+ break;
+ case 'ltp':
+ updateLtp(data);
+ break;
+ case 'airinterface':
+ console.warn(JSON.stringify(spec, JSON.stringify(data)));
+ updateAirInterface(spec.layerProtocolId, spec.partId, data);
+ break;
+ case 'structure':
+ console.warn(JSON.stringify(data));
+ updateStructure(spec.layerProtocolId, spec.partId, data);
+ break;
+ case 'container':
+ console.warn(JSON.stringify(data));
+ updateContainer(spec.layerProtocolId, spec.partId, data);
+ break;
+ // 3rd Poc
+ case 'MicrowaveModel-ObjectClasses-AirInterface:MW_AirInterface_Pac':
+ case 'MicrowaveModel-ObjectClasses-PureEthernetStructure:MW_PureEthernetStructure_Pac':
+ case 'MicrowaveModel-ObjectClasses-EthernetContainer:MW_EthernetContainer_Pac':
+ // 4th Poc
+ case 'microwave-model:mw-air-interface-pac':
+ case 'microwave-model:mw-air-interface-diversity-pac':
+ case 'microwave-model:mw-pure-ethernet-structure-pac':
+ case 'microwave-model:mw-hybrid-mw-structure-pac':
+ case 'microwave-model:mw-tdm-container-pac':
+ case 'microwave-model:mw-ethernet-container-pac':
+ case 'onf-ethernet-conditional-packages:ethernet-pac':
+ if (!spec.partId) {
+ initPac(spec);
+ } else {
+ updateSubClassData(spec, data);
+ }
+ break;
+ }
+ };
+
+ // events
+ $scope.status = {ne:false};
+ $scope.spinner = {ne:false};
+ $scope.separator = $mwtnBrowser.separator; //'&nbsp;'
+
+ $scope.collapseAll = function() {
+ // close all groups
+ Object.keys($scope.status).map(function(group){
+ $scope.status[group] = false;
+ });
+ Object.keys($scope.spinner).map(function(group){
+ $scope.spinner[group] = false;
+ });
+ };
+
+ $scope.$watch('status', function(status, oldValue) {
+ Object.keys(status).filter(function(key){
+ return $scope.networkElementId && status[key] && status[key] !== oldValue[key];
+ }).map(function(key){
+ $scope.spinner[key] = true;
+ var info = key.split($scope.separator);
+ var spec = {
+ nodeId: $scope.networkElementId,
+ revision: $scope.revision,
+ pacId: info[0],
+ layerProtocolId: info[1],
+ partId: info[2]
+ };
+ $mwtnBrowser.getPacParts(spec).then(function(success){
+ success = $mwtnBrowser.yangifyObject(success)
+ updatePart(spec, success);
+ $scope.spinner[key] = false;
+ }, function(error){
+ updatePart(spec, error);
+ $scope.spinner[key] = false;
+ });
+ });
+ }, true);
+
+ $scope.$watch('networkElement', function(neId, oldValue) {
+ if (neId && neId !== '' && neId !== oldValue) {
+
+ $scope.collapseAll();
+
+ // clear old data
+ $scope.airinterfaces = [];
+ $scope.structures = [];
+ $scope.containers = [];
+ $scope.onfLtps = [];
+ $scope.clock = undefined;
+
+ $scope.networkElementId = neId;
+ $scope.revision = $scope.mountPoints.filter(function(mountpoint){
+ return mountpoint['node-id'] === neId;
+ }).map(function(mountpoint){
+ $scope.mountpoint = mountpoint;
+ return mountpoint.onfCoreModelRevision;
+ })[0];
+
+ var spec = {
+ nodeId: $scope.networkElementId,
+ revision: $scope.revision,
+ pacId: 'ne'
+ };
+ $mwtnBrowser.getPacParts(spec).then(function(success){
+ updatePart(spec, $mwtnBrowser.yangifyObject(success));
+ }, function(error){
+ updatePart(spec, error);
+ });
+
+ // network element alarms
+ var neAlarms = $scope.mountPoints.filter(function(mountpoint){
+ return mountpoint['node-id'] === neId;
+ }).map(function(mountpoint){
+ return mountpoint.onfCapabilities.filter(function(cap){
+ return cap.module === 'MicrowaveModel-NetworkElement-CurrentProblemList' || cap.module === 'onf-core-model-conditional-packages';
+ });
+ });
+
+ if (neAlarms.length === 1 && neAlarms[0].length === 1 ) {
+ $translate('MWTN_LOADING').then(function (translation) {
+ $scope.neCurrentProblems = translation;
+ });
+ } else {
+ $scope.neCurrentProblems = undefined;
+ }
+
+ // ptp-clock
+ var ptpClock = $scope.mountPoints.filter(function(mountpoint){
+ return mountpoint['node-id'] === neId;
+ }).map(function(mountpoint){
+ return mountpoint.onfCapabilities.filter(function(cap){
+ return cap.module === 'onf-ptp-dataset';
+ });
+ });
+ if (ptpClock.length === 1 && ptpClock[0].length === 1 ) {
+ $translate('MWTN_LOADING').then(function (translation) {
+ $scope.clock = {'translation': translation};
+ });
+ } else {
+ $scope.clock = undefined;
+ }
+
+ }
+ });
+
+ }]);
+
+});
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.module.js b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.module.js
new file mode 100644
index 00000000..d529ca2f
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.module.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 highstreet technologies GmbH and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+define(['angularAMD',
+ 'app/routingConfig',
+ 'app/core/core.services',
+ 'common/config/env.module',
+ 'app/mwtnCommons/mwtnCommons.module',
+ 'app/mwtnCommons/bower_components/angular-clipboard/angular-clipboard'], function(ng) {
+ var mwtnBrowserApp = angular.module('app.mwtnBrowser', ['ui.grid', 'ui.bootstrap', 'app.core', 'ui.router.state', 'config', 'angular-clipboard']);
+
+ mwtnBrowserApp.config(function($stateProvider, $compileProvider, $controllerProvider, $provide, NavHelperProvider, $translateProvider) {
+ mwtnBrowserApp.register = {
+ controller : $controllerProvider.register,
+ directive : $compileProvider.directive,
+ factory : $provide.factory,
+ service : $provide.service
+ };
+
+ NavHelperProvider.addControllerUrl('app/mwtnBrowser/mwtnBrowser.controller');
+ NavHelperProvider.addToMenu('mwtnBrowser', {
+ "link" : "#/pnfBrowser/",
+ "active" : "main.mwtnBrowser",
+ "title" : "pnf Config",
+ "icon" : "fa fa-cogs", // Add navigation icon css class here
+ "page" : {
+ "title" : "pnf Config",
+ "description" : "mwtnBrowser"
+ }
+ });
+
+ var access = routingConfig.accessLevels;
+
+ $stateProvider.state('main.mwtnBrowser', {
+ url: 'pnfBrowser/:nodeId',
+ access: access.admin,
+ views : {
+ content : {
+ templateUrl: 'src/app/mwtnBrowser/templates/frame.tpl.html',
+ controller: 'mwtnBrowserCtrl'
+ }
+ }
+ });
+
+ });
+
+ return mwtnBrowserApp;
+});
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.services.js b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.services.js
new file mode 100644
index 00000000..7cd9dc07
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/mwtnBrowser.services.js
@@ -0,0 +1,37 @@
+/*
+ * @copyright 2017 highstreet technologies and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+define(['app/mwtnCommons/mwtnCommons.module', 'app/mwtnBrowser/mwtnBrowser.module'],function(mwtnBrowserApp) {
+
+ mwtnBrowserApp.register.factory('$mwtnBrowser', function($mwtnCommons, $mwtnDatabase, $mwtnLog) {
+
+ var COMPONENT = '$mwtnBrowser';
+ $mwtnLog.info({component: COMPONENT, message: '$mwtnBrowser started!'});
+
+ var service = {};
+
+ service.separator = $mwtnCommons.separator;
+
+ service.parts = $mwtnCommons.parts;
+ service.getPacParts = $mwtnCommons.getPacParts;
+ service.getModules = $mwtnDatabase.getModules;
+ service.getPartGlobalId = $mwtnCommons.getPartGlobalId;
+ service.getPartLocalId = $mwtnCommons.getPartLocalId;
+ service.getViewData = $mwtnCommons.getViewData;
+ service.getForwardingConstruct = $mwtnCommons.getForwardingConstruct;
+ service.layerProtocolNameOrder = $mwtnCommons.layerProtocolNameOrder;
+ service.yangify = $mwtnCommons.yangify;
+ service.yangifyObject = $mwtnCommons.yangifyObject;
+
+ service.refreshPTP = function() {
+ console.error('refresh ptp');
+ }
+ return service;
+ });
+
+});
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/frame.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/frame.tpl.html
new file mode 100644
index 00000000..6d43dbd8
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/frame.tpl.html
@@ -0,0 +1,191 @@
+<ht-header help-link='sdnr/pnfConfig/0.4.0/README.md'></ht-header>
+<mwtn-select-network-element></mwtn-select-network-element>
+
+<div class="owl container" ng-if="networkElements.length !== 0 && networkElement" style="width: 100%;">
+ <div class="row">
+ <uib-accordion close-others="oneAtATime">
+ <div class="col-md-12">
+ <div uib-accordion-group class="panel-primary" is-open="status.ne">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status.ne, 'fa-chevron-right': !status.ne}"></i>
+ <span>{{'MWTN_NETWORKELEMENT' | translate}} '{{onfNetworkElement.getName()}}' </span>
+ <span> (#{{'MWTN_LTPS' | translate}}: {{onfNetworkElement.getLogicalTerminationPoints().length}})</span>
+ <i class="fa fa-spinner fa-pulse" ng-show="spinner.ne"></i>
+ </uib-accordion-heading>
+ <mwtn-json-viewer network-element="networkElement" data="onfNetworkElement.getData()" ne="true" ng-if="status.ne"></mwtn-json-viewer>
+ <br/>
+
+ <uib-accordion close-others="oneAtATime">
+ <div uib-accordion-group class="panel-default" is-open="status.neCurrentProblems" ng-if="neCurrentProblems">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status.neCurrentProblems, 'fa-chevron-right': !status.neCurrentProblems}"></i>
+ <span>{{'MWTN_CURRENT_PROBLEM_LIST' | translate}}</span>
+ <i class="fa fa-spinner fa-pulse" ng-show="spinner.neCurrentProblems"></i>
+ </uib-accordion-heading>
+
+ <mwtn-grid network-element="networkElement" data="neCurrentProblems" ng-if="neCurrentProblems && !spinner.neCurrentProblems"></mwtn-grid>
+ </div>
+
+ <div uib-accordion-group class="panel-default" is-open="status.forwardingDomain" ng-show="forwardingDomain">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status.forwardingDomain, 'fa-chevron-right': !status.forwardingDomain}"></i>
+ <span>{{'MWTN_FORWARDING_DOMAIN' | translate}}</span>
+ <i class="fa fa-spinner fa-pulse" ng-show="spinner.forwardingDomain"></i>
+ </uib-accordion-heading>
+
+ <mwtn-json-viewer network-element="networkElement" data="forwardingDomain" ng-if="status.forwardingDomain"></mwtn-json-viewer>
+ </div>
+
+ <div uib-accordion-group class="panel-default" is-open="status.forwardingConstructs" ng-show="forwardingConstructs">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status.forwardingConstructs, 'fa-chevron-right': !status.forwardingConstructs}"></i>
+ <span>{{'MWTN_FORWARDING_CONSTRUCTS' | translate}}</span>
+ <i class="fa fa-spinner fa-pulse" ng-show="spinner.forwardingConstructs"></i>
+ </uib-accordion-heading>
+
+ <mwtn-grid network-element="networkElement" data="forwardingConstructs" ng-if="forwardingConstructs && !spinner.forwardingConstructs"></mwtn-grid>
+
+ <!-- create fc -->
+ <div class="row">
+ <div class="col col-md-3">
+ <label class="owl-dark" for="vlan">{{'MWTN_LTP1' | translate}}</label><br/>
+ <select class="form-control" ng-model="fcCreation.ltp1">
+ <option ng-repeat="ltp in forwardingDomain.ltp" value="{{ltp}}">{{ltp}}</option>
+ </select>
+ </div>
+ <div class="col col-md-3">
+ <label class="owl-dark" for="vlan">{{'MWTN_LTP2' | translate}}</label><br/>
+ <select class="form-control" ng-model="fcCreation.ltp2">
+ <option ng-repeat="ltp in forwardingDomain.ltp" value="{{ltp}}">{{ltp}}</option>
+ </select>
+ </div>
+ <div class="col col-md-1 form-group">
+ <label class="owl-dark" for="vlan">{{'MWTN_SERVICE_ID' | translate}}</label><br/>
+ <input class="form-control" type="number" value="42" id="example-number-input" ng-model="fcCreation.vlan">
+ </div>
+ <div class="col col-md-2">
+ <label style="color:white;" for="create">create</label><br/>
+ <button type="button" class="btn btn-warning" ng-click="createForwardingConstruct()">
+ <i class="fa fa-plus" aria-hidden="true"></i>
+ <span style="color:white;">{{'MWTN_CREATE' | translate}}</span>
+ </button>
+ </div>
+ <div class="col col-md-3">
+ <span class="owl-dark" ng-if="!fcCreation.error">{{fcCreation.info}}</span>
+ <span class="error" ng-if="fcCreation.error">{{fcCreation.error}}</span>
+ </div>
+ </div>
+
+ <!-- delete fc -->
+ <div class="row">
+ <div class="col col-md-6 form-group">
+ <label class="owl-dark" for="vlan">{{'MWTN_FC_UUID' | translate}}</label><br/>
+ <select class="form-control" ng-model="fcDeletion.ltp">
+ <option ng-repeat="fc in forwardingConstructs" value="{{fc.uuid}}">{{fc.uuid}}</option>
+ </select>
+ </div>
+ <div class="col col-md-2 col-md-offset-1" >
+ <label style="color:white;" for="delete">delete</label><br/>
+ <button type="button" class="btn btn-danger" ng-click="deleteForwardingConstruct()">
+ <i class="fa fa-times" aria-hidden="true"></i>
+ <span style="color:white;">{{'MWTN_DELETE' | translate}}</span>
+ </button>
+ </div>
+ <div class="col col-md-3">
+ <span class="owl-dark" ng-if="!fcDeletion.error">{{fcDeletion.info}}</span>
+ <span class="error" ng-if="fcDeletion.error">{{fcDeletion.error}}</span>
+ </div>
+ </div>
+
+ </div>
+
+ <div ng-repeat="ltp in onfLtps" ng-show="status.ne" uib-accordion-group class="panel-default" is-open="status['ltp' + separator + ltp.getData().uuid]">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status['ltp' + separator + ltp.getData().uuid], 'fa-chevron-right': !status['ltp' + separator + ltp.getData().uuid]}"></i>
+ <span>{{'MWTN_LTP' | translate}}(</span>
+ <b>{{ltp.getLayerProtocols()[0].getItuLabel().toUpperCase()}}</b>
+ <span>): {{ltp.getName()}} (ID: {{ltp.getId()}})</span>
+ </uib-accordion-heading>
+
+ <mwtn-json-viewer network-element="networkElement" data="ltp.getData()" ng-if="status['ltp' + separator + ltp.getData().uuid]"></mwtn-json-viewer>
+ </div>
+ </uib-accordion>
+ </div>
+
+ <div uib-accordion-group class="panel-default" is-open="status.clock" ng-if="clock">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status.clock, 'fa-chevron-right': !status.clock}"></i>
+ <span>{{'MWTN_CLOCK' | translate}}</span>
+ <i class="fa fa-spinner fa-pulse" ng-show="spinner.clock"></i>
+ </uib-accordion-heading>
+
+ <!-- <mwtn-json-viewer network-element="networkElement" data="clock.getData()" ng-if="clock.getData() && !spinner.clock"></mwtn-json-viewer> -->
+ <mwtn-ptp-clock-viewer network-element="networkElement" data="clock.getData()" ng-if="clock.getData() && !spinner.clock"></mwtn-ptp-clock-viewer>
+ </div>
+
+
+ </div>
+
+
+ </uib-accordion>
+ </div>
+
+ <div class="row" ng-repeat="orderedPac in orderedPacs" ng-if="pacs[orderedPac]">
+ <uib-accordion close-others="oneAtATime">
+ <div ng-class="{ 'col-md-12': pacs[orderedPac].length === 1, 'col-md-6': pacs[orderedPac].length !== 1 }" style="margin-top: 5px;"
+ ng-repeat="pac in pacs[orderedPac]">
+ <div uib-accordion-group class="panel-primary" is-open="status[ [orderedPac, pac['layer-protocol']].join(separator) ]">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status[ [orderedPac, pac['layer-protocol']].join(separator) ], 'fa-chevron-right': !status[ [orderedPac, pac['layer-protocol']].join(separator) ]}"></i>
+ <span>{{ ['mwtn', orderedPac].join('-').replaceAll('-', '_').toUpperCase() | translate }} '{{pac['layer-protocol']}}'</span>
+ </uib-accordion-heading>
+
+ <div ng-repeat="part in parts" uib-accordion-group class="panel-default" is-open="status[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]">
+ <uib-accordion-heading>
+ <i class="fa" ng-class="{'fa-chevron-down': status[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ], 'fa-chevron-right': !status[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]}"></i>
+ <span>{{ ['mwtn', part].join('-').replaceAll('-', '_').toUpperCase() | translate}}</span>
+ <i class="fa fa-spinner fa-pulse" ng-show="spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]"></i>
+ </uib-accordion-heading>
+
+
+ <!-- current-problem-list -->
+ <mwtn-grid network-element="networkElement" data="pac[part].data['current-problem-list']" ng-if="pac[part].data['current-problem-list'] && !spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]"></mwtn-grid>
+ <div ng-if="pac[part].data['current-problem-list'].length === 0">Alarm free ;)</div>
+
+ <!-- PM Current -->
+ <mwtn-json-viewer network-element="networkElement" data="pac[part].data['current-performance-data-list'][0]"
+ path="[orderedPac, pac['layer-protocol'], pac[part].id].join(separator)"
+ ng-if="part === 'current-performance' && pac[part].data && !spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]"></mwtn-json-viewer>
+ <hr ng-if="part === 'current-performance' && pac[part].data && !spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]">
+ <mwtn-json-viewer network-element="networkElement" data="pac[part].data['current-performance-data-list'][1]"
+ path="[orderedPac, pac['layer-protocol'], pac[part].id].join(separator)"
+ ng-if="part === 'current-performance' && pac[part].data && !spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]"></mwtn-json-viewer>
+
+ <!-- PM history -->
+ <mwtn-grid network-element="networkElement" data="pac[part].data['historical-performance-data-list']"
+ path="[orderedPac, pac['layer-protocol'], pac[part].id].join(separator)"
+ ng-if="pac[part].data['historical-performance-data-list'] && !spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]"></mwtn-grid>
+
+ <!-- else -->
+ <mwtn-json-viewer network-element="networkElement" data="pac[part].data"
+ path="[orderedPac, pac['layer-protocol'], pac[part].id].join(separator)"
+ ng-if="status[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator)] &&
+ pac[part].data &&
+ part !== 'current-problems' &&
+ part !== 'current-performance' &&
+ part !== 'historical-performances' &&
+ !spinner[ [orderedPac, pac['layer-protocol'], pac[part].id].join(separator) ]"></mwtn-json-viewer>
+
+ </div>
+ </div>
+ </div>
+ <hr class="white">
+ </uib-accordion>
+ </div>
+
+</div>
+
+<hr />
+<div class="owl">
+ <span class="white">ONAP SDN-R | ONF Wireless for @distversion@ - Build: @buildtime@</span>
+</div>
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpClockViewer.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpClockViewer.tpl.html
new file mode 100644
index 00000000..1a6849df
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpClockViewer.tpl.html
@@ -0,0 +1,66 @@
+<div class="owl">
+ <div class="row text-right">
+ <div class="form-group">
+ <button class="btn btn-default" type="button" clipboard supported="myClipboard.supported" text="myClipboard.getJson()"
+ on-copied="myClipboard.copyToClipboard()" on-error="myClipboard.error(err)">
+ <i class="fa fa-clipboard" aria-hidden="true"></i>
+ </button>
+ <button class="btn btn-default" type="button" ng-if="replace">
+ <i class="fa fa-pencil-square-o pointer" aria-hidden="true" ng-click="openConfigView()" ></i>
+ </button>
+ <div>
+ </div>
+</div>
+<div class="owl">
+
+<!--
+ <div class="row" ng-repeat="(key, value) in viewData track by $index" ng-show="value.value !== undefined">
+ <span class="owl-dark">{{key | json}}</span><br/>
+ <span class="owl-dark">{{value | json}}</span><br/>
+ <span class="owl-dark">{{viewData[key].labelId | translate}}</span>
+ <span class="owl-dark">{{viewData['instance-number'].labelId | translate}}</span>
+ </div> -->
+
+ <!-- instance-number - ->
+ <div class="row">
+ <div class="col col-md-3 text-right" title="{{viewData['instance-number'].description}}">
+ <span class="owl-dark">{{viewData['instance-number'].labelId | translate}}</span>
+ </div>
+ <div class="col col-md-4">
+ <b>{{viewData['instance-number'].value}}</b>
+ </div>
+ </div> -->
+
+ <!-- current-ds -->
+ <div class="row">
+ <div class="column col-md-6 text-left" title="{{viewData['default-ds'].description}}">
+ <b>{{viewData['default-ds'].labelId | translate}}</b>
+ <i class="fa fa-pencil-square-o pointer" aria-hidden="true" ng-click="show(viewData['default-ds'].value)"></i>
+ <br/>
+ <mwtn-json-viewer network-element="networkElement" data="viewData['default-ds'].value" no-buttons="true" ng-if="viewData['default-ds'].value"></mwtn-json-viewer>
+ <hr/>
+ </div>
+
+ <div class="column col-md-6 text-left" title="{{viewData['parent-ds'].description}}">
+ <b>{{viewData['parent-ds'].labelId | translate}}</b>
+ <br/>
+ <mwtn-json-viewer network-element="networkElement" data="viewData['parent-ds'].value" no-buttons="true" ng-if="viewData['parent-ds'].value"></mwtn-json-viewer>
+ <hr/>
+ </div>
+
+ <div class="column col-md-6 text-left" ng-repeat="key in ['current-ds', 'time-properties-ds']" title="{{viewData[key].description}}">
+ <b>{{viewData[key].labelId | translate}}</b>
+ <br/>
+ <mwtn-json-viewer network-element="networkElement" data="viewData[key].value" no-buttons="true" ng-if="viewData[key].value"></mwtn-json-viewer>
+ <hr/>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col col-md-12 text-left" >
+ <b>{{'MWTN_PORT_DS_LIST' | translate}}</b>
+ <br/>
+ <mwtn-ptp-ports network-element="networkElement" data="viewData['port-ds-list'].value" path="path"></mwtn-ptp-ports>
+ </div>
+ </div>
+</div> \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpPorts.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpPorts.tpl.html
new file mode 100644
index 00000000..2751ffcb
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/mwtnPtpPorts.tpl.html
@@ -0,0 +1,23 @@
+<div class="owl co1ntainer" >
+
+ <div class="row">
+ <div class="col-md-12">
+
+ <div ng-if="info !== false">
+ <span class="owl-dark">{{info}}</span>
+ </div>
+
+ <div ui-grid="gridOptions"
+ ui-grid-exporter
+ ui-grid-selection
+ ui-grid-pinning
+ ui-grid-resize-columns
+ ui-grid-move-columns
+ ui-grid-auto-resize
+ class="mwtn-grid"
+ ng-style="getTableHeight()"></div>
+
+ </div>
+ </div>
+
+</div> \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpDefaultDsConfigView.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpDefaultDsConfigView.tpl.html
new file mode 100644
index 00000000..cb0e40c2
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpDefaultDsConfigView.tpl.html
@@ -0,0 +1,45 @@
+<div class="modal-header">
+ <h3 class="modal-title" id="modal-title">{{'MWTN_PTP_DEFAULT_DS_CONFIGURATION' | translate}}</h3>
+</div>
+<div class="modal-body" id="modal-body">
+ <div class="container" style="width:100%">
+ <div class="row">
+ <div class="col-md-3 text-right" >
+ {{'MWTN_NETWORKELEMENT' | translate}}
+ </div>
+ <div class="col-md-9">
+ <b>{{data.networkElement}}</b>
+ </div>
+ </div>
+ <hr/>
+ <div class="row">
+
+ <div ng-repeat="(key, item) in viewData" ng-if="item.visible === true">
+
+ <!-- text, number, combo -->
+ <div class="col-md-3 text-right radio">{{item.labelId | translate}}</div>
+ <div ng-class="{'col-md-2':item.unit, 'col-md-3':!item.unit}" class="form-group" ng-if="item.controlType !== 'checkbox' && getType(item.controlType) !== 'array'">
+ <input class="form-control" type="{{item.controlType}}" ng-model="item.value" ng-disabled="item['is-read-only'] === true" min="{{item.min}}" max="{{item.max}}"></input>
+ </div>
+
+ <div class="col-md-3 checkbox" ng-if="item.controlType === 'checkbox' "><input type="checkbox" ng-model="item.value" ng-disabled="item['is-read-only'] === true" /></div>
+ <div ng-class="{'col-md-2':item.unit, 'col-md-3':!item.unit}" class="form-group" ng-if="getType(item.controlType) === 'array'">
+ <select class="form-control" ng-model="item.value" ng-disabled="item['is-read-only'] === true">
+ <option ng-repeat="option in item.controlType track by $index" value="{{option}}">{{option}}</option>
+ </select>
+ </div>
+ <div class="col-md-1 radio" ng-if="item.unit">
+ <span class="owl-dark">{{item.unit}}</span>
+ </div>
+
+ </div>
+ </div>
+</div>
+<div class="modal-footer">
+ <div class="{{applied.class}}", ng-show="applied">{{applied.text}}</div>
+ <button class="btn btn-primary" type="button" ng-click="ok()">
+ <span style="color: white;">{{'MWTN_APPLY' | translate}}</span>
+ <i class="pull-right fa fa-spinner fa-pulse" ng-show="processing"></i>
+ </button>
+ <button class="btn btn-warning" type="button" ng-click="cancel()">{{'MWTN_CLOSE' | translate}}</button>
+</div> \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpPortConfigView.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpPortConfigView.tpl.html
new file mode 100644
index 00000000..5d7d9df5
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/mwtnBrowser-module/src/main/resources/mwtnBrowser/templates/ptpPortConfigView.tpl.html
@@ -0,0 +1,53 @@
+<div class="modal-header">
+ <h3 class="modal-title" id="modal-title">{{'MWTN_PTP_PORT_CONFIGURATION' | translate}}</h3>
+</div>
+<div class="modal-body" id="modal-body">
+ <div class="container" style="width:100%">
+ <div class="row">
+ <div class="col-md-3 text-right" >
+ {{'MWTN_NETWORKELEMENT' | translate}}
+ </div>
+ <div class="col-md-9">
+ <b>{{data.networkElement}}</b>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-3 text-right" >
+ {{'MWTN_PORT_IDENTITY' | translate}}
+ </div>
+ <div class="col-md-9">
+ <b>{{data.value['port-identity']['clock-identity']}}#{{data.value['port-identity']['port-number']}}</b>
+ </div>
+ </div>
+ <hr/>
+ <div class="row">
+
+ <div ng-repeat="(key, item) in viewData" ng-if="item.visible === true">
+
+ <!-- text, number, combo -->
+ <div class="col-md-3 text-right radio">{{item.labelId | translate}}</div>
+ <div ng-class="{'col-md-2':item.unit, 'col-md-3':!item.unit}" class="form-group" ng-if="item.controlType !== 'checkbox' && getType(item.controlType) !== 'array'">
+ <input class="form-control" type="{{item.controlType}}" ng-model="item.value" ng-disabled="item['is-read-only'] === true" min="{{item.min}}" max="{{item.max}}"></input>
+ </div>
+
+ <div class="col-md-3 checkbox" ng-if="item.controlType === 'checkbox'"><input type="checkbox" ng-model="item.value" /></div>
+ <div ng-class="{'col-md-2':item.unit, 'col-md-3':!item.unit}" class="form-group" ng-if="getType(item.controlType) === 'array'">
+ <select class="form-control" ng-model="item.value" ng-disabled="item['is-read-only'] === true">
+ <option ng-repeat="option in item.controlType track by $index" value="{{option}}">{{option}}</option>
+ </select>
+ </div>
+ <div class="col-md-1 radio" ng-if="item.unit">
+ <span class="owl-dark">{{item.unit}}</span>
+ </div>
+
+ </div>
+ </div>
+</div>
+<div class="modal-footer">
+ <div class="{{applied.class}}", ng-show="applied">{{applied.text}}</div>
+ <button class="btn btn-primary" type="button" ng-click="ok()">
+ <span style="color: white;">{{'MWTN_APPLY' | translate}}</span>
+ <i class="pull-right fa fa-spinner fa-pulse" ng-show="processing"></i>
+ </button>
+ <button class="btn btn-warning" type="button" ng-click="cancel()">{{'MWTN_CLOSE' | translate}}</button>
+</div> \ No newline at end of file
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/pom.xml b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/pom.xml
new file mode 100644
index 00000000..7584afdc
--- /dev/null
+++ b/sdnr/wireless-transport/code-Carbon-SR1/ux/mwtnBrowser/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.highstreet.technologies.odl.dlux</groupId>
+ <artifactId>mwtnBrowser</artifactId>
+ <version>0.5.1-SNAPSHOT</version>
+ <name>${prefix} ${project.artifactId}</name>
+ <packaging>pom</packaging>
+
+ <parent>
+ <artifactId>mwtn</artifactId>
+ <groupId>com.highstreet.technologies.odl.dlux</groupId>
+ <version>0.5.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <modules>
+ <module>mwtnBrowser-module</module>
+ <module>mwtnBrowser-bundle</module>
+ </modules>
+</project>