Skip to content
Snippets Groups Projects
Commit 0806f299 authored by Erik Reid's avatar Erik Reid
Browse files

use new api for ui

parent a4fb536a
No related branches found
No related tags found
No related merge requests found
...@@ -30,21 +30,35 @@ ...@@ -30,21 +30,35 @@
{{ update_request_status }} {{ update_request_status }}
</div> </div>
<span class="grid-item" ng-show="latch_error||latch_pending"> <span class="grid-item" ng-show="errors.length">
<table class="table table-striped" summary="update tasks"> <table class="table table-striped" summary="error messages">
<tr> <tr>
<th colspan="4" scope="col">update tasks</th> <th scope="col">errorss</th>
</tr>
<tr ng-repeat="description in errors">
<td>{{ description }}</td>
</tr>
</table>
</span>
<span class="grid-item" ng-show="warnings.length">
<table class="table table-striped" summary="warning messages">
<tr>
<th scope="col">warnings</th>
</tr>
<tr ng-repeat="description in warnings">
<td>{{ description }}</td>
</tr>
</table>
</span>
<span class="grid-item" ng-show="pending.length">
<table class="table table-striped" summary="pending tasks">
<tr> <tr>
<th scope="col">name</th> <th scope="col">pending tasks</th>
<th scope="col">status</th>
<th scope="col">success</th>
<th scope="col">message</th>
</tr> </tr>
<tr ng-repeat="t in tasks"> <tr ng-repeat="description in pending">
<td>{{ t.name }}</td> <td>{{ description }}</td>
<td>{{ t.status }}</td>
<td>{{ t.success }}</td>
<td>{{ t.message }}</td>
</tr> </tr>
</table> </table>
</span> </span>
......
...@@ -9,7 +9,10 @@ myApp.controller('update', function($scope, $http, $timeout) { ...@@ -9,7 +9,10 @@ myApp.controller('update', function($scope, $http, $timeout) {
$scope.update_request_status = ""; $scope.update_request_status = "";
$scope.update_request_error = false; $scope.update_request_error = false;
$scope.tasks = []; $scope.pending = [];
$scope.failed = [];
$scope.errors = [];
$scope.warnings = [];
$scope.check_status = function() { $scope.check_status = function() {
...@@ -46,25 +49,23 @@ myApp.controller('update', function($scope, $http, $timeout) { ...@@ -46,25 +49,23 @@ myApp.controller('update', function($scope, $http, $timeout) {
$http({ $http({
method: 'GET', method: 'GET',
// url: window.location.origin + "/jobs/check-task-status/9d1cbcd2-c377-4b7a-b969-04ce17f03f20" url: window.location.origin + "/jobs/log"
url: window.location.origin + "/jobs/check-update-status"
}).then( }).then(
/* ok response */ /* ok response */
function(rsp) { function(rsp) {
console.log('got update status rsp: ' + JSON.stringify(rsp.data).substring(0,30)); console.log('got update status rsp: ' + JSON.stringify(rsp.data).substring(0,30));
$scope.tasks = rsp.data.map(t => ({ $scope.pending = rsp.data.pending;
id: t.id, $scope.failed = rsp.data.failed;
parent: t.parent, $scope.warnings = rsp.data.warnings;
status: t.status, $scope.errors = rsp.data.errors;
success: t.ready ? (t.success ? "OK" : "NO") : "-",
message: (t.result && t.result.message) ? t.result.message.substring(0,100) : "",
name: t.result ? t.result.task : "",
}));
}, },
/* error response */ /* error response */
function(rsp) { function(rsp) {
// assume this is 404 ... // assume this is 404 ...?
$scope.tasks = []; $scope.pending = [];
$scope.failed = [];
$scope.errors = [];
$scope.warnings = [];
} }
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment