Skip to content

Commit

Permalink
load request history on load or request execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Menezes committed Mar 9, 2017
1 parent 316c2e0 commit 7329e19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ angular.module('cerebro').controller('RestController', ['$scope', '$http',

var success = function(response) {
$scope.response = $sce.trustAsHtml(JSONTree.create(response));
$scope.loadHistory();
};

var failure = function(response) {
Expand All @@ -1149,6 +1150,7 @@ angular.module('cerebro').controller('RestController', ['$scope', '$http',
AlertService.error('Error while loading cluster mappings', error);
}
);
$scope.loadHistory();
};

$scope.loadRequest = function(request) {
Expand Down
2 changes: 1 addition & 1 deletion public/rest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
<div class="row">
<div class="col-xs-12">
<a data-toggle="collapse" data-parent="#restAccordion" target="_self" href="#restHistory" ng-click="loadHistory()">
<a data-toggle="collapse" data-parent="#restAccordion" target="_self" href="#restHistory">
<i class="fa fa-history"></i> previous requests
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/rest/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ angular.module('cerebro').controller('RestController', ['$scope', '$http',

var success = function(response) {
$scope.response = $sce.trustAsHtml(JSONTree.create(response));
$scope.loadHistory();
};

var failure = function(response) {
Expand All @@ -40,6 +41,7 @@ angular.module('cerebro').controller('RestController', ['$scope', '$http',
AlertService.error('Error while loading cluster mappings', error);
}
);
$scope.loadHistory();
};

$scope.loadRequest = function(request) {
Expand Down

0 comments on commit 7329e19

Please sign in to comment.