Add ui to configure registry
This commit is contained in:
@@ -308,6 +308,16 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
});
|
||||
}
|
||||
|
||||
function getRegistryConfig() {
|
||||
Client.getRegistryConfig(function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.registryConfig.serverAddress = result.serverAddress;
|
||||
$scope.registryConfig.username = result.username;
|
||||
$scope.registryConfig.password = result.password;
|
||||
});
|
||||
}
|
||||
|
||||
function getSubscription() {
|
||||
$scope.subscriptionBusy = true;
|
||||
|
||||
@@ -353,6 +363,50 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
fr.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
|
||||
$scope.registryConfig = {
|
||||
busy: false,
|
||||
error: null,
|
||||
serverAddress: '',
|
||||
username: '',
|
||||
password: '',
|
||||
|
||||
reset: function () {
|
||||
$scope.cloudronNameChange.busy = false;
|
||||
$scope.registryConfig.error = null;
|
||||
|
||||
$scope.registryConfigForm.$setUntouched();
|
||||
$scope.registryConfigForm.$setPristine();
|
||||
},
|
||||
|
||||
show: function () {
|
||||
$scope.registryConfig.reset();
|
||||
$('#registryConfigModal').modal('show');
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.registryConfig.busy = true;
|
||||
|
||||
var data = {
|
||||
serverAddress: $scope.registryConfig.serverAddress,
|
||||
username: $scope.registryConfig.username,
|
||||
password: $scope.registryConfig.password
|
||||
};
|
||||
|
||||
Client.setRegistryConfig(data, function (error) {
|
||||
$scope.registryConfig.busy = false;
|
||||
|
||||
if (error) {
|
||||
$scope.registryConfig.error = error;
|
||||
return;
|
||||
}
|
||||
|
||||
$('#registryConfigModal').modal('hide');
|
||||
|
||||
getRegistryConfig();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.unstableApps = {
|
||||
busy: false,
|
||||
enabled: false,
|
||||
@@ -425,6 +479,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
Client.onReady(function () {
|
||||
getAutoupdatePattern();
|
||||
getUnstableAppsConfig();
|
||||
getRegistryConfig();
|
||||
|
||||
$scope.update.checkStatus();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user