You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/06/18 16:11:37 UTC

[GitHub] dangogh closed pull request #2417: adds db dump link to TP

dangogh closed pull request #2417: adds db dump link to TP
URL: https://github.com/apache/trafficcontrol/pull/2417
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/common/api/TrafficPortalService.js b/traffic_portal/app/src/common/api/TrafficPortalService.js
index 857fcbfe5..27c4100ee 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 46622ebd7..a4a856526 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 7fdd65000..5f9e2a10f 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 @@
                     </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>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services