Kaynağa Gözat

updating api-contracts

Stefan McShane 3 yıl önce
ebeveyn
işleme
a37b904f7f

Dosya farkı çok büyük olduğundan ihmal edildi
+ 586 - 161
dashboard/package-lock.json


+ 1 - 1
dashboard/package.json

@@ -7,7 +7,7 @@
     "@loadable/component": "^5.15.2",
     "@material-ui/core": "^4.11.3",
     "@material-ui/lab": "^4.0.0-alpha.61",
-    "@porter-dev/api-contracts": "https://gitpkg.now.sh/porter-dev/api-contracts/generated/js?main",
+    "@porter-dev/api-contracts": "^0.0.33",
     "@sentry/react": "^6.13.2",
     "@sentry/tracing": "^6.13.2",
     "@tanstack/react-query": "^4.13.0",

+ 14 - 18
dashboard/src/components/ProvisionerSettings.tsx

@@ -9,7 +9,7 @@ import SelectRow from "components/form-components/SelectRow";
 import Heading from "components/form-components/Heading";
 import InputRow from "./form-components/InputRow";
 import SaveButton from "./SaveButton";
-import { Contract, EnumKubernetesKind, EnumCloudProvider, NodeGroupType } from "@porter-dev/api-contracts";
+import { Contract, EnumKubernetesKind, EnumCloudProvider, NodeGroupType, EKSNodeGroup, EKS, Cluster } from "@porter-dev/api-contracts";
 
 const regionOptions = [
   { value: "us-east-1", label: "US East (N. Virginia) us-east-1" },
@@ -61,50 +61,46 @@ const ProvisionerForm: React.FC<Props> = ({
   const [isReadOnly, setIsReadOnly] = useState(false);
 
   const createCluster = async () => {
-    var data: Contract = {
-      cluster: {
+    var data = new Contract({
+      cluster: new Cluster({
         projectId: currentProject.id,
-        clusterId: null,
         kind: EnumKubernetesKind.EKS,
         cloudProvider: EnumCloudProvider.AWS,
         cloudProviderCredentialsId: String(credentialId),
         kindValues: {
           case: "eksKind",
-          value: {
+          value: new EKS({
             clusterName,
             clusterVersion: "v1.24.0",
             cidrRange: cidrRange || "172.0.0.0/16",
             region: awsRegion,
             nodeGroups: [
-              {
+              new EKSNodeGroup({
                 instanceType: "t3.medium",
                 minInstances: 1,
                 maxInstances: 5,
                 nodeGroupType: NodeGroupType.SYSTEM,
                 isStateful: false,
-                nameSuffix: "",
-              },
-              {
+              }),
+              new EKSNodeGroup({
                 instanceType: "t3.large",
                 minInstances: 1,
                 maxInstances: 5,
                 nodeGroupType: NodeGroupType.MONITORING,
                 isStateful: false,
-                nameSuffix: "",
-              },
-              {
+              }),
+              new EKSNodeGroup({
                 instanceType: machineType,
                 minInstances: minInstances || 1,
                 maxInstances: maxInstances || 10,
                 nodeGroupType: NodeGroupType.APPLICATION,
                 isStateful: false,
-                nameSuffix: "",
-              }
+              })
             ]
-          }
+          })
         },
-      }
-    };
+      })
+    });
 
     if (clusterId) {
       data["cluster"]["clusterId"] = clusterId;
@@ -124,7 +120,7 @@ const ProvisionerForm: React.FC<Props> = ({
   useEffect(() => {
     setIsReadOnly(
       clusterId && (
-        currentCluster.status === "UPDATING" || 
+        currentCluster.status === "UPDATING" ||
         currentCluster.status === "UPDATING_UNAVAILABLE"
       )
     );

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor