From 34e2178752e59da686feeb5d894704b956f78e0a Mon Sep 17 00:00:00 2001
From: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Date: Wed, 10 Aug 2022 12:21:17 +1200
Subject: [PATCH] feat(ui): portainer registry boxselector icon ce EE-3848
(#7419)
* add icon to registry boxselector
---
.../registries/create/createRegistry.html | 73 +------------------
.../create/createRegistryController.js | 49 +++++++++++++
.../views/registries/create/options.tsx | 59 +++++++++++++++
3 files changed, 109 insertions(+), 72 deletions(-)
create mode 100644 app/portainer/views/registries/create/options.tsx
diff --git a/app/portainer/views/registries/create/createRegistry.html b/app/portainer/views/registries/create/createRegistry.html
index 2792cc296..358f3868a 100644
--- a/app/portainer/views/registries/create/createRegistry.html
+++ b/app/portainer/views/registries/create/createRegistry.html
@@ -10,78 +10,7 @@
{
this.model = new RegistryCreateFormValues();
this.model.Type = RegistryTypes.DOCKERHUB;
this.selectDockerHub();
+ this.state.availableRegistry = options;
+ // Default registryValue is DockerHub, which is 6
+ this.state.registryValue = '6';
const from = this.$transition$.from();
const params = this.$transition$.params('from');
diff --git a/app/portainer/views/registries/create/options.tsx b/app/portainer/views/registries/create/options.tsx
new file mode 100644
index 000000000..8346312f3
--- /dev/null
+++ b/app/portainer/views/registries/create/options.tsx
@@ -0,0 +1,59 @@
+import Docker from '@/assets/ico/vendor/docker.svg?c';
+import Ecr from '@/assets/ico/vendor/ecr.svg?c';
+import Quay from '@/assets/ico/vendor/quay.svg?c';
+import Proget from '@/assets/ico/vendor/proget.svg?c';
+import Azure from '@/assets/ico/vendor/azure.svg?c';
+import Gitlab from '@/assets/ico/vendor/gitlab.svg?c';
+import Custom from '@/assets/ico/custom.svg?c';
+
+export const options = [
+ {
+ id: 'registry_dockerhub',
+ icon: Docker,
+ label: 'DockerHub',
+ description: 'DockerHub authenticated account',
+ value: '6',
+ },
+ {
+ id: 'registry_aws_ecr',
+ icon: Ecr,
+ label: 'AWS ECR',
+ description: 'Amazon elastic container registry',
+ value: '7',
+ },
+ {
+ id: 'registry_quay',
+ icon: Quay,
+ label: 'Quay.io',
+ description: 'Quay container registry',
+ value: '1',
+ },
+ {
+ id: 'registry_proget',
+ icon: Proget,
+ label: 'ProGet',
+ description: 'ProGet container registry',
+ value: '5',
+ },
+ {
+ id: 'registry_azure',
+ icon: Azure,
+ label: 'Azure',
+ description: 'Azure container registry',
+ value: '2',
+ },
+ {
+ id: 'registry_gitlab',
+ icon: Gitlab,
+ label: 'Gitlab',
+ description: 'Gitlab container registry',
+ value: '4',
+ },
+ {
+ id: 'registry_custom',
+ icon: Custom,
+ label: 'Custom registry',
+ description: 'Define your own registry',
+ value: '3',
+ },
+];