mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
feat(registry): gitlab support (#3107)
* feat(api): gitlab registry type * feat(registries): early support for gitlab registries * feat(app): registry service selector * feat(registry): gitlab support : list repositories and tags - remove features missing * feat(registry): gitlab registry remove features * feat(registry): gitlab switch to registry V2 API for repositories and tags * feat(api): use development extension binary * fix(registry): avoid 401 on gitlab retrieve to disconnect the user * feat(registry): gitlab browse projects without extension * style(app): code cleaning * refactor(app): PR review changes + refactor on types * fix(gitlab): remove gitlab info from registrymanagementconfig and force gitlab type * style(api): go fmt * feat(api): update APIVersion and ExtensionDefinitionsURL * fix(api): fix invalid RM extension URL * feat(registry): PAT scope help * feat(registry): defaults on registry creation * style(registry-creation): update layout and text for Gitlab registry * feat(registry-creation): update gitlab notice
This commit is contained in:
parent
03d9d6afbb
commit
198e92c734
38 changed files with 1022 additions and 160 deletions
|
@ -0,0 +1,8 @@
|
|||
export function RegistryGitlabProject(project) {
|
||||
this.Id = project.id;
|
||||
this.Description = project.description;
|
||||
this.Name = project.name;
|
||||
this.Namespace = project.namespace ? project.namespace.name : '';
|
||||
this.PathWithNamespace = project.path_with_namespace;
|
||||
this.RegistryEnabled = project.container_registry_enabled;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import _ from 'lodash-es';
|
||||
export default function RegistryRepositoryViewModel(item) {
|
||||
export function RegistryRepositoryViewModel(item) {
|
||||
if (item.name && item.tags) {
|
||||
this.Name = item.name;
|
||||
this.TagsCount = _.without(item.tags, null).length;
|
||||
|
@ -7,4 +7,9 @@ export default function RegistryRepositoryViewModel(item) {
|
|||
this.Name = item;
|
||||
this.TagsCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
export function RegistryRepositoryGitlabViewModel(data) {
|
||||
this.Name = data.path;
|
||||
this.TagsCount = data.tags.length;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
export const RegistryTypes = Object.freeze({
|
||||
'QUAY': 1,
|
||||
'AZURE': 2,
|
||||
'CUSTOM': 3,
|
||||
'GITLAB': 4
|
||||
})
|
|
@ -1,4 +1,4 @@
|
|||
export function RepositoryTagViewModel(name, os, arch, size, imageDigest, imageId, v2) {
|
||||
export function RepositoryTagViewModel(name, os, arch, size, imageDigest, imageId, v2, history) {
|
||||
this.Name = name;
|
||||
this.Os = os || '';
|
||||
this.Architecture = arch || '';
|
||||
|
@ -6,6 +6,7 @@ export function RepositoryTagViewModel(name, os, arch, size, imageDigest, imageI
|
|||
this.ImageDigest = imageDigest || '';
|
||||
this.ImageId = imageId || '';
|
||||
this.ManifestV2 = v2 || {};
|
||||
this.History = history || [];
|
||||
}
|
||||
|
||||
export function RepositoryShortTag(name, imageId, imageDigest, manifest) {
|
||||
|
@ -13,4 +14,9 @@ export function RepositoryShortTag(name, imageId, imageDigest, manifest) {
|
|||
this.ImageId = imageId;
|
||||
this.ImageDigest = imageDigest;
|
||||
this.ManifestV2 = manifest;
|
||||
}
|
||||
}
|
||||
|
||||
export function RepositoryAddTagPayload(tag, manifest) {
|
||||
this.Tag = tag;
|
||||
this.Manifest = manifest;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue