2019-03-21 07:46:49 +02:00
|
|
|
export function SettingsViewModel(data) {
|
2018-07-24 08:49:17 +02:00
|
|
|
this.LogoURL = data.LogoURL;
|
|
|
|
this.BlackListedLabels = data.BlackListedLabels;
|
|
|
|
this.AuthenticationMethod = data.AuthenticationMethod;
|
|
|
|
this.LDAPSettings = data.LDAPSettings;
|
2019-01-16 17:38:07 +02:00
|
|
|
this.OAuthSettings = new OAuthSettingsViewModel(data.OAuthSettings);
|
2018-07-24 08:49:17 +02:00
|
|
|
this.SnapshotInterval = data.SnapshotInterval;
|
2018-08-07 17:43:36 +02:00
|
|
|
this.TemplatesURL = data.TemplatesURL;
|
2019-07-26 10:38:07 +12:00
|
|
|
this.EdgeAgentCheckinInterval = data.EdgeAgentCheckinInterval;
|
2020-05-14 05:14:28 +03:00
|
|
|
this.EnableEdgeComputeFeatures = data.EnableEdgeComputeFeatures;
|
2020-06-09 12:55:36 +03:00
|
|
|
this.UserSessionTimeout = data.UserSessionTimeout;
|
2020-08-07 01:46:25 +03:00
|
|
|
this.EnableTelemetry = data.EnableTelemetry;
|
2021-09-01 09:23:21 +12:00
|
|
|
this.KubeconfigExpiry = data.KubeconfigExpiry;
|
2018-07-24 08:49:17 +02:00
|
|
|
}
|
|
|
|
|
2019-03-21 07:46:49 +02:00
|
|
|
export function PublicSettingsViewModel(settings) {
|
2019-01-16 17:34:12 +02:00
|
|
|
this.AuthenticationMethod = settings.AuthenticationMethod;
|
2020-05-14 05:14:28 +03:00
|
|
|
this.EnableEdgeComputeFeatures = settings.EnableEdgeComputeFeatures;
|
2019-01-16 17:34:12 +02:00
|
|
|
this.LogoURL = settings.LogoURL;
|
|
|
|
this.OAuthLoginURI = settings.OAuthLoginURI;
|
2020-08-07 01:46:25 +03:00
|
|
|
this.EnableTelemetry = settings.EnableTelemetry;
|
2021-06-11 10:09:04 +12:00
|
|
|
this.OAuthLogoutURI = settings.OAuthLogoutURI;
|
2019-01-16 17:34:12 +02:00
|
|
|
}
|
|
|
|
|
2019-03-21 07:46:49 +02:00
|
|
|
export function LDAPSettingsViewModel(data) {
|
2017-08-10 10:35:23 +02:00
|
|
|
this.ReaderDN = data.ReaderDN;
|
|
|
|
this.Password = data.Password;
|
|
|
|
this.URL = data.URL;
|
|
|
|
this.SearchSettings = data.SearchSettings;
|
2018-07-23 07:57:38 +03:00
|
|
|
this.GroupSearchSettings = data.GroupSearchSettings;
|
2018-07-24 08:49:17 +02:00
|
|
|
this.AutoCreateUsers = data.AutoCreateUsers;
|
2017-08-10 10:35:23 +02:00
|
|
|
}
|
|
|
|
|
2019-03-21 07:46:49 +02:00
|
|
|
export function LDAPSearchSettings(BaseDN, UsernameAttribute, Filter) {
|
2017-08-10 10:35:23 +02:00
|
|
|
this.BaseDN = BaseDN;
|
|
|
|
this.UsernameAttribute = UsernameAttribute;
|
|
|
|
this.Filter = Filter;
|
|
|
|
}
|
2018-07-23 07:57:38 +03:00
|
|
|
|
2019-03-21 07:46:49 +02:00
|
|
|
export function LDAPGroupSearchSettings(GroupBaseDN, GroupAttribute, GroupFilter) {
|
2018-07-23 07:57:38 +03:00
|
|
|
this.GroupBaseDN = GroupBaseDN;
|
|
|
|
this.GroupAttribute = GroupAttribute;
|
|
|
|
this.GroupFilter = GroupFilter;
|
|
|
|
}
|
2018-12-30 18:02:22 +02:00
|
|
|
|
2019-03-21 07:46:49 +02:00
|
|
|
export function OAuthSettingsViewModel(data) {
|
2018-12-30 18:02:22 +02:00
|
|
|
this.ClientID = data.ClientID;
|
|
|
|
this.ClientSecret = data.ClientSecret;
|
|
|
|
this.AccessTokenURI = data.AccessTokenURI;
|
|
|
|
this.AuthorizationURI = data.AuthorizationURI;
|
|
|
|
this.ResourceURI = data.ResourceURI;
|
|
|
|
this.RedirectURI = data.RedirectURI;
|
|
|
|
this.UserIdentifier = data.UserIdentifier;
|
|
|
|
this.Scopes = data.Scopes;
|
|
|
|
this.OAuthAutoCreateUsers = data.OAuthAutoCreateUsers;
|
2019-02-07 19:32:02 +01:00
|
|
|
this.DefaultTeamID = data.DefaultTeamID;
|
2021-06-11 10:09:04 +12:00
|
|
|
this.SSO = data.SSO;
|
|
|
|
this.LogoutURI = data.LogoutURI;
|
2020-04-11 00:54:53 +03:00
|
|
|
}
|