Show cloudron name in login view

This commit is contained in:
Johannes Zellner
2020-03-05 17:03:26 -08:00
parent d663930d66
commit dffaaf067d
2 changed files with 16 additions and 5 deletions
+11
View File
@@ -13,6 +13,7 @@ app.controller('LoginController', ['$scope', '$http', function ($scope, $http) {
$scope.mode = '';
$scope.busy = false;
$scope.error = false;
$scope.cloudronName = 'Cloudron';
$scope.username = '';
$scope.password = '';
$scope.totpToken = '';
@@ -112,6 +113,16 @@ app.controller('LoginController', ['$scope', '$http', function ($scope, $http) {
setTimeout(function () { $('#inputNewPassword').focus(); }, 200);
};
$http.get(API_ORIGIN + '/api/v1/cloudron/status').success(function (data, status) {
$scope.initialized = true;
if (status !== 200) return;
$scope.cloudronName = data.cloudronName;
}).error(function () {
$scope.initialized = false;
});
// Init into the correct view
if (search.passwordReset) $scope.showPasswordReset();
else if (search.resetToken) $scope.showNewPassword();