aboutsummaryrefslogtreecommitdiffstats
path: root/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp')
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/WEB-INF/views/index.jsp69
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/app.js47
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-validationTest-controller.js243
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-viewreport-controller.js171
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-validationTest-service.js78
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-viewReport-service.js78
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/package.json32
7 files changed, 718 insertions, 0 deletions
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/WEB-INF/views/index.jsp b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/WEB-INF/views/index.jsp
new file mode 100644
index 0000000..f479ff9
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/WEB-INF/views/index.jsp
@@ -0,0 +1,69 @@
+<!-- /*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+ -->
+<!-- index.html -->
+<!DOCTYPE html>
+<html ng-app="myApp">
+ <head>
+ <meta charset="utf-8">
+ <!-- CSS -->
+ <script src="./node_modules/jquery.min.js"></script>
+ <script src="./node_modules/tether.min.js" ></script>
+ <link rel="stylesheet" href="./node_modules/bootstrap-3.3.7/dist/css/bootstrap.min.css">
+ <script src="./node_modules/bootstrap-3.3.7/dist/js/bootstrap.min.js"></script>
+ <link rel="stylesheet" href="/style/sdnc-style.css">
+ <!-- JS -->
+ <!-- load angular,date-time picker,pagination,growl and ui-router -->
+ <script src = "./node_modules/angular.min.js"></script>
+ <script src = "./node_modules/angular-route.min.js"></script>
+ <script src="./node_modules/angular-utils-pagination/dirPagination.js"></script>
+ <script src="./node_modules/ng-csv/build/ng-csv.min.js"></script>
+ <script src="./node_modules/angular-sanitize.min.js"></script>
+ <link rel="stylesheet" href="./node_modules/angularjs-datetime-picker/angularjs-datetime-picker.css" />
+ <script src="./node_modules/angularjs-datetime-picker/angularjs-datetime-picker.js"></script>
+ <script data-require="jquery@*" data-semver="2.1.4" src="https://code.jquery.com/jquery-2.1.4.js"></script>
+ <script src="./node_modules/angular-utils-pagination/dirPagination.js"></script>
+ <script src="./js/app.js"></script>
+ <script src="./js/sdnc-controller/sdnc-viewreport-controller.js"></script>
+ <script src="./js/sdnc-controller/sdnc-validationTest-controller.js"></script>
+ <script src="./js/sdnc-services/sdnc-viewReport-service.js"></script>
+ <script src="./js/sdnc-services/sdnc-validationTest-service.js"></script>
+ <script src="./node_modules/angular-growl.min.js" ></script>
+ <script src="./node_modules/ng-ip-address/ngIpAddress.min.js" ></script>
+
+ <link rel="stylesheet" type="text/css" href="./node_modules/angular-growl.min.css">
+ <link rel="stylesheet" href="/style/w3.css">
+ </head>
+ <!-- apply our angular app -->
+ <body>
+ <div class="container">
+ <nav role="navigation" class="navbar navbar-default">
+ <div class="navbar-header" style="background-color:#DCDCDC;font-size: 15px;font-weight: bold;">
+ <ul class="nav navbar-nav">
+ <li ng-class='active'><a href="#testValidation">CERTIFICATION TEST</a></li>
+ <li><a href="#testReports">VIEW ALL REPORTS</a></li>
+ <ul>
+ </div>
+ <nav>
+ <!-- views will be injected here -->
+ <div ng-view></div>
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/app.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/app.js
new file mode 100644
index 0000000..82fac46
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/app.js
@@ -0,0 +1,47 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+// app.js This is first entry point for the application
+// =============================================================================
+var myApp = angular.module('myApp', ['ngRoute', 'ngSanitize', 'ngCsv', 'angularUtils.directives.dirPagination', 'angular-growl','ng-ip-address']);
+
+// configuring our routes
+// =============================================================================
+myApp.config(['$routeProvider', function($routeProvider) {
+
+ //Called when user select pre validation test from the UI
+ $routeProvider.
+ when('/testValidation', {
+ templateUrl: 'form-validationTest.html',
+ controller: 'TestController'
+ }).
+ when('/', {
+ templateUrl: 'form-validationTest.html',
+ controller: 'TestController'
+ }).
+ //Called when user select view test report from the UI
+ when('/testReports', {
+ templateUrl: 'form-viewReport.html',
+ controller: 'ReportController'
+ }).
+ otherwise({
+ redirectTo: 'form-validationTest.html'
+ });
+}]); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-validationTest-controller.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-validationTest-controller.js
new file mode 100644
index 0000000..9d3f253
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-validationTest-controller.js
@@ -0,0 +1,243 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+myApp.controller('TestController', ['$scope', '$http', 'growl', 'viewReportService', 'validationTestService', function($scope, $http, growl, viewReportService, validationTestService) {
+
+ $scope.showTestReport = false;
+
+ //Input data for validation test dropdwon
+ var validationTestList = [{
+ "typeId": 1,
+ "validationType": "Network Layer",
+ "Selected": false
+ },
+ {
+ "typeId": 2,
+ "validationType": "Protocol Layer",
+ "Selected": false
+ }
+ ];
+
+ $scope.validationTestList = validationTestList;
+
+
+ $scope.getselectval = function() {
+ $scope.selectedvalues = 'Name: ' + $scope.selitem.validationType + ' Id: ' + $scope.selitem.typeId;
+ }
+
+ $scope.showError = false;
+ $scope.errorMessage = "";
+ $scope.showSuccess = false;
+ $scope.successMessage = "";
+ $scope.showWarning = false;
+ $scope.warningMessage = "";
+ $scope.showInfo = false;
+ $scope.infoMessage = "";
+ $scope.ShowResult = false;
+ $scope.allowTestSelection = false;
+ $scope.hostNamePattern = /([a-z0-9](.[a-z0-9-]*[a-z0-9]))/;
+
+
+ //service call to fetch the all the test name
+ $scope.getAllVNF = function() {
+
+ validationTestService.getAllVNF().then(function(data) {
+ if (data != null) {
+ console.log(data);
+ $scope.objvnfList = data.vnfList;
+ console.log("--TestController:getAllVNF called--" + $scope.objvnfList);
+ $scope.allowTestSelection = true;
+ } else {
+ $scope.showWarninf = true;
+ $scope.warningMessage = "No VNF is eligible for confirgruation!!!";
+ growl.error($scope.warningMessage, {
+ title: 'Warning!'
+ });
+ }
+ });
+ };
+ $scope.getAllVNF();
+
+ //Called when user selects a test type
+ $scope.updateSelection = function(position, items, valType) {
+ angular.forEach(items, function(val, index) {
+ if (position != index)
+ val.checked = false;
+ $scope.selectedTest = valType;
+ console.log("--TestController::updateSelection--", $scope.selectedTest);
+ });
+
+ if ($scope.IPAddress != null && $scope.HostName != null && valType != null) {
+ $scope.showError = false;
+ }
+ }
+
+
+ //Called when user clicks on runtest
+ $scope.runTest = function() {
+
+ $scope.showError = false;
+ $scope.vnfSelected = [];
+ $scope.testSelected = [];
+
+ var message = "";
+ for (var i = 0; i < $scope.validationTestList.length; i++) {
+ if ($scope.validationTestList[i].Selected) {
+ var typeId = $scope.validationTestList[i].typeId;
+ var validationType = $scope.validationTestList[i].validationType;
+ message += "typeId: " + typeId + " validationType: " + validationType + "\n";
+ console.log("--TestController::Runtest--", message);
+ var testDetails = {};
+ testDetails.typeId = typeId;
+ testDetails.validationType = validationType;
+ $scope.testSelected.push(testDetails);
+ }
+ }
+ console.log("--TestController::Runtest--", JSON.stringify($scope.testSelected));
+
+ var vnfDetails = {};
+ if ($scope.IPAddress != null && $scope.HostName != null && $scope.testSelected.length >= 1) {
+ vnfDetails.IpAddress = $scope.IPAddress;
+ vnfDetails.HostName = $scope.HostName;
+ $scope.vnfSelected.push(vnfDetails);
+ console.log("--TestController::Runtest--", JSON.stringify($scope.vnfSelected));
+
+ //Call the validation test service with json file and testType as the parameter
+
+ validationTestService.runPretest($scope.vnfSelected, $scope.testSelected).then(function(response) {
+ console.log("--TestController::runTest--", JSON.stringify(response));
+ //in case of success, build the model object to store the service output here
+ if (response.status === 200) {
+ if (response.preTestResponse != null && response.preTestResponse.length >= 1) {
+ $scope.ShowResult = true;
+ $scope.createTestModel(response.preTestResponse);
+ $scope.showMessage(response.preTestResponse);
+
+ } else {
+ console.log(response);
+ $scope.showError = true;
+ $scope.errorMessage = "Something went wrong!!!";
+ growl.error($scope.errorMessage, {
+ title: 'Error!'
+ });
+ }
+ } else {
+ console.log(response);
+ $scope.showError = true;
+ $scope.errorMessage = "Pre test validation failed!!! Check the report for more details";
+ growl.error($scope.errorMessage, {
+ title: 'Error!'
+ });
+ }
+ },
+ function(response) {
+ console.log("--TestController--", response);
+ });
+ } else {
+ $scope.showError = true;
+ $scope.errorMessage = "Please provide the inputs for VNF and test to be performed!!";
+ growl.error($scope.errorMessage, {
+ title: 'Error!'
+ });
+ }
+
+ };
+
+ $scope.showMessage=function(data){
+
+ if(angular.isDefined(data) && data.length>=1){
+
+ angular.forEach(data, function(value, key){
+ if(value.status == "unreachable"){
+ console.log("--TestController::showMessage--",value.status);
+ $scope.showError = true;
+ $scope.errorMessage = "PreTest validation Failed, Please check logs for further details!!!";
+ growl.error($scope.errorMessage, {
+ title: 'Error!'
+ });
+ }
+ else
+ {
+ $scope.showSuccess = true;
+ $scope.successMessage = "Pre test validation completed!!";
+ growl.success($scope.successMessage, {
+ title: 'Success!'
+ });
+ }
+
+ });
+
+ }
+ }
+
+ //Function to build the UI model to be shown
+ $scope.createTestModel = function(result) {
+
+ $scope.showError = false;
+ $scope.showWarning = false;
+ $scope.objPreTestModel = result;
+ $scope.objPreTest = [];
+
+
+ if ($scope.objPreTestModel.length > 1) {
+ for (var i = 0; i < $scope.objPreTestModel.length; i++) {
+ var objTestReport = {};
+ objTestReport.ipaddress = $scope.objPreTestModel[i].ipaddress;
+ objTestReport.status = $scope.objPreTestModel[i].status;
+ objTestReport.testtype = $scope.objPreTestModel[i].testtype;
+ objTestReport.statistics = $scope.objPreTestModel[i].statistics;
+ objTestReport.avgTime = $scope.objPreTestModel[i].avgTime;
+
+
+ if ($scope.objPreTestModel[i].testtype === "Network Layer") {
+ if (objTestReport.statistics != null) {
+ //fetching the statistics to show in progress bar
+ var statistics = objTestReport.statistics;
+ statistics = statistics.split("%");
+ objTestReport.statistics = statistics[0];
+ if (objTestReport.statistics == 0) {
+ objTestReport.statisticPer = parseInt(objTestReport.statistics) + 50;
+ } else
+ objTestReport.statisticPer = objTestReport.statistics;
+ }
+
+ //fetching the avg time to show in progress bar
+ if (objTestReport.avgTime != null) {
+ var avgTime = objTestReport.avgTime;
+ avgTime = avgTime.split("=");
+ var Testtime = avgTime[1];
+ objTestReport.avgTime = Testtime.slice(0, -2).trim();
+ console.log("--TestController::createTestModel--", objTestReport.avgTime);
+ if (objTestReport.avgTime < 50) {
+ objTestReport.avgTimePer = parseInt(objTestReport.avgTime) + 10;
+ } else
+ objTestReport.avgTimePer = objTestReport.avgTime;
+
+ }
+ }
+ $scope.objPreTest.push(objTestReport);
+ console.log("--TestController::createTestModel--", JSON.stringify($scope.objPreTest));
+ }
+ }
+ console.log("--TestController::createTestModel::final PreTestModel--" + JSON.stringify($scope.objPreTest));
+
+ }
+
+}]); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-viewreport-controller.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-viewreport-controller.js
new file mode 100644
index 0000000..a3eae18
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-controller/sdnc-viewreport-controller.js
@@ -0,0 +1,171 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+myApp.controller('ReportController', ['$scope', '$http', 'viewReportService', 'growl', function($scope, $http, viewReportService, growl) {
+ $scope.isDisabled = true;
+ $scope.pagination = false;
+ $scope.selectedDevice;
+ $scope.ShowResult = false;
+ $scope.dateValidation = false;
+ $scope.NoSearchResult = false;
+ $scope.showError = false;
+ $scope.errorMessage = "";
+ $scope.showSuccess = false;
+ $scope.successMessage = "";
+ $scope.showWarning = false;
+ $scope.warningMessage = "";
+ $scope.showExecutionDetails = true;
+
+ //THIS FUNCTION WILL BE CALLED WHEN USER CLICK SUBMIT FROM UI
+ $scope.getReports = function(deviceName, startdate, enddate) {
+
+ $scope.ShowResult = false;
+ if (new Date(startdate) > new Date(enddate)) {
+ $scope.dateValidation = true;
+ $scope.showError = true;
+ $scope.errorMessage = "Start date cannot be greated than End date";
+ growl.error($scope.errorMessage, {
+ title: 'Error!'
+ });
+ return false;
+ }
+ var date = new Date(startdate);
+ if (angular.isDefined(deviceName)) {
+ $scope.DeviceName = deviceName;
+ }
+ if (angular.isDefined(startdate)) {
+ $scope.startDate = startdate;
+ }
+ if (angular.isDefined(enddate)) {
+ $scope.endDate = enddate;
+ }
+
+ //to generate the dynamic file name while downloading the report
+ //var date = new Date();
+ // $scope.fileName = $scope.TestName + " " + $scope.TestName + date.csv;
+ // console.log("FileName", $scope.fileName);
+
+ if (deviceName != null && startdate != null && enddate != null) {
+
+ //service call to fetch the reports start date,end date,test name
+ viewReportService.getData($scope.startDate, $scope.endDate, $scope.DeviceName).then(function(result) {
+ console.log("--ReportController::getdata called from controler--", JSON.stringify(result.data));
+ if (result.status == 200) {
+ if (result.data != null && result.data.length >= 1) {
+ //in case of success, build the model object to store the service output here
+ $scope.createTestReportModel(result.data);
+ } else {
+ $scope.ShowResult = false;
+ $scope.showWarning = true;
+ $scope.warningMessage = "No result found for specified Device name !!";
+ growl.warning($scope.warningMessage, {
+ title: 'Warning!'
+ });
+ }
+ } else {
+ $scope.ShowResult = false;
+ $scope.showWarning = true;
+ $scope.warningMessage = "No result found for specified Device name !!";
+ growl.warning($scope.warningMessage, {
+ title: 'Warning!'
+ });
+ }
+ },
+ function(response) {
+ console.log("--ReportController::getdata::Error--", response);
+ });
+ }
+ }
+
+
+ //FUNCTION WILL BE CALLED WHEN USER CLICK DOWNLOAD FROM UI
+ $scope.exportToExcel = function(tableId) { // ex: '#my-table'
+ var exportHref = Excel.tableToExcel(tableId, 'export');
+ $timeout(function() {
+ location.href = exportHref;
+ }, 100); // trigger download
+
+ console.log("--ReportController::exportToexcel--");
+ }
+
+ $scope.createTestReportModel = function(result) {
+
+ $scope.showError = false;
+ $scope.showWarning = false;
+ $scope.objTestReportModel = result;
+ $scope.objTestModel = [];
+
+
+ if ($scope.objTestReportModel.length >= 1) {
+ for (var i = 0; i < $scope.objTestReportModel.length; i++) {
+ var objTestReport = {};
+ objTestReport.testid = $scope.objTestReportModel[i].testid;
+ objTestReport.deviceid = $scope.objTestReportModel[i].deviceid;
+ objTestReport.deviceName = $scope.objTestReportModel[i].deviceName;
+ objTestReport.result = $scope.objTestReportModel[i].result;
+ objTestReport.timeStamp = $scope.objTestReportModel[i].timeStamp;
+ objTestReport.testname = $scope.objTestReportModel[i].testName;
+
+ var executionDetails = {};
+ $scope.tmp = angular.fromJson($scope.objTestReportModel[i].execuationDetails);
+ executionDetails = $scope.tmp.output;//$scope.objTestReportModel[i].execuationDetails.output;
+
+ if ($scope.objTestReportModel[i].testName === "Network Layer") {
+ //fetching the statistics to show in progress bar
+ var statistics = executionDetails.statistics;
+ objTestReport.status = executionDetails.status;
+ objTestReport.statistics = executionDetails.statistics;
+ statistics = statistics.split("%");
+ executionDetails.statistics = statistics[0];
+ if (executionDetails.statistics == 0) {
+ executionDetails.statisticPer = parseInt(executionDetails.statistics) + 50;
+ } else
+ executionDetails.statisticPer = executionDetails.statistics;
+
+ console.log("--ReportController::CreateTestReportModel--", executionDetails.statistics);
+
+ //fetching the avg time to show in progress bar
+ var avgTime = executionDetails.avgTime;
+ objTestReport.avgTime = executionDetails.avgTime;
+ avgTime = avgTime.split("=");
+ var Testtime = avgTime[1];
+ executionDetails.avgTime = Testtime.slice(0, -2).trim();
+ console.log("--ReportController::CreateTestReportModel--", executionDetails.avgTime);
+ if (executionDetails.avgTime < 50) {
+ executionDetails.avgTimePer = parseInt(executionDetails.avgTime) + 10;
+ } else
+ executionDetails.avgTimePer = executionDetails.avgTime;
+
+ }
+
+
+ objTestReport.executionDetails = executionDetails;
+ $scope.objTestModel.push(objTestReport);
+ console.log("--ReportController::CreateTestReportModel--", JSON.stringify($scope.objTestModel));
+
+ }
+ $scope.ShowResult = true;
+ $scope.pagination = true;
+ }
+ console.log("--ReportController::createTestReportModel::final TestReportModel--" + JSON.stringify($scope.objTestModel));
+ $scope.csvOrder = ['testname', 'deviceName', 'timeStamp', 'status', 'statistics', 'avgTime', 'result'];
+
+ }
+}]); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-validationTest-service.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-validationTest-service.js
new file mode 100644
index 0000000..c82dc92
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-validationTest-service.js
@@ -0,0 +1,78 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+myApp.service('validationTestService', ['$http', function($http) {
+
+
+ this.getAllVNF = function() {
+ var testlist = {};
+ return $http.get('./sdnc-stubs/getAllVNF.json')
+ .then(function(response) {
+ console.log("---validationTestService::getAllVNF::TestResponse---" + JSON.stringify(response));
+ vnflist = response.data;
+ return vnflist;
+ },
+ function(response) {
+ console.log("validationTestService::getAllVNF::Status Code", response.status);
+ return response;
+ });
+
+ };
+
+ this.runPretest = function(vnfList, validationTestType) {
+
+
+ var data = {};
+ data.vnfList = vnfList;
+ data.validationTestType = validationTestType;
+
+ var config = {
+ params: data,
+ headers: {
+ 'Accept': 'application/json'
+ }
+ };
+
+ console.log("validationTestService::runPretest::config", JSON.stringify(config));
+
+ // Call the pre validation service
+ var request = {
+ method: 'POST',
+ url: '/runtest',
+ data: data,
+ headers: {
+ 'Content-Type': undefined
+ }
+ };
+
+ // // SEND VNF FOR VALIDATION
+ return $http(request)
+ .then(function(response) {
+ console.log("---validationTestService::uploadFile::Response---" + JSON.stringify(response));
+ return response.data;
+ },
+ function(response) {
+ console.log("--validationTestService::Status Code--", response.status);
+ return response;
+ });
+
+
+ }
+
+}]); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-viewReport-service.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-viewReport-service.js
new file mode 100644
index 0000000..3b49fca
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/js/sdnc-services/sdnc-viewReport-service.js
@@ -0,0 +1,78 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+myApp.service('viewReportService', ['$http', function($http) {
+ this.getData = function(startDate, endDate, deviceName) {
+
+ var data = {};
+ if (startDate != null && endDate != null && deviceName != null) {
+
+ data.startdate = startDate;
+ data.enddate = endDate;
+ data.devicename = deviceName;
+
+ }
+ var config = {
+ params: '',
+ headers: {
+ 'Accept': 'application/json'
+ }
+ };
+
+ var sdate = new Date(startDate);
+ var edate = new Date(endDate);
+
+ var objTestList = {};
+ // return $http.get('sdnc-stubs/getAllReports.json', config)
+ return $http.get('/findReportByDeviceName/'+sdate+'/'+edate+'/'+deviceName,config)
+ .then(function(result) {
+ console.log("--viewReportService::getdata::Testresponse--", JSON.stringify(result));
+ objTestList = result.data;
+ console.log("--viewReportService::getdata::Testresponse--", +JSON.stringify(objTestList));
+ return result;
+ });
+
+ };
+
+
+ this.getAllDevices = function() {
+ var deviceResponse = {};
+ return $http.get('sdnc-stubs/getAllDevices.json')
+ .then(function(response) {
+ console.log("--getAlldevices" + JSON.stringify(response));
+ deviceResponse = response.data;
+ console.log("----viewReportService::getAlldevices::deviceResponse--" + JSON.stringify(deviceResponse));
+ return deviceResponse;
+ });
+
+ };
+
+
+ this.getAllTest = function() {
+ var testlist = {};
+ return $http.get('sdnc-stubs/getAllTest.json')
+ .then(function(response) {
+ console.log("---viewReportService::getAllTest::TestResponse---" + JSON.stringify(response));
+ testlist = response.data;
+ return testlist;
+ });
+
+ };
+}]); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/package.json b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/package.json
new file mode 100644
index 0000000..ffb9715
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/src/main/webapp/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "myapp",
+ "version": "1.0.0",
+ "description": "list of node modules for myapp",
+ "main": "app.js",
+ "scripts": {
+ "test": "standard"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/NMSVishal/SDNCReports.git"
+ },
+ "author": "",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/NMSVishal/SDNCReports/issues"
+ },
+ "homepage": "https://github.com/NMSVishal/SDNCReports#readme",
+ "dependencies": {
+ "angular": "^1.6.9",
+ "angular-growl": "^0.1.0",
+ "angular-mocks": "^1.6.9",
+ "angular-route": "^1.6.9",
+ "angular-sanitize": "^1.6.9",
+ "angular-utils-pagination": "^0.11.1",
+ "angularjs-datetime-picker": "^0.1.16",
+ "bootstrap": "^4.0.0",
+ "jquery": "^3.3.1",
+ "ng-csv": "^0.3.6",
+ "ng-ip-address": "^1.1.12"
+ }
+}