dashboard: add UI to change background image
This commit is contained in:
@@ -826,8 +826,16 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.hasCloudronBackground = function (callback) {
|
||||
get('/api/v1/branding/cloudron_background', null, function (error, data, status) {
|
||||
console.log('hasCloudronBackground...')
|
||||
if (error && error.statusCode !== 404) callback(error);
|
||||
else if (error) callback(null, false);
|
||||
else callback(null, status === 200);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.changeCloudronBackground = function (background, callback) {
|
||||
// Blob type if object
|
||||
var fd = new FormData();
|
||||
if (background) fd.append('background', background);
|
||||
|
||||
@@ -839,6 +847,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
post('/api/v1/branding/cloudron_background', fd, config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user