Improve loading state in support view
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
angular.module('Application').controller('SupportController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
|
||||
Client.onReady(function () { if (!Client.getUserInfo().isAtLeastAdmin) $location.path('/'); });
|
||||
|
||||
$scope.ready = false;
|
||||
$scope.config = Client.getConfig();
|
||||
$scope.user = Client.getUserInfo();
|
||||
$scope.apps = Client.getInstalledApps();
|
||||
@@ -86,28 +87,24 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
|
||||
});
|
||||
};
|
||||
|
||||
function getSubscription() {
|
||||
Client.onReady(function () {
|
||||
Client.getSubscription(function (error, result) {
|
||||
if (error && error.statusCode === 412) return; // not yet registered
|
||||
if (error) return console.error(error);
|
||||
|
||||
console.log(result);
|
||||
$scope.subscription = result;
|
||||
});
|
||||
}
|
||||
|
||||
Client.onReady(function () {
|
||||
getSubscription();
|
||||
|
||||
Client.getSupportConfig(function (error, supportConfig) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.supportConfig = supportConfig;
|
||||
|
||||
Client.getRemoteSupport(function (error, enabled) {
|
||||
Client.getSupportConfig(function (error, supportConfig) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.sshSupportEnabled = enabled;
|
||||
$scope.supportConfig = supportConfig;
|
||||
|
||||
Client.getRemoteSupport(function (error, enabled) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.sshSupportEnabled = enabled;
|
||||
$scope.ready = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user