-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOTECH-2729: Migrate Queues Admin Interface (#44)
* MOTECH-2729: Migrate Queues Admin Interface -Add all files * MOTECH-2729: Migrate Queues Admin Interface -first page works correctly -second page doesn't work * MOTECH-2729: Migrate Queues Admin Interface -second page start work * MOTECH-2729: Migrate Queues Admin Interface -everything works * MOTECH-2729: Migrate Queues Admin Interface -change table to motech-list * MOTECH-2729: Migrate Queues Admin Interface -delete css
- Loading branch information
1 parent
06ae72e
commit 067e06f
Showing
8 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<nav> | ||
<a ui-sref-active="active" ui-sref="queues">{{'admin.queue.statistics'|translate}}</a> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('motech-admin') | ||
.controller('QueueController', controller); | ||
|
||
controller.$inject = ['$scope', '$stateParams', '$http', 'ServerService']; | ||
function controller ($scope, $stateParams, $http, ServerService) { | ||
$scope.dataAvailable = true; | ||
$http.get(ServerService.formatURL('/module/admin/api/queues/browse?queueName=' + $stateParams.queueName)).success(function (data) { | ||
$scope.messages = data; | ||
}).error(function () { | ||
$scope.dataAvailable = false; | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<motech-list ng-show="dataAvailable"> | ||
<motech-list-item ng-repeat="message in messages" > | ||
<motech-list-column column-title="Message ID" sortable>{{message.messageId}}</motech-list-column> | ||
<motech-list-column column-title="Redelivered" sortable>{{message.redelivered}}</motech-list-column> | ||
<motech-list-column column-title="Timestamp" sortable>{{message.timestamp}}</motech-list-column> | ||
</motech-list-item> | ||
</motech-list> | ||
<div class="row inside" ng-show="!dataAvailable"> | ||
{{'admin.queue.message.error'|translate}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('motech-admin') | ||
.config(adminRoutes); | ||
|
||
adminRoutes.$inject = ['$stateProvider']; | ||
function adminRoutes ($stateProvider) { | ||
$stateProvider | ||
.state('queues', { | ||
url: '/queues', | ||
ncyBreadcrumb: { | ||
label: 'admin.queue.statistics' | ||
}, | ||
views: { | ||
'appArea@': { | ||
templateUrl: '/admin/queues/queues-list.html', | ||
controller: 'AdminQueueStatsCtrl' | ||
}, | ||
'secondaryNav@': { | ||
templateUrl: '/admin/queues/nav.html' | ||
} | ||
} | ||
}) | ||
.state('queues.queue', { | ||
url: '/:queueName', | ||
ncyBreadcrumb: { | ||
label: 'admin.queue.messages.pending' | ||
}, | ||
views: { | ||
'appArea@': { | ||
templateUrl: '/admin/queues/queue.html', | ||
controller: 'QueueController' | ||
} | ||
} | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('motech-admin') | ||
.controller('AdminQueueStatsCtrl', adminQueueStatsCtrl); | ||
|
||
adminQueueStatsCtrl.$inject = ['$scope', '$rootScope', 'QueuesFactory']; | ||
function adminQueueStatsCtrl ($scope, $rootScope, QueuesFactory) { | ||
|
||
$scope.dataAvailable = true; | ||
QueuesFactory.query(function(queues){ | ||
$scope.queues = queues; | ||
}, function(){ | ||
$scope.dataAvailable = false; | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<motech-list ng-show="dataAvailable"> | ||
<motech-list-item ng-repeat="queue in queues" > | ||
<motech-list-column column-title="Name" sortable> | ||
<a ui-sref="queues.queue({queueName: queue.destination})">{{queue.destination}}</a> | ||
</motech-list-column> | ||
<motech-list-column column-title="Number of Pending Messages" sortable>{{queue.queueSize}}</motech-list-column> | ||
<motech-list-column column-title="Consumer Count" sortable>{{queue.consumerCount}}</motech-list-column> | ||
<motech-list-column column-title="Enqueue Count" sortable>{{queue.enqueueCount}}</motech-list-column> | ||
<motech-list-column column-title="Dequeue Count" sortable>{{queue.dequeueCount}}</motech-list-column> | ||
<motech-list-column column-title="Expiry Count" sortable>{{queue.expiredCount}}</motech-list-column> | ||
</motech-list-item> | ||
</motech-list> | ||
<div class="alert alert-danger" ng-show="!dataAvailable"> | ||
{{'admin.queue.error'|translate}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('motech-admin') | ||
.factory('QueuesFactory', queuesFactory); | ||
|
||
queuesFactory.$inject = ['$rootScope', '$resource', 'ServerService']; | ||
function queuesFactory ($rootScope, $resource, ServerService) { | ||
return $resource(ServerService.formatURL('/module/admin/api/queues/')); | ||
} | ||
|
||
})(); |