You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/06/18 16:11:37 UTC
[trafficcontrol] branch master updated: adds db dump link to TP
This is an automated email from the ASF dual-hosted git repository.
dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 6c2fec2 adds db dump link to TP
6c2fec2 is described below
commit 6c2fec28673db44a6d94df5b36ac07cf5169eb33
Author: Jeremy Mitchell <mi...@gmail.com>
AuthorDate: Fri Jun 15 12:59:37 2018 -0600
adds db dump link to TP
---
traffic_portal/app/src/common/api/TrafficPortalService.js | 13 ++++++-------
.../app/src/common/modules/header/HeaderController.js | 5 ++---
.../app/src/common/modules/header/header.tpl.html | 10 +++++-----
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/traffic_portal/app/src/common/api/TrafficPortalService.js b/traffic_portal/app/src/common/api/TrafficPortalService.js
index 857fcbf..27c4100 100644
--- a/traffic_portal/app/src/common/api/TrafficPortalService.js
+++ b/traffic_portal/app/src/common/api/TrafficPortalService.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TrafficPortalService = function($http, $q) {
+var TrafficPortalService = function($http, $q, $window, propertiesModel) {
this.getReleaseVersionInfo = function() {
var deferred = $q.defer();
@@ -34,11 +34,6 @@ var TrafficPortalService = function($http, $q) {
return deferred.promise;
};
- this.dumpDB = function() {
- // todo: need to fix this so it is not hard-coded
- window.location = 'http://localhost:3000/api/1.2/dbdump';
- };
-
this.getProperties = function() {
var deferred = $q.defer();
$http.get('traffic_portal_properties.json')
@@ -51,7 +46,11 @@ var TrafficPortalService = function($http, $q) {
return deferred.promise;
};
+ this.dbDump = function() {
+ $window.open(propertiesModel.properties.api.baseUrl + '1.3/dbdump', '_blank');
+ };
+
};
-TrafficPortalService.$inject = ['$http', '$q'];
+TrafficPortalService.$inject = ['$http', '$q', '$window', 'propertiesModel'];
module.exports = TrafficPortalService;
diff --git a/traffic_portal/app/src/common/modules/header/HeaderController.js b/traffic_portal/app/src/common/modules/header/HeaderController.js
index 46622eb..a4a8565 100644
--- a/traffic_portal/app/src/common/modules/header/HeaderController.js
+++ b/traffic_portal/app/src/common/modules/header/HeaderController.js
@@ -54,9 +54,8 @@ var HeaderController = function($rootScope, $scope, $state, $uibModal, $location
authService.logout();
};
- $scope.dumpDB = function() {
- alert('not working yet');
- // trafficPortalService.dumpDB();
+ $scope.dbDump = function() {
+ trafficPortalService.dbDump();
};
$scope.confirmQueueServerUpdates = function() {
diff --git a/traffic_portal/app/src/common/modules/header/header.tpl.html b/traffic_portal/app/src/common/modules/header/header.tpl.html
index 7fdd650..5f9e2a1 100644
--- a/traffic_portal/app/src/common/modules/header/header.tpl.html
+++ b/traffic_portal/app/src/common/modules/header/header.tpl.html
@@ -62,11 +62,11 @@ under the License.
</ul>
</div>
</li>
- <!--<li>-->
- <!--<div class="btn-group" title="Download DB">-->
- <!--<button type="button" class="btn btn-link" ng-click="dumpDB()"><i class="fa fa-download"></i></button>-->
- <!--</div>-->
- <!--</li>-->
+ <li>
+ <div class="btn-group" title="DB Dump">
+ <button type="button" class="btn btn-link" ng-click="dbDump()"><i class="fa fa-download"></i></button>
+ </div>
+ </li>
<li>
<div class="btn-group" title="Queue CDN Server Updates">
<button type="button" class="btn btn-link" ng-click="confirmQueueServerUpdates()"><i class="fa fa-flag"></i></button>
--
To stop receiving notification emails like this one, please contact
dangogh@apache.org.