mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(registry): fix order of registries in drop down menu EE-1939 (#5960)
Co-authored-by: Prabhat Khera <prabhat.khera@portainer.io>
This commit is contained in:
parent
1e80061186
commit
c24dc3112b
1 changed files with 5 additions and 1 deletions
|
@ -80,10 +80,14 @@ class porImageRegistryController {
|
|||
let showDefaultRegistry = false;
|
||||
this.registries = await this.EndpointService.registries(this.endpoint.Id, this.namespace);
|
||||
|
||||
// Sort the registries by Name
|
||||
this.registries.sort((a, b) => a.Name.localeCompare(b.Name));
|
||||
|
||||
// hide default(anonymous) dockerhub registry if user has an authenticated one
|
||||
if (!this.registries.some((registry) => registry.Type === RegistryTypes.DOCKERHUB)) {
|
||||
showDefaultRegistry = true;
|
||||
this.registries.push(this.defaultRegistry);
|
||||
// Add dockerhub on top
|
||||
this.registries.splice(0, 0, this.defaultRegistry);
|
||||
}
|
||||
|
||||
const id = this.model.Registry.Id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue