diff options
Diffstat (limited to 'dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter')
18 files changed, 2130 insertions, 0 deletions
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-list-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-list-controller.js new file mode 100644 index 0000000..36b7dd0 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-list-controller.js @@ -0,0 +1,286 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('drFeedListCtrl', function($scope, $log, $modal, modalService, DRFeedService) { + + // populates the table of Data Router feeds + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + // models for controls on screen + $scope.dbcapp.tableData = []; + $scope.dbcapp.currentPageNum = 1; + $scope.dbcapp.totalPages = 1; + $scope.dbcapp.viewPerPage = 100; + $scope.dbcapp.viewPerPageOptions = [ + { index : 0, value : 100 }, + { index : 1, value : 500 }, + { index : 2, value : 1000 }, + { index : 3, value : 2500 } + ]; + // other + $scope.dbcapp.errMsg = null; + $scope.dbcapp.isDataLoading = true; + $scope.dbcapp.isRequestFailed = false; + + /** + * Answers an array of the specified size - makes Angular iteration easy. + */ + $scope.dbcapp.buildArraySizeN = function(num) { + // $log.debug("buildArraySizeN: invoked with " + num); + return new Array(num); + } + + /** + * Loads the table of data router feeds. + * + * Interprets the remote controller's response and copies to scope + * variables. The response is either list to be assigned to tableData, or an + * error to be shown. + */ + $scope.dbcapp.loadTable = function() { + $scope.dbcapp.isDataLoading = true; + DRFeedService.getFeedsByPage($scope.dbcapp.currentPageNum, $scope.dbcapp.viewPerPage) + .then(function(jsonObj) { + if (jsonObj.error) { + $scope.dbcapp.isRequestFailed = true; + $scope.dbcapp.errMsg = jsonObj.error; + $scope.dbcapp.tableData = []; + } else { + $scope.dbcapp.isRequestFailed = false; + $scope.dbcapp.errMsg = null; + $scope.dbcapp.profileName = jsonObj.profileName; + $scope.dbcapp.dmaapName=jsonObj.dmaapName; + $scope.dbcapp.dcaeLocations=jsonObj.dcaeLocations; + $scope.dbcapp.totalPages = jsonObj.totalPages; + $scope.dbcapp.tableData = jsonObj.data; + } + $scope.dbcapp.isDataLoading = false; + }, function(error) { + $log.error("drFeedListCtrl.loadTable failed: " + error); + $scope.dbcapp.isRequestFailed = true; + $scope.dbcapp.errMsg = error; + $scope.dbcapp.tableData = []; + $scope.dbcapp.isDataLoading = false; + }); + }; + + /** + * Shows a modal pop-up to add a feed. + * Passes data in via an object named "message". + * On success, updates the table. + */ + $scope.dbcapp.addFeedModalPopup = function() { + $scope.dbcapp.editFeed = null; + var modalInstance = $modal.open({ + templateUrl : 'add_feed_popup.html', + controller : 'feedPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + feed : $scope.dbcapp.editFeed, + feedList : $scope.dbcapp.tableData, + dcaeList: $scope.dbcapp.dcaeLocations + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + // $log.debug('addFeedModalPopup: response: ' + JSON.stringify(response)); + if (response == null) { + // $log.debug('addFeedModalPopup: user closed dialog'); + } + else { + if (response.error != null) + modalService.showFailure('Add Failed', + 'Failed to add feed:\n' + response.error); + else + // success, get the updated list. + $scope.dbcapp.loadTable() + } + }); + }; + + /** + * Shows a modal pop-up to edit a feed. + * Passes data in via an object named "message". + * Always updates the table, even on failure, to discard + * user-entered changes that were not persisted. + */ + $scope.dbcapp.editFeedModalPopup = function(feed) { + $scope.dbcapp.editFeed = feed; + var modalInstance = $modal.open({ + templateUrl : 'edit_feed_popup.html', + controller : 'feedPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + feed : $scope.dbcapp.editFeed, + feedList : $scope.dbcapp.tableData + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + if (response == null) { + // $log.debug('editFeedModalPopup: user closed dialog'); + } + else { + // $log.debug('editFeedModalPopup: response: ' + JSON.stringify(response)); + if (response.error != null) + modalService.showFailure('Edit Failed', + 'Failed to edit feed ' + feed.feedName + + '\n' + response.error); + // refresh in all cases + $scope.dbcapp.loadTable(); + } + }); + }; + + /** + * Shows a modal pop-up to confirm deletion of a feed. + * On successful completion, updates the table. + */ + $scope.dbcapp.deleteFeedModalPopup = function(feed) { + modalService.popupConfirmWin("Confirm", "Delete the feed: " + + feed.feedName + "\nContinue?", function() { + DRFeedService.deleteFeed(feed.feedId).then( + function(response) { + // $log.debug('deleteFeedModalPopup: response: ' + JSON.stringify(response)); + if (response.error != null) { + $log.error('deleteFeedModalPopup: failed to delete: ' + response.error); + modalService.showFailure('Delete Failed', + 'Failed to delete feed ' + feed.feedName + + '\n' + response.error); + } + else { + // success, get the updated list. + $scope.dbcapp.loadTable() + } + }, + function(error) { + $log.error('deleteFeed failed'); + modalService.showFailure('Delete Failed', 'feedListCtrl failed to delete object: ' + + JSON.stringify(error)); + }); + }) + }; + + /** + * Shows a modal pop-up with all publishers and subscribers of a feed. + * Passes data in via an object named "message". + */ + $scope.dbcapp.showFeedPubsSubsModalPopup = function(feed) { + var modalInstance = $modal.open({ + templateUrl : 'feed_pub_sub_list_popup.html', + controller : 'feedPubSubListPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + feed : feed + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + // No response expected. + }); + }; + + /** + * Shows a modal pop-up to add a feed publisher. + * Passes data in via an object named "message". + * On successful completion, updates the table. + */ + $scope.dbcapp.addFeedPublisherModalPopup = function(feed) { + $scope.dbcapp.editPub = { feedId : feed.feedId } + var modalInstance = $modal.open({ + templateUrl : 'edit_pub_popup.html', + controller : 'pubPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + pub : $scope.dbcapp.editPub, + pubList : [], + dcaeList: $scope.dbcapp.dcaeLocations + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + if (response == null) { + // $log.debug('addFeedPublisherModalPopup: user closed dialog'); + } + else { + if (response.error != null) + modalService.showFailure('Add Publisher Failed', + 'Failed to add publisher to feed:\n' + response.error); + else + // success, get the updated list. + $scope.dbcapp.loadTable(); + } + }); + }; + + /** + * Shows a modal pop-up to add a feed subscriber. + * Passes data in via an object named "message". + * On successful completion, updates the table. + */ + $scope.dbcapp.addFeedSubscriberModalPopup = function(feed) { + // Create a subscriber object with the feed ID + $scope.dbcapp.editSub = { feedId : feed.feedId } + var modalInstance = $modal.open({ + templateUrl : 'edit_sub_popup.html', + controller : 'subPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + sub : $scope.dbcapp.editSub, + subList : [], + dcaeList: $scope.dbcapp.dcaeLocations + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + if (response == null) { + // $log.debug('addFeedSubscriberModalPopup: user closed dialog'); + } + else { + if (response.error != null) + modalService.showFailure('Add Subscriber Failed', + 'Failed to add subscriber to feed:\n' + response.error); + else + // success, get the updated list. + $scope.dbcapp.loadTable(); + } + }); + }; + + // Populate the table on load. + $scope.dbcapp.loadTable(); + +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-popup-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-popup-controller.js new file mode 100644 index 0000000..4efef98 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-popup-controller.js @@ -0,0 +1,125 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('feedPopupCtrl', function($scope, $log, $modalInstance, modalService, message, DRFeedService) { + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + + // Set the label variable for the template + if (message.feed == null) { + $scope.dbcapp.label = 'Add Feed'; + // Must add publisher with a feed. + $scope.dbcapp.editFeed = + { + pubs: [ + { username: null } + ] + }; + } + else { + $scope.dbcapp.label = 'Edit Feed'; + $scope.dbcapp.editFeed = message.feed; + } + $scope.dbcapp.dcaeList = message.dcaeList; + + // for populating selection boxes on add and edit popup templates + $scope.dbcapp.asprClassificationList = [ + "unclassified", + "Non-Sensitive Customer Data", + "AT&T Proprietary (Internal Use Only)", + "AT&T Proprietary (Secure Restricted)", + "AT&T Proprietary (Restricted)", + "AT&T Proprietary (Sensitive Personal Information)", + "Customer Sensitive Data", + "Customer Data Conduit", + ]; + + /** + * Validates content of user-editable fields. + * Uses the list in message.feedList + * Returns null if all is well, + * a descriptive error message otherwise. + */ + $scope.dbcapp.validateFeed = function(feed) { + if (feed == null) + return "No data found.\nPlease enter some values."; + if (feed.feedName == null || feed.feedName.trim() == '') + return "Name is required.\nPlease enter a value."; + if (feed.feedVersion == null || feed.feedVersion.trim() == '') + return "Version is required.\nPlease enter a value."; + if (feed.feedDescription == null || feed.feedDescription.trim() == '') + return "Description is required.\nPlease enter a value."; + if (feed.asprClassification == null || feed.asprClassification.trim() == '') + return "ASPR Classification is required.\nPlease select a value."; + for (var x in message.feedList) { + // Ignore the one being edited. + if (message.feedList[x].feedId == feed.feedId) + continue; + if (message.feedList[x].feedName == feed.feedName) + return "Name " + feed.feedName + " exists.\n" + + "Please choose a different name."; + } + // Extra validation if adding a new feed - check first publisher + if (feed.feedId == null && feed.pubs != null && feed.pubs[0] != null) { + $log.info('validateFeed: pubs[0] is ' + JSON.stringify(feed.pubs[0])); + if (feed.pubs[0].dcaeLocationName == null) + return "DCAE Location is required.\nPlease select a value."; + // username, userpwd are optional + } + return null; + } + + $scope.dbcapp.saveFeed = function(feed) { + var validateMsg = $scope.dbcapp.validateFeed(feed); + if (validateMsg != null) { + modalService.showFailure("Invalid Content", validateMsg); + return; + } + + if (feed.feedId == null) { + // No id, so create a new one + DRFeedService.addFeed(feed) + .then(function(response) { + $modalInstance.close(response); + }, + function (error) { + $log.error('feedPopupCtrl: error while adding: ' + error); + } + ); + } + else { + // Has id, so update an existing one + DRFeedService.updateFeed(feed) + .then(function(response) { + $modalInstance.close(response); + }, + function (error) { + $log.error('feedPopupCtrl: error while updating: ' + error); + } + ); + } + + }; + + $scope.dbcapp.close = function() { + $modalInstance.close(); + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-pub-sub-list-popup-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-pub-sub-list-popup-controller.js new file mode 100644 index 0000000..3c15370 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-pub-sub-list-popup-controller.js @@ -0,0 +1,38 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('feedPubSubListPopupCtrl', function($scope, $log, $modalInstance, modalService, message) { + + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + + // Set the label variable for the template + $scope.dbcapp.label = 'Pub/Sub of Feed ' + message.feed.feedName; + + // Source of data table + $scope.dbcapp.showFeed = message.feed; + + // $log.debug('feedPubSubListPopupCtrl: showFeed.pubs is ' + JSON.stringify($scope.dbcapp.showFeed.pubs)); + + $scope.dbcapp.close = function() { + $modalInstance.close(); + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-service.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-service.js new file mode 100644 index 0000000..a3700dd --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-feed-service.js @@ -0,0 +1,105 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.factory('DRFeedService', function ($http, $q, $log) { + return { + /** + * Gets one page of data router feed objects. + * @param {Number} pageNum - page number; e.g., 1 + * @param {Number} viewPerPage - number of items per page; e.g., 25 + * @return {JSON} Response object from remote side + */ + getFeedsByPage: function(pageNum,viewPerPage) { + // cache control for IE + var cc = "&cc=" + new Date().getTime().toString(); + return $http({ + method: 'GET', + url: 'dr_feed?pageNum=' + pageNum + '&viewPerPage=' + viewPerPage + cc, + cache: false, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRFeedService.getFeedsByPage: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRFeedService.getFeedsByPage failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Creates a new feed. + addFeed: function(feed) { + return $http({ + method: 'POST', + url: 'dr_feed', + data: feed, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRFeedService.addFeed: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRFeedService.addFeed failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Updates an existing feed. + updateFeed: function(feed) { + return $http({ + method: 'PUT', + url: 'dr_feed/' + feed.feedId, + data: feed, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRFeedService.updateFeed: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRFeedService.updateFeed failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Deletes the feed with the specified ID. + deleteFeed: function(feedId) { + return $http({ + method: 'DELETE', + url: 'dr_feed/' + feedId, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRFeedService.deleteFeed: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRFeedService.deleteFeed failed: ' + error); + return $q.reject(error.data); + }); + }, + + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-list-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-list-controller.js new file mode 100644 index 0000000..ba90900 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-list-controller.js @@ -0,0 +1,149 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('drPubListCtrl', function($scope, $log, $modal, modalService, DRPubService) { + + // populates the list of Data Router publishers. + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + // models for controls on screen + $scope.dbcapp.tableData=[]; + $scope.dbcapp.currentPageNum=1; + $scope.dbcapp.totalPages=1; + $scope.dbcapp.viewPerPage = 100; + $scope.dbcapp.viewPerPageOptions = [ + { index : 0, value : 100 }, + { index : 1, value : 500 }, + { index : 2, value : 1000 }, + { index : 3, value : 2500 } + ]; + // other + $scope.dbcapp.errMsg=null; + $scope.dbcapp.isDataLoading=true; + $scope.dbcapp.isRequestFailed=false; + + /** + * Answers an array of the specified size - makes Angular iteration easy. + */ + $scope.dbcapp.buildArraySizeN = function(num) { + // $log.debug("buildArraySizeN: invoked with " + num); + return new Array(num); + } + + /** + * Loads the table of data router publishers. + * + * Interprets the remote controller's response and copies to scope + * variables. The response is either list to be assigned to tableData, or an + * error to be shown. + */ + $scope.dbcapp.loadTable = function() { + $scope.dbcapp.isDataLoading = true; + DRPubService.getPubsByPage($scope.dbcapp.currentPageNum,$scope.dbcapp.viewPerPage) + .then(function(jsonObj) { + if (jsonObj.error) { + $scope.dbcapp.isRequestFailed = true; + $scope.dbcapp.errMsg = jsonObj.error; + $scope.dbcapp.tableData = []; + } + else { + $scope.dbcapp.isRequestFailed = false; + $scope.dbcapp.errMsg = null; + $scope.dbcapp.profileName = jsonObj.profileName; + $scope.dbcapp.dmaapName = jsonObj.dmaapName; + $scope.dbcapp.dcaeLocations = jsonObj.dcaeLocations; + $scope.dbcapp.totalPages = jsonObj.totalPages; + $scope.dbcapp.tableData = jsonObj.data; + } + $scope.dbcapp.isDataLoading = false; + },function(error){ + $log.error("drPubListCtrl.loadTable failed: " + error); + $scope.dbcapp.isRequestFailed = true; + $scope.dbcapp.errMsg = error; + $scope.dbcapp.tableData = []; + $scope.dbcapp.isDataLoading = false; + }); + }; + + /** + * Shows a modal pop-up to edit a publisher. + * Passes data in via an object named "message". + * Always updates the table, even on failure, to discard + * user-entered changes that were not persisted. + */ + $scope.dbcapp.editPubModalPopup = function(pub) { + $scope.dbcapp.editPub = pub; + var modalInstance = $modal.open({ + templateUrl : 'edit_pub_popup.html', + controller : 'pubPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + pub : $scope.dbcapp.editPub, + pubList : $scope.dbcapp.tableData, + dcaeList : $scope.dbcapp.dcaeLocations + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + if (response == null) { + // $log.debug('editPubModalPopup: user closed dialog'); + } + else { + if (response.error != null) + modalService.showFailure('Update Failed', + 'Failed to update publisher:\n' + response.error); + // refresh in all cases + $scope.dbcapp.loadTable(); + } + }); + }; + + /** + * Shows a modal pop-up to confirm deletion of a publisher. + * On successful completion, updates the table. + */ + $scope.dbcapp.deletePubModalPopup = function(pub) { + modalService.popupConfirmWin("Confirm", "Delete the publisher: " + + pub.pubId + "\nContinue?", function() { + DRPubService.deletePub(pub.pubId).then( + function(response) { + if (response.error != null) + modalService.showFailure('Delete Failed', + 'Failed to delete publisher ' + pub.pubId + + '\n' + response.error); + else + // success, get the updated list. + $scope.dbcapp.loadTable() + }, + function(error) { + modalService.showFailure('Delete Failed', 'pubListCtrl failed to delete: ' + + JSON.stringify(error)); + }); + }) + }; + + // Populate the table on load. + $scope.dbcapp.loadTable(); + +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-popup-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-popup-controller.js new file mode 100644 index 0000000..07b80e4 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-popup-controller.js @@ -0,0 +1,82 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('pubPopupCtrl', function($scope, $log, $modalInstance, modalService, message, DRPubService) { + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + + // Set the label variable for the template + if (message.pub == null || message.pub.subId == null) + $scope.dbcapp.label = 'Add Publisher'; + else + $scope.dbcapp.label = 'Edit Publisher'; + $scope.dbcapp.editPub = message.pub; + $scope.dbcapp.dcaeList = message.dcaeList; + + /** + * Validates content of user-editable fields. + * Returns null if all is well, + * a descriptive error message otherwise. + */ + $scope.dbcapp.validatePub = function(pub) { + if (pub == null) + return "No data found.\nPlease enter some values."; + if (pub.dcaeLocationName == null) + return "DCAE Location is required.\nPlease select a value."; + return null; + } + + $scope.dbcapp.savePub = function(pub) { + var validateMsg = $scope.dbcapp.validatePub(pub); + if (validateMsg != null) { + modalService.showFailure("Invalid Content", validateMsg); + return; + } + + if (pub.pubId == null) { + // No id, so create a new one + DRPubService.addPub(pub) + .then(function(response) { + $modalInstance.close(response); + }, + function (error) { + $log.error('pubPopupCtrl: error while adding: ' + error); + } + ); + } + else { + // Has id, so update an existing one + DRPubService.updatePub(pub) + .then(function(response) { + $modalInstance.close(response); + }, + function (error) { + $log.error('pubPopupCtrl: error while updating: ' + error); + } + ); + } + + }; + + $scope.dbcapp.close = function() { + $modalInstance.close(); + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-service.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-service.js new file mode 100644 index 0000000..f317c0f --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-pub-service.js @@ -0,0 +1,106 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.factory('DRPubService', function ($http, $q, $log) { + return { + /** + * Gets one page of data router publisher objects. + * @param {Number} pageNum - page number; e.g., 1 + * @param {Number} viewPerPage - number of items per page; e.g., 25 + * @return {JSON} Response object from remote side + */ + getPubsByPage: function(pageNum,viewPerPage) { + // cache control for IE + var cc = "&cc=" + new Date().getTime().toString(); + return $http({ + method: 'GET', + url: 'dr_pub?pageNum=' + pageNum + '&viewPerPage=' + viewPerPage + cc, + cache: false, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRPubService.getPubsByPage: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRPubService.getPubsByPage failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Creates a new publisher. + addPub: function(pub) { + return $http({ + method: 'POST', + url: 'dr_pub', + data: pub, + responseType: 'json' }) + .then(function(response) { + // $log.debug('DRPubService.addPub: response: ' + JSON.stringify(response)); + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRPubService.addPub: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRPubService.addPub failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Updates an existing publisher. + updatePub: function(pub) { + return $http({ + method: 'PUT', + url: 'dr_pub/' + pub.pubId, + data: pub, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRPubService.updatePub: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRPubService.updatePub failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Deletes the publisher with the specified ID. + deletePub: function(pubId) { + return $http({ + method: 'DELETE', + url: 'dr_pub/' + pubId, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRPubService.deletePub: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRPubService.deletePub failed: ' + error); + return $q.reject(error.data); + }); + }, + + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-list-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-list-controller.js new file mode 100644 index 0000000..4faf695 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-list-controller.js @@ -0,0 +1,149 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('drSubListCtrl', function($scope, $log, $modal, modalService, DRSubService) { + + // populates the list of Data Router subscribers. + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + // models for controls on screen + $scope.dbcapp.tableData=[]; + $scope.dbcapp.currentPageNum=1; + $scope.dbcapp.totalPages=1; + $scope.dbcapp.viewPerPage = 100; + $scope.dbcapp.viewPerPageOptions = [ + { index : 0, value : 100 }, + { index : 1, value : 500 }, + { index : 2, value : 1000 }, + { index : 3, value : 2500 } + ]; + // other + $scope.dbcapp.errMsg=null; + $scope.dbcapp.isDataLoading=true; + $scope.dbcapp.isRequestFailed=false; + + /** + * Answers an array of the specified size - makes Angular iteration easy. + */ + $scope.dbcapp.buildArraySizeN = function(num) { + // $log.debug("buildArraySizeN: invoked with " + num); + return new Array(num); + } + + /** + * Loads the table of data router subscribers. + * + * Interprets the remote controller's response and copies to scope + * variables. The response is either list to be assigned to tableData, or an + * error to be shown. + */ + $scope.dbcapp.loadTable = function() { + $scope.dbcapp.isDataLoading = true; + DRSubService.getSubsByPage($scope.dbcapp.currentPageNum,$scope.dbcapp.viewPerPage) + .then(function(jsonObj){ + if (jsonObj.error) { + $scope.dbcapp.isRequestFailed = true; + $scope.dbcapp.errMsg = jsonObj.error; + $scope.dbcapp.tableData = []; + } + else { + $scope.dbcapp.isRequestFailed = false; + $scope.dbcapp.errMsg = null; + $scope.dbcapp.profileName = jsonObj.profileName; + $scope.dbcapp.dmaapName = jsonObj.dmaapName; + $scope.dbcapp.dcaeLocations = jsonObj.dcaeLocations; + $scope.dbcapp.totalPages = jsonObj.totalPages; + $scope.dbcapp.tableData = jsonObj.data; + } + $scope.dbcapp.isDataLoading = false; + },function(error){ + $log.error("drSubListCtrl.loadTable failed: " + error); + $scope.dbcapp.isRequestFailed = true; + $scope.dbcapp.errMsg = error; + $scope.dbcapp.tableData = []; + $scope.dbcapp.isDataLoading = false; + }); + }; + + /** + * Shows a modal pop-up to edit a subscriber. + * Passes data in via an object named "message". + * Always updates the table, even on failure, to discard + * user-entered changes that were not persisted. + */ + $scope.dbcapp.editSubModalPopup = function(sub) { + $scope.dbcapp.editSub = sub; + var modalInstance = $modal.open({ + templateUrl : 'edit_sub_popup.html', + controller : 'subPopupCtrl', + resolve : { + message : function() { + var dataForPopup = { + sub : $scope.dbcapp.editSub, + subList : $scope.dbcapp.tableData, + dcaeList : $scope.dbcapp.dcaeLocations + }; + return dataForPopup; + } + } + }); + modalInstance.result.then(function(response) { + if (response == null) { + // $log.debug('editSubModalPopup: user closed dialog'); + } + else { + if (response.error != null) + modalService.showFailure('Update Failed', + 'Failed to update subscriber:\n' + response.error); + // refresh in all cases + $scope.dbcapp.loadTable(); + } + }); + }; + + /** + * Shows a modal pop-up to confirm deletion of a subscriber. + * On successful completion, updates the table. + */ + $scope.dbcapp.deleteSubModalPopup = function(sub) { + modalService.popupConfirmWin("Confirm", "Delete the subscriber: " + + sub.subId + "\nContinue?", function() { + DRSubService.deleteSub(sub.subId).then( + function(response) { + if (response.error != null) + modalService.showFailure('Delete Failed', + 'Failed to delete subscriber ' + sub.subId + + '\n' + response.error); + else + // success, get the updated list. + $scope.dbcapp.loadTable() + }, + function(error) { + modalService.showFailure('Delete Failed', 'subListCtrl failed to delete: ' + + JSON.stringify(error)); + }); + }) + }; + + // Populate the table on load. + $scope.dbcapp.loadTable(); + +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-popup-controller.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-popup-controller.js new file mode 100644 index 0000000..c920fc1 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-popup-controller.js @@ -0,0 +1,89 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.controller('subPopupCtrl', function($scope, $log, $modalInstance, modalService, message, DRSubService) { + 'use strict'; + + // this object holds all app data and functions + $scope.dbcapp = {}; + + // Set the label variable for the template + if (message.sub == null || message.sub.subId == null) + $scope.dbcapp.label = 'Add Subscriber'; + else + $scope.dbcapp.label = 'Edit Subscriber'; + $scope.dbcapp.editSub = message.sub; + $scope.dbcapp.dcaeList = message.dcaeList; + + /** + * Validates content of user-editable fields. + * Returns null if all is well, + * a descriptive error message otherwise. + */ + $scope.dbcapp.validateSub = function(sub) { + if (sub == null) + return "No data found.\nPlease enter some values."; + if (sub.dcaeLocationName == null) + return "DCAE Location is required.\nPlease select a value."; + if (sub.deliveryURL == null || sub.deliveryURL.trim() == '') + return "Delivery URL is required.\nPlease enter a value."; + if (sub.username == null || sub.username.trim() == '') + return "User Name is required.\nPlease enter a value."; + if (sub.userpwd == null || sub.userpwd.trim() == '') + return "Password is required.\nPlease enter a value."; + return null; + } + + $scope.dbcapp.saveSub = function(sub) { + var validateMsg = $scope.dbcapp.validateSub(sub); + if (validateMsg != null) { + modalService.showFailure("Invalid Content", validateMsg); + return; + } + + if (sub.subId == null) { + // No id, so create a new one + DRSubService.addSub(sub) + .then(function(response) { + // $log.debug('subPopupCtrl.saveSub: ' + JSON.stringify(response)); + $modalInstance.close(response); + }, + function (error) { + $log.error('subPopupCtrl: error while adding: ' + error); + } + ); + } + else { + // Has id, so update an existing one + DRSubService.updateSub(sub) + .then(function(response) { + $modalInstance.close(response); + }, + function (error) { + $log.error('subPopupCtrl: error while updating: ' + error); + } + ); + } + + }; + + $scope.dbcapp.close = function() { + $modalInstance.close(); + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-service.js b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-service.js new file mode 100644 index 0000000..f399282 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr-sub-service.js @@ -0,0 +1,105 @@ +/*- + * ================================================================================ + * DCAE DMaaP Bus Controller Web Application + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +app.factory('DRSubService', function ($http, $q, $log) { + return { + /** + * Gets one page of data router subscriber objects. + * @param {Number} pageNum - page number; e.g., 1 + * @param {Number} viewPerPage - number of items per page; e.g., 25 + * @return {JSON} Response object from remote side + */ + getSubsByPage: function(pageNum,viewPerPage) { + // cache control for IE + var cc = "&cc=" + new Date().getTime().toString(); + return $http({ + method: 'GET', + url: 'dr_sub?pageNum=' + pageNum + '&viewPerPage=' + viewPerPage + cc, + cache: false, + responseType: 'json'}) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRSubService.getSubsByPage: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRSubService.getSubsByPage failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Creates a new subscriber. + addSub: function(sub) { + return $http({ + method: 'POST', + url: 'dr_sub', + data: sub, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRSubService.addSub: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRSubService.addSub failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Updates an existing subscriber. + updateSub: function(sub) { + return $http({ + method: 'PUT', + url: 'dr_sub/' + sub.subId, + data: sub, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRSubService.updateSub: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRSubService.updateSub failed: ' + error); + return $q.reject(error.data); + }); + }, + + // Deletes the subscriber with the specified ID. + deleteSub: function(subId) { + return $http({ + method: 'DELETE', + url: 'dr_sub/' + subId, + responseType: 'json' }) + .then(function(response) { + if (response.data == null || typeof response.data != 'object') + return $q.reject('DRSubService.deleteSub: response.data null or not object'); + else + return response.data; + }, + function(error) { + $log.error('DRSubService.deleteSub failed: ' + error); + return $q.reject(error.data); + }); + }, + + }; +}); diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_add_popup_template.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_add_popup_template.html new file mode 100644 index 0000000..d0d6d94 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_add_popup_template.html @@ -0,0 +1,104 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<Script type="text/ng-template" id="add_feed_popup.html"> + <div class="modal__informative font-showcase" style="width:550px;"> + <div class="modal__header"> + <h2 class="font-showcase-font-name" style="width: 500px;">{{dbcapp.label}}</h2> + </div> + <div class="divider-container"> + <hr> + </div> + <div class="modal__content"> + + <!-- left column --> + <div class="fn-ebz-container" > + Feed Name:<sup><b>*</b></sup> + <br/> + <!--autofocus is HTML5 attribute; doesn't work in Firefox--> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.feedName" autofocus /> + </div> + <!-- right column --> + <div class="fn-ebz-container"> + DCAE Location:<sup><b>*</b></sup> + <br/> + <select class="fn-ebz-select dbcselect" ng-model="dbcapp.editFeed.pubs[0].dcaeLocationName" ng-options="d for d in dbcapp.dcaeList"></select> + </div> + + <br/> + + <!-- left column --> + <div class="fn-ebz-container" > + Feed Version:<sup><b>*</b></sup> + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.feedVersion" /> + </div> + <!-- right column --> + <div class="fn-ebz-container" > + Publish User Name: + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.pubs[0].username" /> + </div> + + <br/> + + <!-- left column --> + <div class="fn-ebz-container" > + Description:<sup><b>*</b></sup> + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.feedDescription" /> + </div> + <!-- right column --> + <div class="fn-ebz-container" > + Publish Password: + <br/> + <input type="password" class="fn-ebz-text dbcpassword" ng-model="dbcapp.editFeed.pubs[0].userpwd" /> + </div> + + <br/> + + <!-- left column --> + <div class="fn-ebz-container" > + ASPR Classification:<sup><b>*</b></sup> + <br/> + <!-- is wider than others because values are long --> + <select class="fn-ebz-select" ng-model="dbcapp.editFeed.asprClassification" ng-options="a for a in dbcapp.asprClassificationList"></select> + </div> + + <br/> + <div class="fn-ebz-container" > + Suspended: + <br/> + <input type="checkbox" att-checkbox ng-model="dbcapp.editFeed.suspended" /> + </div> + </div> + <div class="modal__footer"> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.saveFeed(dbcapp.editFeed);"> + Save + </button> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.close()"> + Close + </button> + </div> + </div> +</script> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_edit_popup_template.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_edit_popup_template.html new file mode 100644 index 0000000..3fc6d74 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_edit_popup_template.html @@ -0,0 +1,75 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<Script type="text/ng-template" id="edit_feed_popup.html"> + <div class="modal__informative font-showcase" style="width:400px;"> + <div class="modal__header"> + <h2 class="font-showcase-font-name" style="width: 500px;">{{dbcapp.label}}</h2> + </div> + <div class="divider-container"> + <hr> + </div> + <div class="modal__content"> + + <div class="fn-ebz-container" > + Feed Name:<sup><b>*</b></sup> + <br/> + <!--autofocus is HTML5 attribute; doesn't work in Firefox--> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.feedName" autofocus /> + </div> + <br/> + <div class="fn-ebz-container" > + Feed Version:<sup><b>*</b></sup> + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.feedVersion" /> + </div> + <br/> + <div class="fn-ebz-container" > + Description:<sup><b>*</b></sup> + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editFeed.feedDescription" /> + </div> + <br/> + <div class="fn-ebz-container" > + ASPR Classification:<sup><b>*</b></sup> + <br/> + <!-- is wider than others because values are long --> + <select class="fn-ebz-select" ng-model="dbcapp.editFeed.asprClassification" ng-options="a for a in dbcapp.asprClassificationList"></select> + </div> + <br/> + <div class="fn-ebz-container" > + Suspended: + <br/> + <input type="checkbox" att-checkbox ng-model="dbcapp.editFeed.suspended" /> + </div> + </div> + <div class="modal__footer"> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.saveFeed(dbcapp.editFeed);"> + Save + </button> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.close()"> + Close + </button> + </div> + </div> +</script> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_list.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_list.html new file mode 100644 index 0000000..1cff03b --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_list.html @@ -0,0 +1,177 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<!-- controller is specified by route provider --> + +<div class="pageTitle"> + <h3 class="heading3" style="margin-top: 10px; margin-bottom: 10px;">Data Router Feeds</h3> +</div> + +<div id="button-search-row"> + <button att-button + type="submit" + ng-click="dbcapp.addFeedModalPopup();" + btn-type="primary" + size="small"> + Add Feed... + </button> + <div style="float:right;"> + <div class="form-field form-field__small"> + <input class="fn-ebz-text.search" + type="text" + placeholder="Search feeds" + ng-model="dbcapp.searchString"/> + <i class="ion-search" style="position:relative;line-height:10px;top:-25px;right:-190px"></i> + </div> + </div> + </div> + +<!-- show progress indicator --> +<div ng-show="dbcapp.isDataLoading"> + <div att-loading></div> +</div> + +<div ng-hide="dbcapp.isDataLoading"> + + <div ng-show="dbcapp.isRequestFailed"> + <span class="errorMessageText">{{dbcapp.errMsg}}</span> + </div> + + <div ng-hide="dbcapp.isRequestFailed"> + Access Profile <strong>{{dbcapp.profileName}}</strong>, DMaaP Name <strong>{{dbcapp.dmaapName}}</strong> + </div> + + <table att-table + id="feeds-table" + table-data="dbcapp.tableData" + search-string="dbcapp.searchString" + view-per-page="dbcapp.viewPerPageIgnored" + current-page="dbcapp.currentPageIgnored" + total-page="dbcapp.totalPageIgnored"> + + <thead att-table-row + type="header"> + <tr> + <th att-table-header sortable="true" key="feedId">ID</th> + <th att-table-header sortable="true" key="feedName">Name</th> + <th att-table-header sortable="true" key="feedVersion">Ver</th> + <th att-table-header sortable="true" key="feedDescription">Description</th> + <th att-table-header sortable="true" key="asprClassification">Classification</th> + <th att-table-header sortable="true" key="publishURL">Publish URL</th> + <th att-table-header sortable="true" key="logURL">Log URL</th> + <th att-table-header sortable="true" key="owner">Owner</th> + <th att-table-header sortable="true" key="status">Status</th> + <th att-table-header sortable="true" key="suspended">Susp</th> + <th att-table-header sortable="false">P+S</th> + <th att-table-header sortable="false">Pub</th> + <th att-table-header sortable="false">Sub</th> + <th att-table-header sortable="false">Del</th> + </tr> + </thead> + <tbody att-table-row + type="body" + row-repeat="rowData in dbcapp.tableData"> + <tr id="tr-rowData"> + <td att-table-body + ng-bind="rowData.feedId" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.feedName" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.feedVersion" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.feedDescription" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.asprClassification" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.publishURL" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.logURL" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.owner" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.status" + ng-click="dbcapp.editFeedModalPopup(rowData)"/> + <td att-table-body + ng-click="dbcapp.editFeedModalPopup(rowData)"> + {{rowData.suspended | dbcYesNoFilter}} + </td> + <td att-table-body + ng-bind="rowData.pubs.length + rowData.subs.length" + ng-click="dbcapp.showFeedPubsSubsModalPopup(rowData)"> + </td> + <td att-table-body> + <div ng-click="dbcapp.addFeedPublisherModalPopup(rowData);" style="font-size:20px;"> + <a href="">+P</a> + </div> + </td> + <td att-table-body> + <div ng-click="dbcapp.addFeedSubscriberModalPopup(rowData);" style="font-size:20px;"> + <a href="">+S</a> + </div> + </td> + <td att-table-body> + <div ng-click="dbcapp.deleteFeedModalPopup(rowData);" style="font-size:20px;"> + <a href="" class="ion-trash-b"></a> + </div> + </td> + </tr> + </tbody> + </table> + + <div class="fn-ebz-container" > + Page Number: + <select class="fn-ebz-select dbcpageselect" + name="currentPageNumSelector" + ng-model="dbcapp.currentPageNum" + ng-change="dbcapp.loadTable()"> + <option ng-repeat="p in dbcapp.buildArraySizeN(dbcapp.totalPages) track by $index" + value="{{$index+1}}" + ng-selected="{{$index+1}}=={{dbcapp.currentPageNum}}"> + {{$index+1}} + </option> + </select> + Page Count: + <input class="fn-ebz-text dbcpagenum" + type="text" + ng-model="dbcapp.totalPages" + readonly="true"> + Rows per Page: + <select class="fn-ebz-select dbcpageselect" + name="viewPerPageSelector" + ng-model="dbcapp.viewPerPage" + ng-change="dbcapp.loadTable()" + style="height: 30px;"> + <option ng-repeat="v in dbcapp.viewPerPageOptions" + value="{{v.value}}" + ng-selected="{{v.value}}=={{dbcapp.viewPerPage}}"> + {{v.value}} + </option> + </select> + </div> + +</div> +<!-- loading --> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_pub_sub_list_popup_template.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_pub_sub_list_popup_template.html new file mode 100644 index 0000000..80fe26e --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_feed_pub_sub_list_popup_template.html @@ -0,0 +1,122 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<script type="text/ng-template" id="feed_pub_sub_list_popup.html"> + <div class="modal__informative font-showcase" style="width:900px;"> + + <div class="modal__header"> + <h2 class="font-showcase-font-name" style="width: 900px;">{{dbcapp.label}}</h2> + </div> + <div class="divider-container"> + <hr> + </div> + <div class="modal__content"> + <div class="fn-ebz-container"> + + <h4>Publishers</h4> + + <table att-table + id="pubs-table" + table-data="dbcapp.showFeed.pubs" + search-string="dbcapp.searchString" + view-per-page="dbcapp.viewPerPageIgnored" + current-page="dbcapp.currentPageIgnored" + total-page="dbcapp.totalPageIgnored"> + + <thead att-table-row type="header"> + <tr> + <th att-table-header sortable="false" key="pubId">Pub ID</th> + <th att-table-header sortable="false" key="dcaeLocationName">DCAE Location Name</th> + <th att-table-header sortable="false" key="status">Status</th> + <th att-table-header sortable="false" key="username">User Name</th> + </tr> + </thead> + <tbody att-table-row type="body" row-repeat="rowData in dbcapp.showFeed.pubs"> + <tr> + <td att-table-body + ng-bind="rowData.pubId"/> + <td att-table-body + ng-bind="rowData.dcaeLocationName"/> + <td att-table-body + ng-bind="rowData.status"/> + <td att-table-body + ng-bind="rowData.username" + ng-click="dbcapp.editPubModalPopup(rowData)"/> + </tr> + </tbody> + </table> + + <h4>Subscribers</h4> + + <table att-table + id="subs-table" + table-data="dbcapp.showFeed.subs" + search-string="dbcapp.searchString" + view-per-page="dbcapp.viewPerPageIgnored" + current-page="dbcapp.currentPageIgnored" + total-page="dbcapp.totalPageIgnored"> + + <thead att-table-row type="header"> + <tr> + <th att-table-header sortable="false">Sub ID</th> + <th att-table-header sortable="false">DCAE Location Name</th> + <th att-table-header sortable="false">Delivery URL</th> + <th att-table-header sortable="false">Log URL</th> + <th att-table-header sortable="false">Owner</th> + <th att-table-header sortable="false">Status</th> + <th att-table-header sortable="false">Susp</th> + <th att-table-header sortable="false">User Name</th> + </tr> + </thead> + <tbody att-table-row type="body" row-repeat="rowData in dbcapp.showFeed.subs"> + <tr> + <td att-table-body + ng-bind="rowData.subId"/> + <td att-table-body + ng-bind="rowData.dcaeLocationName"/> + <td att-table-body + ng-bind="rowData.deliveryURL"/> + <td att-table-body + ng-bind="rowData.logURL"/> + <td att-table-body + ng-bind="rowData.owner"/> + <td att-table-body + ng-bind="rowData.status"/> + <td att-table-body> + {{rowData.suspended | dbcYesNoFilter}} + </td> + <td att-table-body + ng-bind="rowData.username"/> + </tr> + </tbody> + </table> + + </div> + + <div class="modal__footer"> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.close()"> + Close + </button> + </div> + + </div> + +</script> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_pub_list.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_pub_list.html new file mode 100644 index 0000000..300ec99 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_pub_list.html @@ -0,0 +1,130 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<!-- controller is specified by route provider --> + +<div class="pageTitle"> + <h3 class="heading3" style="margin-top: 10px; margin-bottom: 10px;">Feed Publishers</h3> +</div> + +<div id="button-search-row"> + <!-- NO "add" button on this page --> + <div style="float:right;"> + <div class="form-field form-field__small"> + <input class="fn-ebz-text.search" + type="text" + placeholder="Search publishers" + ng-model="dbcapp.searchString"/> + <i class="ion-search" style="position:relative;line-height:10px;top:-25px;right:-190px"></i> + </div> + </div> + </div> + +<!-- show progress indicator --> +<div ng-show="dbcapp.isDataLoading"> + <div att-loading></div> +</div> + +<div ng-hide="dbcapp.isDataLoading"> + + <div ng-show="dbcapp.isRequestFailed"> + <span class="errorMessageText">{{dbcapp.errMsg}}</span> + </div> + + <div ng-hide="dbcapp.isRequestFailed"> + Access Profile <strong>{{dbcapp.profileName}}</strong>, DMaaP Name <strong>{{dbcapp.dmaapName}}</strong> + </div> + + <table att-table + id="pubs-table" + table-data="dbcapp.tableData" + search-string="dbcapp.searchString" + view-per-page="dbcapp.viewPerPageIgnored" + current-page="dbcapp.currentPageIgnored" + total-page="dbcapp.totalPageIgnored"> + + <thead att-table-row type="header"> + <tr> + <th att-table-header sortable="true" key="pubId">Pub ID</th> + <th att-table-header sortable="true" key="feedId">Feed ID</th> + <th att-table-header sortable="true" key="dcaeLocationName">DCAE Location Name</th> + <th att-table-header sortable="true" key="status">Status</th> + <th att-table-header sortable="true" key="username">User Name</th> + <th att-table-header sortable="false">Delete</th> + </tr> + </thead> + <tbody att-table-row type="body" row-repeat="rowData in dbcapp.tableData"> + <tr> + <td att-table-body + ng-bind="rowData.pubId" + ng-click="dbcapp.editPubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.feedId" + ng-click="dbcapp.editPubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.dcaeLocationName" + ng-click="dbcapp.editPubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.status" + ng-click="dbcapp.editPubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.username" + ng-click="dbcapp.editPubModalPopup(rowData)"/> + <td att-table-body> + <div ng-click="dbcapp.deletePubModalPopup(rowData);" style="font-size:20px;"> + <a href="" class="ion-trash-b"></a> + </div> + </td> + </tr> + </tbody> + </table> + + <div class="fn-ebz-container" > + Page Number: + <select class="fn-ebz-select dbcpageselect" + name="currentPageNumSelector" + ng-model="dbcapp.currentPageNum" + ng-change="dbcapp.loadTable()"> + <option ng-repeat="p in dbcapp.buildArraySizeN(dbcapp.totalPages) track by $index" + value="{{$index+1}}" + ng-selected="{{$index+1}}=={{dbcapp.currentPageNum}}"> + {{$index+1}} + </option> + </select> + Page Count: + <input class="fn-ebz-text dbcpagenum" + type="text" + ng-model="dbcapp.totalPages" + readonly="true"> + Rows per Page: + <select class="fn-ebz-select dbcpageselect" + name="viewPerPageSelector" + ng-model="dbcapp.viewPerPage" + ng-change="dbcapp.loadTable()" + style="height: 30px;"> + <option ng-repeat="v in dbcapp.viewPerPageOptions" + value="{{v.value}}" + ng-selected="{{v.value}}=={{dbcapp.viewPerPage}}"> + {{v.value}} + </option> + </select> + </div> + +</div> +<!-- loading --> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_pub_popup_template.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_pub_popup_template.html new file mode 100644 index 0000000..0e42f62 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_pub_popup_template.html @@ -0,0 +1,60 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<Script type="text/ng-template" id="edit_pub_popup.html"> + <div class="modal__informative font-showcase" style="width:400px;"> + <div class="modal__header"> + <h2 class="font-showcase-font-name" style="width: 500px;">{{dbcapp.label}}</h2> + </div> + <div class="divider-container"> + <hr> + </div> + <div class="modal__content"> + <div class="fn-ebz-container"> + DCAE Location:<sup><b>*</b></sup> + <br/> + <select class="fn-ebz-select dbcselect" ng-model="dbcapp.editPub.dcaeLocationName" ng-options="d for d in dbcapp.dcaeList"></select> + </div> + <br/> + <div class="fn-ebz-container" > + User Name: + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editPub.username" /> + </div> + <br/> + <div class="fn-ebz-container" > + Password: + <br/> + <input type="password" class="fn-ebz-text dbcpassword" ng-model="dbcapp.editPub.userpwd" /> + </div> + </div> + <div class="modal__footer"> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.savePub(dbcapp.editPub);"> + Save + </button> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.close()"> + Close + </button> + </div> + </div> +</script> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_sub_list.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_sub_list.html new file mode 100644 index 0000000..c5d2525 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_sub_list.html @@ -0,0 +1,156 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<!-- controller is specified by route provider --> + +<div class="pageTitle"> + <h3 class="heading3" style="margin-top: 10px; margin-bottom: 10px;">Feed Subscribers</h3> +</div> + +<div id="button-search-row"> + <!-- NO "add" button on this page --> + <div style="float:right;"> + <div class="form-field form-field__small"> + <input class="fn-ebz-text.search" + type="text" + placeholder="Search subscribers" + ng-model="dbcapp.searchString"/> + <i class="ion-search" style="position:relative;line-height:10px;top:-25px;right:-190px"></i> + </div> + </div> + </div> + +<!-- show progress indicator --> +<div ng-show="dbcapp.isDataLoading"> + <div att-loading></div> +</div> + +<div ng-hide="dbcapp.isDataLoading"> + + <div ng-show="dbcapp.isRequestFailed"> + <span class="errorMessageText">{{dbcapp.errMsg}}</span> + </div> + + <div ng-hide="dbcapp.isRequestFailed"> + Access Profile <strong>{{dbcapp.profileName}}</strong>, DMaaP Name <strong>{{dbcapp.dmaapName}}</strong> + </div> + + <table att-table + id="subs-table" + table-data="dbcapp.tableData" + search-string="dbcapp.searchString" + view-per-page="dbcapp.viewPerPageIgnored" + current-page="dbcapp.currentPageIgnored" + total-page="dbcapp.totalPageIgnored"> + + <thead att-table-row type="header"> + <tr> + <th att-table-header sortable="true" key="subId">Sub ID</th> + <th att-table-header sortable="true" key="feedId">Feed ID</th> + <th att-table-header sortable="true" key="dcaeLocationName">DCAE Location Name</th> + <th att-table-header sortable="true" key="deliveryURL">Delivery URL</th> + <th att-table-header sortable="true" key="logURL">Log URL</th> + <th att-table-header sortable="true" key="owner">Owner</th> + <th att-table-header sortable="true" key="status">Status</th> + <th att-table-header sortable="true" key="suspended">Susp</th> + <!-- Ignore until someone explains this field + <th att-table-header sortable="true" key="use100">Use 100</th> + --> + <th att-table-header sortable="true" key="username">User Name</th> + <th att-table-header sortable="false">Delete</th> + </tr> + </thead> + <tbody att-table-row type="body" row-repeat="rowData in dbcapp.tableData"> + <tr> + <td att-table-body + ng-bind="rowData.subId" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.feedId" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.dcaeLocationName" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.deliveryURL" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.logURL" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.owner" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-bind="rowData.status" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body + ng-click="dbcapp.editSubModalPopup(rowData)"> + {{rowData.suspended | dbcYesNoFilter}} + </td> + <!-- Ignore until someone explains this field + <td att-table-body + ng-click="dbcapp.editSubModalPopup(rowData)"> + {{rowData.use100 | dbcYesNoFilter}} + </td> + --> + <td att-table-body + ng-bind="rowData.username" + ng-click="dbcapp.editSubModalPopup(rowData)"/> + <td att-table-body> + <div ng-click="dbcapp.deleteSubModalPopup(rowData);" style="font-size:20px;"> + <a href="" class="ion-trash-b"></a> + </div> + </td> + </tr> + </tbody> + </table> + + <div class="fn-ebz-container" > + Page Number: + <select class="fn-ebz-select dbcpageselect" + name="currentPageNumSelector" + ng-model="dbcapp.currentPageNum" + ng-change="dbcapp.loadTable()"> + <option ng-repeat="p in dbcapp.buildArraySizeN(dbcapp.totalPages) track by $index" + value="{{$index+1}}" + ng-selected="{{$index+1}}=={{dbcapp.currentPageNum}}"> + {{$index+1}} + </option> + </select> + Page Count: + <input class="fn-ebz-text dbcpagenum" + type="text" + ng-model="dbcapp.totalPages" + readonly="true"> + Rows per Page: + <select class="fn-ebz-select dbcpageselect" + name="viewPerPageSelector" + ng-model="dbcapp.viewPerPage" + ng-change="dbcapp.loadTable()" + style="height: 30px;"> + <option ng-repeat="v in dbcapp.viewPerPageOptions" + value="{{v.value}}" + ng-selected="{{v.value}}=={{dbcapp.viewPerPage}}"> + {{v.value}} + </option> + </select> + </div> + +</div> +<!-- loading --> diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_sub_popup_template.html b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_sub_popup_template.html new file mode 100644 index 0000000..10f923c --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/dbcapp/datarouter/dr_sub_popup_template.html @@ -0,0 +1,72 @@ +<!-- + ================================================================================ + DCAE DMaaP Bus Controller Web Application + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + 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. + ================================================================================ + --> +<Script type="text/ng-template" id="edit_sub_popup.html"> + <div class="modal__informative font-showcase" style="width:400px;"> + <div class="modal__header"> + <h2 class="font-showcase-font-name" style="width: 500px;">{{dbcapp.label}}</h2> + </div> + <div class="divider-container"> + <hr> + </div> + <div class="modal__content"> + <div class="fn-ebz-container"> + DCAE Location:<sup><b>*</b></sup> + <br/> + <select class="fn-ebz-select dbcselect" ng-model="dbcapp.editSub.dcaeLocationName" ng-options="d for d in dbcapp.dcaeList"></select> + </div> + <br/> + <div class="fn-ebz-container" > + Delivery URL:<sup><b>*</b></sup> + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editSub.deliveryURL" /> + </div> + <br/> + <div class="fn-ebz-container" > + User Name:<sup><b>*</b></sup> + <br/> + <input type="text" class="fn-ebz-text" ng-model="dbcapp.editSub.username" /> + </div> + <br/> + <div class="fn-ebz-container" > + Password:<sup><b>*</b></sup> + <br/> + <input type="password" class="fn-ebz-text dbcpassword" ng-model="dbcapp.editSub.userpwd" /> + </div> + <br/> + <div class="fn-ebz-container" > + Suspend? + <br/> + <input type="checkbox" att-checkbox ng-model="dbcapp.editSub.suspended" /> + </div> + </div> + <div class="modal__footer"> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.saveSub(dbcapp.editSub);"> + Save + </button> + <button class="button button--primary button--small" + href="javascript:void(0)" + ng-click="dbcapp.close()"> + Close + </button> + </div> + </div> +</script> |