mirror of https://github.com/portainer/portainer
refactor(auth): move public settings into view model
parent
317bd53e43
commit
80d570861d
|
@ -16,6 +16,16 @@ function SettingsViewModel(data) {
|
||||||
this.EnableHostManagementFeatures = data.EnableHostManagementFeatures;
|
this.EnableHostManagementFeatures = data.EnableHostManagementFeatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function PublicSettingsViewModel(settings) {
|
||||||
|
this.AllowBindMountsForRegularUsers = settings.AllowBindMountsForRegularUsers;
|
||||||
|
this.AllowPrivilegedModeForRegularUsers = settings.AllowPrivilegedModeForRegularUsers;
|
||||||
|
this.AuthenticationMethod = settings.AuthenticationMethod;
|
||||||
|
this.EnableHostManagementFeatures = settings.EnableHostManagementFeatures;
|
||||||
|
this.ExternalTemplates = settings.ExternalTemplates;
|
||||||
|
this.LogoURL = settings.LogoURL;
|
||||||
|
this.OAuthLoginURI = settings.OAuthLoginURI;
|
||||||
|
}
|
||||||
|
|
||||||
function LDAPSettingsViewModel(data) {
|
function LDAPSettingsViewModel(data) {
|
||||||
this.ReaderDN = data.ReaderDN;
|
this.ReaderDN = data.ReaderDN;
|
||||||
this.Password = data.Password;
|
this.Password = data.Password;
|
||||||
|
|
|
@ -27,7 +27,7 @@ angular.module('portainer.app')
|
||||||
|
|
||||||
Settings.publicSettings().$promise
|
Settings.publicSettings().$promise
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
var settings = new SettingsViewModel(data);
|
var settings = new PublicSettingsViewModel(data);
|
||||||
deferred.resolve(settings);
|
deferred.resolve(settings);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
Loading…
Reference in New Issue