track current config separately

This commit is contained in:
Girish Ramakrishnan
2019-11-07 23:04:02 -08:00
parent 97782d29cc
commit b6b5875786
2 changed files with 15 additions and 9 deletions
+5 -5
View File
@@ -117,13 +117,13 @@
</div>
<div class="form-group">
<label class="control-label" for="registryConfigEmail">Email</label>
<input type="text" class="form-control" ng-model="registryConfig.email" id="registryConfigEmail" name="email" ng-disabled="registryConfig.busy" ng-required>
<label class="control-label" for="registryConfigEmail">Email (Optional)</label>
<input type="text" class="form-control" ng-model="registryConfig.email" id="registryConfigEmail" name="email" ng-disabled="registryConfig.busy">
</div>
<div class="form-group">
<label class="control-label" for="registryConfigPassword">Password/Token</label>
<input type="text" class="form-control" ng-model="registryConfig.password" id="registryConfigPassword" name="password" ng-disabled="registryConfig.busy" ng-required>
<input type="password" class="form-control" ng-model="registryConfig.password" id="registryConfigPassword" name="password" ng-disabled="registryConfig.busy" ng-required>
</div>
</fieldset>
</form>
@@ -326,7 +326,7 @@
<span class="text-muted">Server address</span>
</div>
<div class="col-xs-6 text-right">
<span>{{ registryConfig.serverAddress || 'Not set' }}</span>
<span>{{ registryConfig.currentConfig.serverAddress || 'Not set' }}</span>
</div>
</div>
<div class="row">
@@ -334,7 +334,7 @@
<span class="text-muted">Username</span>
</div>
<div class="col-xs-6 text-right">
<span>{{ registryConfig.username || registryConfig.email || 'Not set' }}</span>
<span>{{ registryConfig.currentConfig.username || registryConfig.currentConfig.email || 'Not set' }}</span>
</div>
</div>
<br/>
+10 -4
View File
@@ -312,10 +312,10 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
Client.getRegistryConfig(function (error, result) {
if (error) return console.error(error);
$scope.registryConfig.serverAddress = result.serverAddress;
$scope.registryConfig.username = result.username || '';
$scope.registryConfig.email = result.email || '';
$scope.registryConfig.password = result.password;
$scope.registryConfig.currentConfig.serverAddress = result.serverAddress;
$scope.registryConfig.currentConfig.username = result.username || '';
$scope.registryConfig.currentConfig.email = result.email || '';
$scope.registryConfig.currentConfig.password = result.password;
});
}
@@ -371,11 +371,17 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
username: '',
password: '',
email: '',
currentConfig: {},
reset: function () {
$scope.cloudronNameChange.busy = false;
$scope.registryConfig.error = null;
$scope.registryConfig.serverAddress = $scope.registryConfig.currentConfig.serverAddress;
$scope.registryConfig.username = $scope.registryConfig.currentConfig.username;
$scope.registryConfig.email = $scope.registryConfig.currentConfig.email;
$scope.registryConfig.password = $scope.registryConfig.currentConfig.password;
$scope.registryConfigForm.$setUntouched();
$scope.registryConfigForm.$setPristine();
},