mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-21 06:45:24 -06:00
implement redirection when there are no more running backups (#92)
This commit is contained in:
parent
48afa6a814
commit
6147a568ba
2 changed files with 8 additions and 2 deletions
|
|
@ -266,7 +266,7 @@ class Alert(Resource):
|
|||
message = args['message']
|
||||
level = args['level'] or 'danger'
|
||||
flash(args['message'], level)
|
||||
return {'message': message}, 200
|
||||
return {'message': message}, 201
|
||||
|
||||
|
||||
@ns.route('/about.json',
|
||||
|
|
|
|||
|
|
@ -59,11 +59,17 @@ app.controller('LiveCtrl', function($scope, $http, $interval) {
|
|||
$scope.clients = [];
|
||||
$scope.clients.push(data);
|
||||
}
|
||||
if ($scope.clients.length == 0) {
|
||||
$http.post('{{ url_for("api.alert") }}', {'message': 'No more backup running'});
|
||||
document.location = '{{ url_for("view.home") }}';
|
||||
}
|
||||
})
|
||||
.error(function(data, status, headers, config) {
|
||||
// TODO: redirect when there are no running backup
|
||||
$scope.stopTimer();
|
||||
errorsHandler(data);
|
||||
setTimeout(function() {
|
||||
document.location = '{{ url_for("view.home") }}';
|
||||
}, 5000);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue