Add initial addons view

This commit is contained in:
Johannes Zellner
2018-11-15 19:59:24 +01:00
parent 85e467581c
commit 699db93b18
5 changed files with 103 additions and 0 deletions

17
src/views/addons.js Normal file
View File

@@ -0,0 +1,17 @@
'use strict';
angular.module('Application').controller('AddonsController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); });
$scope.ready = false;
$scope.addons = [];
Client.onReady(function () {
Client.getAddons(function (error, result) {
if (error) return Client.error(error);
$scope.addons = result.map(function (a) { return { name: a }; });
$scope.ready = true;
});
});
}]);