Sort daemons (logs)

This commit is contained in:
Jesús Ángel 2018-08-16 11:58:04 +02:00 committed by Javier Castro
parent fac3b55e29
commit 6cf26d9dd6
2 changed files with 4 additions and 3 deletions

View File

@ -56,8 +56,9 @@ app.controller('managerLogController', function ($scope, apiReq, errorHandler, c
const initialize = async () => {
try{
const data = await apiReq.request('GET', '/manager/logs/summary', {});
$scope.summary = data.data.data;
const data = await apiReq.request('GET', '/manager/logs/summary', {});
const daemons = data.data.data;
$scope.daemons = Object.keys(daemons).map(item => { return { title: item } })
if(!$scope.$$phase) $scope.$digest();
return;
} catch (error) {

View File

@ -23,7 +23,7 @@
<select flex class="kuiSelect wz-border-none cursor-pointer" ng-disabled="realtime" id="categoryBox" ng-model="category" ng-change="filter({name:'category',value:category})"
aria-label="Logs category">
<option value="all">All daemons</option>
<option ng-repeat="(key, value) in summary" value="{{key}}">{{key}}</option>
<option ng-repeat="daemon in daemons | orderObjectBy: 'title'" value="{{daemon.title}}">{{daemon.title}}</option>
</select>
</div>
<!-- End daemon selector -->