Add initial logs view

This commit is contained in:
Johannes Zellner
2017-08-07 13:50:45 +02:00
parent 800468fbe6
commit 125b416463
3 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
'use strict';
angular.module('Application').controller('LogsController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
$scope.config = Client.getConfig();
$scope.user = Client.getUserInfo();
$scope.logs = {
types: null,
selectedUrl: '' // index into types
};
$scope.populateLogTypes = function () {
$scope.logs.types = [
{ name: 'System (All)', url: Client.makeURL('/api/v1/cloudron/logs?units=all') },
{ name: 'Box', url: Client.makeURL('/api/v1/cloudron/logs?units=box') },
{ name: 'Mail', url: Client.makeURL('/api/v1/cloudron/logs?units=mail') }
];
Client.getInstalledApps().forEach(function (app) {
$scope.logs.types.push({ name: app.fqdn, url: Client.makeURL('/api/v1/apps/' + app.id + '/logs') });
});
};
Client.onReady($scope.populateLogTypes);
}]);