feat(app/portainer): backport portainer/models changes

This commit is contained in:
LP B
2021-05-11 18:03:09 +02:00
parent bbeeef1d62
commit 40e3eba979
3 changed files with 10 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
export function DockerHubViewModel(data) {
this.Name = 'DockerHub';
this.URL = '';
this.Authentication = data.Authentication;
this.Username = data.Username;
this.Password = data.Password;
import { RegistryTypes } from './registryTypes';
export function DockerHubViewModel() {
this.Type = RegistryTypes.ANONYMOUS;
this.Name = 'DockerHub (anonymous)';
this.URL = 'docker.io';
}

View File

@@ -9,10 +9,7 @@ export function RegistryViewModel(data) {
this.Authentication = data.Authentication;
this.Username = data.Username;
this.Password = data.Password;
this.AuthorizedUsers = data.AuthorizedUsers;
this.AuthorizedTeams = data.AuthorizedTeams;
this.UserAccessPolicies = data.UserAccessPolicies;
this.TeamAccessPolicies = data.TeamAccessPolicies;
this.RegistryAccesses = data.RegistryAccesses; // map[EndpointID]{UserAccessPolicies, TeamAccessPolicies, NamespaceAccessPolicies}
this.Checked = false;
this.Gitlab = data.Gitlab;
this.Quay = data.Quay;
@@ -39,7 +36,7 @@ export function RegistryManagementConfigurationDefaultModel(registry) {
}
}
export function RegistryDefaultModel() {
export function RegistryCreateFormValues() {
this.Type = RegistryTypes.CUSTOM;
this.URL = '';
this.Name = '';

View File

@@ -1,6 +1,8 @@
export const RegistryTypes = Object.freeze({
ANONYMOUS: 0, // not backend replicated, only for frontend
QUAY: 1,
AZURE: 2,
CUSTOM: 3,
GITLAB: 4,
DOCKERHUB: 5,
});