Преглед изворни кода

Add Oracle PCA X9-2 Logos and Configuration

This commit adds the logos and configuration for the new Oracle Private
Cloud Appliance X9-2. These updates will allow users to easily identify
and access the new provider.
Sergiu Miclea пре 3 година
родитељ
комит
ba1c4912a9

+ 8 - 0
config.ts

@@ -88,6 +88,12 @@ const conf: Config = {
       requiredFields: ["compartment", "availability_domain", "vcn_compartment"],
       relistFields: ["migr_image_map", "migr_image"],
     },
+    {
+      name: "opca",
+      types: ["destination"],
+      requiredFields: ["compartment", "availability_domain", "vcn_compartment"],
+      relistFields: ["migr_image_map", "migr_image"],
+    },
     {
       name: "vmware_vsphere",
       types: ["destination"],
@@ -114,6 +120,7 @@ const conf: Config = {
     opc: 3,
     oracle_vm: 3,
     olvm: 3,
+    opca: 3,
     rhev: 3,
     metal: 4,
   },
@@ -127,6 +134,7 @@ const conf: Config = {
     kubevirt: "KubeVirt",
     scvmm: "SCVMM",
     oci: "OCI",
+    opca: "Oracle PCA X9-2",
     opc: "Oracle Cloud",
     oracle_vm: "Oracle VM",
     olvm: "OLVM",

Разлика између датотеке није приказан због своје велике величине
+ 23 - 0
server/api/resources/providerLogos/opca-128-disabled.svg


Разлика између датотеке није приказан због своје велике величине
+ 23 - 0
server/api/resources/providerLogos/opca-128.svg


Разлика између датотеке није приказан због своје велике величине
+ 24 - 0
server/api/resources/providerLogos/opca-32-white.svg


Разлика између датотеке није приказан због своје велике величине
+ 21 - 0
server/api/resources/providerLogos/opca-32.svg


Разлика између датотеке није приказан због своје велике величине
+ 21 - 0
server/api/resources/providerLogos/opca-42.svg


Разлика између датотеке није приказан због своје велике величине
+ 20 - 0
server/api/resources/providerLogos/opca-64.svg


+ 1 - 0
src/@types/Providers.ts

@@ -16,6 +16,7 @@ export type ProviderTypes =
   | "azure"
   | "openstack"
   | "opc"
+  | "opca"
   | "oracle_vm"
   | "vmware_vsphere"
   | "aws"

+ 3 - 0
src/components/modules/MinionModule/MinionEndpointModal/MinionEndpointModal.tsx

@@ -42,9 +42,12 @@ const ContentWrapper = styled.div`
     display: flex;
     justify-content: center;
     margin-left: -24px;
+    margin-top: -24px;
     transition: all 250ms ease-out;
+    flex-wrap: wrap;
     > div {
       margin-left: 24px;
+      margin-top: 24px;
     }
   }
 `;

+ 4 - 1
src/plugins/index.ts

@@ -17,6 +17,7 @@ import DefaultConnectionSchemaPlugin from "./default/ConnectionSchemaPlugin";
 import AzureConnectionSchemaPlugin from "./azure/ConnectionSchemaPlugin";
 import OpenstackConnectionSchemaPlugin from "./openstack/ConnectionSchemaPlugin";
 import OciConnectionSchemaPlugin from "./oci/ConnectionSchemaPlugin";
+import OpcaConnectionSchemaPlugin from "./opca/ConnectionSchemaPlugin";
 import KubevirtConnectionSchemaPlugin from "./kubevirt/ConnectionSchemaPlugin";
 
 import DefaultContentPlugin from "./default/ContentPlugin";
@@ -39,7 +40,8 @@ import OciInstanceInfoPlugin from "./oci/InstanceInfoPlugin";
 import DefaultMinionPoolSchemaPlugin from "./default/MinionPoolSchemaPlugin";
 import OpenstackMinionPoolSchemaPlugin from "./openstack/MinionPoolSchemaPlugin";
 
-const hasKey = <O>(obj: O, key: keyof any): key is keyof O => key in obj;
+const hasKey = <O extends object>(obj: O, key: keyof any): key is keyof O =>
+  key in obj;
 
 export const ConnectionSchemaPlugin = {
   for: (provider: ProviderTypes) => {
@@ -48,6 +50,7 @@ export const ConnectionSchemaPlugin = {
       azure: new AzureConnectionSchemaPlugin(),
       openstack: new OpenstackConnectionSchemaPlugin(),
       oci: new OciConnectionSchemaPlugin(),
+      opca: new OpcaConnectionSchemaPlugin(),
       kubevirt: new KubevirtConnectionSchemaPlugin(),
     };
     if (hasKey(map, provider)) {

+ 32 - 0
src/plugins/opca/ConnectionSchemaPlugin.ts

@@ -0,0 +1,32 @@
+/*
+Copyright (C) 2023  Cloudbase Solutions SRL
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import type { Schema } from "@src/@types/Schema";
+import type { Field } from "@src/@types/Field";
+
+import ConnectionSchemaParserBase from "@src/plugins/default/ConnectionSchemaPlugin";
+
+const TEXT_AREA_FIELDS = ["private_key_data", "custom_certificate_bundle"];
+
+export default class ConnectionSchemaParser extends ConnectionSchemaParserBase {
+  override parseSchemaToFields(schema: Schema): Field[] {
+    const fields = super.parseSchemaToFields(schema);
+    fields.forEach(field => {
+      if (TEXT_AREA_FIELDS.includes(field.name)) {
+        field.useTextArea = true;
+      }
+    });
+    return fields;
+  }
+}

Неке датотеке нису приказане због велике количине промена