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

View File

@@ -679,6 +679,20 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}).error(defaultErrorHandler(callback));
};
Client.prototype.getAddons = function (callback) {
get('/api/v1/addons').success(function (data, status) {
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data.addons);
}).error(defaultErrorHandler(callback));
};
Client.prototype.getAddon = function (addon, callback) {
get('/api/v1/addons/' + addon).success(function (data, status) {
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data.addon);
}).error(defaultErrorHandler(callback));
};
Client.prototype.getUsers = function (callback) {
get('/api/v1/users').success(function (data, status) {
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));

View File

@@ -70,6 +70,9 @@ app.config(['$routeProvider', function ($routeProvider) {
}).when('/users', {
controller: 'UsersController',
templateUrl: 'views/users.html?<%= revision %>'
}).when('/addons', {
controller: 'AddonsController',
templateUrl: 'views/addons.html?<%= revision %>'
}).when('/appstore', {
controller: 'AppStoreController',
templateUrl: 'views/appstore.html?<%= revision %>'