Revert "dashboard: first use profile background if not exist try branding background"
This reverts commit 8db6da2de9.
This commit is contained in:
@@ -828,6 +828,7 @@ 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);
|
||||
@@ -2402,6 +2403,10 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.getBackgroundImageUrl = function () {
|
||||
return client.apiOrigin + '/api/v1/profile/background_image?access_token=' + token + '&bustcache=' + Date.now();
|
||||
};
|
||||
|
||||
Client.prototype.setBackgroundImage = function (backgroundImage, callback) {
|
||||
// Blob type if object
|
||||
var fd = new FormData();
|
||||
@@ -2598,30 +2603,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.refreshBranding = function (callback) {
|
||||
var that = this;
|
||||
|
||||
// currently only deals with background
|
||||
this.refreshProfile(function () {
|
||||
that.hasCloudronBackground(function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if (that._userInfo && that._userInfo.hasBackgroundImage) {
|
||||
document.getElementById('mainContentContainer').style.backgroundImage = 'url("' + that.apiOrigin + '/api/v1/profile/background_image?access_token=' + token + '&bustcache=' + Date.now() + '")';
|
||||
document.getElementById('mainContentContainer').classList.add('has-background');
|
||||
} else if (result) {
|
||||
document.getElementById('mainContentContainer').style.backgroundImage = 'url("' + that.apiOrigin + '/api/v1/cloudron/background?bustcache=' + Date.now() + '")';
|
||||
document.getElementById('mainContentContainer').classList.add('has-background');
|
||||
} else {
|
||||
document.getElementById('mainContentContainer').style.backgroundImage = 'none';
|
||||
document.getElementById('mainContentContainer').classList.remove('has-background');
|
||||
}
|
||||
|
||||
callback(null);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype._appPostProcess = function (app) {
|
||||
// calculate the icon paths
|
||||
app.iconUrl = app.iconUrl ? (this.apiOrigin + app.iconUrl + '?access_token=' + token + '&ts=' + app.ts) : null;
|
||||
|
||||
Reference in New Issue
Block a user