From e0d62d3645716413fd326353189a9805c49c130a Mon Sep 17 00:00:00 2001
From: Abdhesh Nayak
Date: Mon, 1 Jan 2024 18:54:47 +0530
Subject: [PATCH 01/10] :sparkles: Added cli queries
---
gql-queries-generator/doc/queries.graphql | 76 +++++
src/apps/auth/server/gql/cli-queries.ts | 63 ++++
src/generated/gql/sdl.graphql | 377 ++++++++++++++++------
3 files changed, 419 insertions(+), 97 deletions(-)
diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql
index 89fa70e75..86c37b6bd 100644
--- a/gql-queries-generator/doc/queries.graphql
+++ b/gql-queries-generator/doc/queries.graphql
@@ -2679,6 +2679,82 @@ query consoleGetBuildRun($repoName: String!, $buildRunName: String!) {
}
}
+query authCli_listProjects($clusterName: String, $search: SearchProjects, $pq: CursorPaginationIn) {
+ core_listProjects(clusterName: $clusterName, search: $search, pq: $pq) {
+ edges {
+ cursor
+ node {
+ accountName
+ apiVersion
+ clusterName
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ id
+ kind
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ recordVersion
+ spec {
+ accountName
+ clusterName
+ displayName
+ logo
+ targetNamespace
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ syncStatus {
+ action
+ error
+ lastSyncedAt
+ recordVersion
+ state
+ syncScheduledAt
+ }
+ updateTime
+ }
+ }
+ pageInfo {
+ endCursor
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ }
+ totalCount
+ }
+}
+
query authCli_getKubeConfig($name: String!) {
infra_getCluster(name: $name) {
adminKubeconfig {
diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts
index 0195aaaf7..a5b5502e3 100644
--- a/src/apps/auth/server/gql/cli-queries.ts
+++ b/src/apps/auth/server/gql/cli-queries.ts
@@ -17,6 +17,69 @@ import {
} from '~/root/src/generated/gql/server';
export const cliQueries = (executor: IExecutor) => ({
+ cli_listEnvironments: executor(
+ gql`
+ query Core_listProjects($project: ProjectId!, $pq: CursorPaginationIn) {
+ core_listEnvironments(project: $project, pq: $pq) {
+ edges {
+ node {
+ displayName
+ markedForDeletion
+ metadata {
+ name
+ namespace
+ }
+ spec {
+ isEnvironment
+ projectName
+ targetNamespace
+ }
+ status {
+ isReady
+ message {
+ RawMessage
+ }
+ }
+ }
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data.core_listEnvironments,
+ vars: (_: any) => {},
+ }
+ ),
+
+ cli_listProjects: executor(
+ gql`
+ query Core_listProjects($clusterName: String, $pq: CursorPaginationIn) {
+ core_listProjects(clusterName: $clusterName, pq: $pq) {
+ edges {
+ node {
+ displayName
+ markedForDeletion
+ metadata {
+ name
+ namespace
+ }
+ status {
+ isReady
+ message {
+ RawMessage
+ }
+ }
+ }
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data.core_listProjects,
+ vars: (_: any) => {},
+ }
+ ),
+
cli_getKubeConfig: executor(
gql`
query Infra_getCluster($name: String!) {
diff --git a/src/generated/gql/sdl.graphql b/src/generated/gql/sdl.graphql
index 9ceef7538..9507e83b2 100644
--- a/src/generated/gql/sdl.graphql
+++ b/src/generated/gql/sdl.graphql
@@ -506,46 +506,6 @@ type GitBranch {
protected: Boolean
}
-type Github__com___kloudlite___api___apps___console___internal___entities__InputField {
- defaultValue: Any
- inputType: String!
- label: String!
- max: Float
- min: Float
- name: String!
- required: Boolean
- unit: String
-}
-
-type Github__com___kloudlite___api___apps___console___internal___entities__MresTemplate {
- apiVersion: String
- description: String!
- displayName: String!
- fields: [Github__com___kloudlite___api___apps___console___internal___entities__InputField!]!
- kind: String
- name: String!
- outputs: [Github__com___kloudlite___api___apps___console___internal___entities__OutputField!]!
-}
-
-type Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry {
- active: Boolean!
- apiVersion: String
- description: String!
- displayName: String!
- fields: [Github__com___kloudlite___api___apps___console___internal___entities__InputField!]!
- kind: String
- logoUrl: String!
- name: String!
- outputs: [Github__com___kloudlite___api___apps___console___internal___entities__OutputField!]!
- resources: [Github__com___kloudlite___api___apps___console___internal___entities__MresTemplate!]!
-}
-
-type Github__com___kloudlite___api___apps___console___internal___entities__OutputField {
- description: String!
- label: String!
- name: String!
-}
-
enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus {
error
failed
@@ -666,6 +626,46 @@ input Github__com___kloudlite___api___apps___infra___internal___entities__AWSSec
secretKey: String
}
+type Github__com___kloudlite___api___apps___infra___internal___entities__InputField {
+ defaultValue: Any
+ inputType: String!
+ label: String!
+ max: Float
+ min: Float
+ name: String!
+ required: Boolean
+ unit: String
+}
+
+type Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate {
+ apiVersion: String
+ description: String!
+ displayName: String!
+ fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]!
+ kind: String
+ name: String!
+ outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]!
+}
+
+type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry {
+ active: Boolean!
+ apiVersion: String
+ description: String!
+ displayName: String!
+ fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]!
+ kind: String
+ logoUrl: String!
+ name: String!
+ outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]!
+ resources: [Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate!]!
+}
+
+type Github__com___kloudlite___api___apps___infra___internal___entities__OutputField {
+ description: String!
+ label: String!
+ name: String!
+}
+
type Github__com___kloudlite___api___common__CreatedOrUpdatedBy {
userEmail: String!
userId: String!
@@ -1022,6 +1022,16 @@ input Github__com___kloudlite___operator___apis___crds___v1__BasicAuthIn {
username: String
}
+type Github__com___kloudlite___operator___apis___crds___v1__ChartRepo {
+ name: String!
+ url: String!
+}
+
+input Github__com___kloudlite___operator___apis___crds___v1__ChartRepoIn {
+ name: String!
+ url: String!
+}
+
type Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec {
msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec!
namespace: String!
@@ -1111,6 +1121,41 @@ input Github__com___kloudlite___operator___apis___crds___v1__EnvFromIn {
type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret!
}
+type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec {
+ chartName: String!
+ chartRepo: Github__com___kloudlite___operator___apis___crds___v1__ChartRepo!
+ chartVersion: String!
+ jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVars
+ postInstall: String
+ postUninstall: String
+ preInstall: String
+ preUninstall: String
+ values: Map!
+}
+
+input Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn {
+ chartName: String!
+ chartRepo: Github__com___kloudlite___operator___apis___crds___v1__ChartRepoIn!
+ chartVersion: String!
+ jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn
+ postInstall: String
+ postUninstall: String
+ preInstall: String
+ preUninstall: String
+ values: Map!
+}
+
+type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus {
+ checks: Map
+ isReady: Boolean!
+ lastReadyGeneration: Int
+ lastReconcileTime: Date
+ message: Github__com___kloudlite___operator___pkg___raw____json__RawJson
+ releaseNotes: String!
+ releaseStatus: String!
+ resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!]
+}
+
type Github__com___kloudlite___operator___apis___crds___v1__HPA {
enabled: Boolean
maxReplicas: Int
@@ -1159,6 +1204,20 @@ input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn {
toDevice: String!
}
+type Github__com___kloudlite___operator___apis___crds___v1__JobVars {
+ affinity: K8s__io___api___core___v1__Affinity
+ backOffLimit: Int
+ nodeSelector: Map
+ tolerations: [K8s__io___api___core___v1__Toleration!]
+}
+
+input Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn {
+ affinity: K8s__io___api___core___v1__AffinityIn
+ backOffLimit: Int
+ nodeSelector: Map
+ tolerations: [K8s__io___api___core___v1__TolerationIn!]
+}
+
type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec {
resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate!
}
@@ -1191,12 +1250,14 @@ type Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef {
apiVersion: String!
kind: String!
name: String!
+ namespace: String!
}
input Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn {
apiVersion: String!
kind: String!
name: String!
+ namespace: String!
}
type Github__com___kloudlite___operator___apis___crds___v1__Probe {
@@ -1296,6 +1357,8 @@ type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate {
}
input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn {
+ apiVersion: String!
+ kind: String!
spec: Map!
}
@@ -1388,17 +1451,25 @@ input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn
memoryInMb: Int!
}
+type Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord {
+ host: String
+ target: String
+}
+
+input Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn {
+ host: String
+ target: String
+}
+
type Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec {
- accountName: String!
- clusterName: String!
+ cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord!]
deviceNamespace: String
nodeSelector: Map
ports: [Github__com___kloudlite___operator___apis___wireguard___v1__Port!]
}
input Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn {
- accountName: String!
- clusterName: String!
+ cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn!]
deviceNamespace: String
nodeSelector: Map
ports: [Github__com___kloudlite___operator___apis___wireguard___v1__PortIn!]
@@ -1529,6 +1600,42 @@ type GitlabProject {
webUrl: String!
}
+type HelmRelease {
+ accountName: String!
+ apiVersion: String!
+ clusterName: String!
+ createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ creationTime: Date!
+ displayName: String!
+ id: String!
+ kind: String!
+ lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ markedForDeletion: Boolean
+ metadata: Metadata
+ recordVersion: Int!
+ spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec
+ status: Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus
+ syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!
+ updateTime: Date!
+}
+
+type HelmReleaseEdge {
+ cursor: String!
+ node: HelmRelease!
+}
+
+input HelmReleaseIn {
+ displayName: String!
+ metadata: MetadataIn
+ spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn
+}
+
+type HelmReleasePaginatedRecords {
+ edges: [HelmReleaseEdge!]!
+ pageInfo: PageInfo!
+ totalCount: Int!
+}
+
type ImagePullSecret {
accountName: String!
creationTime: Date!
@@ -1585,12 +1692,73 @@ input InvitationIn {
scalar Json
+type K8s__io___api___core___v1__Affinity {
+ nodeAffinity: K8s__io___api___core___v1__NodeAffinity
+ podAffinity: K8s__io___api___core___v1__PodAffinity
+ podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinity
+}
+
+input K8s__io___api___core___v1__AffinityIn {
+ nodeAffinity: K8s__io___api___core___v1__NodeAffinityIn
+ podAffinity: K8s__io___api___core___v1__PodAffinityIn
+ podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinityIn
+}
+
enum K8s__io___api___core___v1__ConditionStatus {
False
True
Unknown
}
+type K8s__io___api___core___v1__NodeAffinity {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTerm!]
+ requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelector
+}
+
+input K8s__io___api___core___v1__NodeAffinityIn {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTermIn!]
+ requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelectorIn
+}
+
+type K8s__io___api___core___v1__NodeSelector {
+ nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTerm!]!
+}
+
+input K8s__io___api___core___v1__NodeSelectorIn {
+ nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTermIn!]!
+}
+
+enum K8s__io___api___core___v1__NodeSelectorOperator {
+ DoesNotExist
+ Exists
+ Gt
+ In
+ Lt
+ NotIn
+}
+
+type K8s__io___api___core___v1__NodeSelectorRequirement {
+ key: String!
+ operator: K8s__io___api___core___v1__NodeSelectorOperator!
+ values: [String!]
+}
+
+input K8s__io___api___core___v1__NodeSelectorRequirementIn {
+ key: String!
+ operator: K8s__io___api___core___v1__NodeSelectorOperator!
+ values: [String!]
+}
+
+type K8s__io___api___core___v1__NodeSelectorTerm {
+ matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirement!]
+ matchFields: [K8s__io___api___core___v1__NodeSelectorRequirement!]
+}
+
+input K8s__io___api___core___v1__NodeSelectorTermIn {
+ matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirementIn!]
+ matchFields: [K8s__io___api___core___v1__NodeSelectorRequirementIn!]
+}
+
type K8s__io___api___core___v1__PersistentVolumeClaimCondition {
lastProbeTime: Date
lastTransitionTime: Date
@@ -1660,6 +1828,50 @@ input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn {
phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase
}
+type K8s__io___api___core___v1__PodAffinity {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!]
+}
+
+input K8s__io___api___core___v1__PodAffinityIn {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!]
+}
+
+type K8s__io___api___core___v1__PodAffinityTerm {
+ labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector
+ namespaces: [String!]
+ namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector
+ topologyKey: String!
+}
+
+input K8s__io___api___core___v1__PodAffinityTermIn {
+ labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn
+ namespaces: [String!]
+ namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn
+ topologyKey: String!
+}
+
+type K8s__io___api___core___v1__PodAntiAffinity {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!]
+}
+
+input K8s__io___api___core___v1__PodAntiAffinityIn {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!]
+}
+
+type K8s__io___api___core___v1__PreferredSchedulingTerm {
+ preference: K8s__io___api___core___v1__NodeSelectorTerm!
+ weight: Int!
+}
+
+input K8s__io___api___core___v1__PreferredSchedulingTermIn {
+ preference: K8s__io___api___core___v1__NodeSelectorTermIn!
+ weight: Int!
+}
+
type K8s__io___api___core___v1__ResourceClaim {
name: String!
}
@@ -1758,6 +1970,16 @@ input K8s__io___api___core___v1__TypedObjectReferenceIn {
namespace: String
}
+type K8s__io___api___core___v1__WeightedPodAffinityTerm {
+ podAffinityTerm: K8s__io___api___core___v1__PodAffinityTerm!
+ weight: Int!
+}
+
+input K8s__io___api___core___v1__WeightedPodAffinityTermIn {
+ podAffinityTerm: K8s__io___api___core___v1__PodAffinityTermIn!
+ weight: Int!
+}
+
enum K8s__io___apimachinery___pkg___api___resource__Format {
BinarySI
DecimalExponent
@@ -1839,44 +2061,6 @@ type ManagedResourcePaginatedRecords {
totalCount: Int!
}
-type ManagedService {
- accountName: String!
- apiVersion: String!
- clusterName: String!
- createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
- creationTime: Date!
- displayName: String!
- enabled: Boolean
- id: String!
- kind: String!
- lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
- markedForDeletion: Boolean
- metadata: Metadata
- recordVersion: Int!
- spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec!
- status: Github__com___kloudlite___operator___pkg___operator__Status
- syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!
- updateTime: Date!
-}
-
-type ManagedServiceEdge {
- cursor: String!
- node: ManagedService!
-}
-
-input ManagedServiceIn {
- displayName: String!
- enabled: Boolean
- metadata: MetadataIn
- spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn!
-}
-
-type ManagedServicePaginatedRecords {
- edges: [ManagedServiceEdge!]!
- pageInfo: PageInfo!
- totalCount: Int!
-}
-
scalar Map
type MatchFilter {
@@ -1919,7 +2103,7 @@ input MetadataIn {
type MsvcTemplate {
category: String!
displayName: String!
- items: [Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry!]!
+ items: [Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry!]!
}
type Mutation {
@@ -1953,7 +2137,6 @@ type Mutation {
core_createEnvironment(env: WorkspaceIn!): Workspace
core_createImagePullSecret(imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret
core_createManagedResource(mres: ManagedResourceIn!): ManagedResource
- core_createManagedService(msvc: ManagedServiceIn!): ManagedService
core_createProject(project: ProjectIn!): Project
core_createRouter(router: RouterIn!): Router
core_createSecret(secret: SecretIn!): Secret
@@ -1963,7 +2146,6 @@ type Mutation {
core_deleteEnvironment(name: String!, namespace: String!): Boolean!
core_deleteImagePullSecret(name: String!, namespace: String!): Boolean!
core_deleteManagedResource(name: String!, namespace: String!): Boolean!
- core_deleteManagedService(name: String!, namespace: String!): Boolean!
core_deleteProject(name: String!): Boolean!
core_deleteRouter(name: String!, namespace: String!): Boolean!
core_deleteSecret(name: String!, namespace: String!): Boolean!
@@ -1972,7 +2154,6 @@ type Mutation {
core_updateConfig(config: ConfigIn!): Config
core_updateEnvironment(env: WorkspaceIn!): Workspace
core_updateManagedResource(mres: ManagedResourceIn!): ManagedResource
- core_updateManagedService(msvc: ManagedServiceIn!): ManagedService
core_updateProject(project: ProjectIn!): Project
core_updateRouter(router: RouterIn!): Router
core_updateSecret(secret: SecretIn!): Secret
@@ -1993,18 +2174,21 @@ type Mutation {
infra_createCluster(cluster: ClusterIn!): Cluster
infra_createClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService
infra_createDomainEntry(domainEntry: DomainEntryIn!): DomainEntry
+ infra_createHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease
infra_createNodePool(clusterName: String!, pool: NodePoolIn!): NodePool
infra_createProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret
infra_createVPNDevice(clusterName: String!, vpnDevice: VPNDeviceIn!): VPNDevice
infra_deleteCluster(name: String!): Boolean!
infra_deleteClusterManagedService(clusterName: String!, serviceName: String!): Boolean!
infra_deleteDomainEntry(domainName: String!): Boolean!
+ infra_deleteHelmRelease(clusterName: String!, releaseName: String!): Boolean!
infra_deleteNodePool(clusterName: String!, poolName: String!): Boolean!
infra_deleteProviderSecret(secretName: String!): Boolean!
infra_deleteVPNDevice(clusterName: String!, deviceName: String!): Boolean!
infra_updateCluster(cluster: ClusterIn!): Cluster
infra_updateClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService
infra_updateDomainEntry(domainEntry: DomainEntryIn!): DomainEntry
+ infra_updateHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease
infra_updateNodePool(clusterName: String!, pool: NodePoolIn!): NodePool
infra_updateProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret
infra_updateVPNDevice(clusterName: String!, vpnDevice: VPNDeviceIn!): VPNDevice
@@ -2114,6 +2298,7 @@ type PersistentVolumeClaim {
recordVersion: Int!
spec: K8s__io___api___core___v1__PersistentVolumeClaimSpec
status: K8s__io___api___core___v1__PersistentVolumeClaimStatus
+ syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!
updateTime: Date!
}
@@ -2197,8 +2382,6 @@ type Query {
core_getEnvironment(name: String!, project: ProjectId!): Workspace
core_getImagePullSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId): ImagePullSecret
core_getManagedResource(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): ManagedResource
- core_getManagedService(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): ManagedService
- core_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry
core_getProject(name: String!): Project
core_getRouter(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Router
core_getSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Secret
@@ -2208,18 +2391,14 @@ type Query {
core_listEnvironments(pq: CursorPaginationIn, project: ProjectId!, search: SearchWorkspaces): WorkspacePaginatedRecords
core_listImagePullSecrets(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId, search: SearchImagePullSecrets): ImagePullSecretPaginatedRecords
core_listManagedResources(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchManagedResources): ManagedResourcePaginatedRecords
- core_listManagedServices(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchManagedServices): ManagedServicePaginatedRecords
- core_listManagedServiceTemplates: [MsvcTemplate!]
core_listProjects(clusterName: String, pq: CursorPaginationIn, search: SearchProjects): ProjectPaginatedRecords
core_listRouters(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchRouters): RouterPaginatedRecords
core_listSecrets(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchSecrets): SecretPaginatedRecords
- core_listWorkspaces(pq: CursorPaginationIn, project: ProjectId!, search: SearchWorkspaces): WorkspacePaginatedRecords
core_resyncApp(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncConfig(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncEnvironment(name: String!, project: ProjectId!): Boolean!
core_resyncImagePullSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId): Boolean!
core_resyncManagedResource(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
- core_resyncManagedService(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncProject(name: String!): Boolean!
core_resyncRouter(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
@@ -2246,6 +2425,8 @@ type Query {
infra_getCluster(name: String!): Cluster
infra_getClusterManagedService(clusterName: String!, name: String!): ClusterManagedService
infra_getDomainEntry(domainName: String!): DomainEntry
+ infra_getHelmRelease(clusterName: String!, name: String!): HelmRelease
+ infra_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry
infra_getNodePool(clusterName: String!, poolName: String!): NodePool
infra_getProviderSecret(name: String!): CloudProviderSecret
infra_getPVC(clusterName: String!, name: String!): PersistentVolumeClaim
@@ -2253,6 +2434,8 @@ type Query {
infra_listClusterManagedServices(clusterName: String!, pagination: CursorPaginationIn, search: SearchClusterManagedService): ClusterManagedServicePaginatedRecords
infra_listClusters(pagination: CursorPaginationIn, search: SearchCluster): ClusterPaginatedRecords
infra_listDomainEntries(pagination: CursorPaginationIn, search: SearchDomainEntry): DomainEntryPaginatedRecords
+ infra_listHelmReleases(clusterName: String!, pagination: CursorPaginationIn, search: SearchHelmRelease): HelmReleasePaginatedRecords
+ infra_listManagedServiceTemplates: [MsvcTemplate!]
infra_listNodePools(clusterName: String!, pagination: CursorPaginationIn, search: SearchNodepool): NodePoolPaginatedRecords
infra_listProviderSecrets(pagination: CursorPaginationIn, search: SearchProviderSecret): CloudProviderSecretPaginatedRecords
infra_listPVCs(clusterName: String!, pq: CursorPaginationIn, search: SearchPersistentVolumeClaims): PersistentVolumeClaimPaginatedRecords
@@ -2294,6 +2477,7 @@ type RepositoryPaginatedRecords {
enum ResType {
cluster
+ helm_release
nodepool
providersecret
vpn_device
@@ -2389,21 +2573,20 @@ input SearchEnvironments {
text: MatchFilterIn
}
-input SearchImagePullSecrets {
+input SearchHelmRelease {
isReady: MatchFilterIn
- markedForDeletion: MatchFilterIn
text: MatchFilterIn
}
-input SearchManagedResources {
+input SearchImagePullSecrets {
isReady: MatchFilterIn
- managedServiceName: MatchFilterIn
markedForDeletion: MatchFilterIn
text: MatchFilterIn
}
-input SearchManagedServices {
+input SearchManagedResources {
isReady: MatchFilterIn
+ managedServiceName: MatchFilterIn
markedForDeletion: MatchFilterIn
text: MatchFilterIn
}
From 23d987bc054587da7eabb6881f06299e70784a31 Mon Sep 17 00:00:00 2001
From: Abdhesh Nayak
Date: Mon, 1 Jan 2024 23:54:45 +0530
Subject: [PATCH 02/10] :sparkles: Added some cli queries
---
src/apps/auth/server/gql/cli-queries.ts | 84 +++++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts
index a5b5502e3..0c7992c74 100644
--- a/src/apps/auth/server/gql/cli-queries.ts
+++ b/src/apps/auth/server/gql/cli-queries.ts
@@ -17,6 +17,90 @@ import {
} from '~/root/src/generated/gql/server';
export const cliQueries = (executor: IExecutor) => ({
+ cli_listDevices: executor(
+ gql`
+ query Infra_listVPNDevices(
+ $pq: CursorPaginationIn
+ $clusterName: String
+ ) {
+ infra_listVPNDevices(pq: $pq, clusterName: $clusterName) {
+ edges {
+ node {
+ displayName
+ markedForDeletion
+ metadata {
+ name
+ namespace
+ }
+ spec {
+ cnameRecords {
+ host
+ target
+ }
+ deviceNamespace
+ ports {
+ port
+ targetPort
+ }
+ }
+ status {
+ isReady
+ message {
+ RawMessage
+ }
+ }
+ }
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data.infra_listVPNDevices,
+ vars: (_: any) => {},
+ }
+ ),
+
+ cli_getDevice: executor(
+ gql`
+ query Infra_getVPNDevice($clusterName: String!, $name: String!) {
+ infra_getVPNDevice(clusterName: $clusterName, name: $name) {
+ displayName
+ markedForDeletion
+ metadata {
+ name
+ namespace
+ }
+ spec {
+ cnameRecords {
+ host
+ target
+ }
+ deviceNamespace
+ nodeSelector
+ ports {
+ port
+ targetPort
+ }
+ }
+ status {
+ isReady
+ message {
+ RawMessage
+ }
+ }
+ wireguardConfig {
+ encoding
+ value
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data.infra_getVPNDevice,
+ vars: (_: any) => {},
+ }
+ ),
+
cli_listEnvironments: executor(
gql`
query Core_listProjects($project: ProjectId!, $pq: CursorPaginationIn) {
From 28e7e370742eeaa3dc54e777198a3490abd2830d Mon Sep 17 00:00:00 2001
From: Abdhesh Nayak
Date: Wed, 3 Jan 2024 14:40:12 +0530
Subject: [PATCH 03/10] :art: Cli queries updated
---
src/apps/auth/server/gql/cli-queries.ts | 180 ++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts
index 0c7992c74..35961ffba 100644
--- a/src/apps/auth/server/gql/cli-queries.ts
+++ b/src/apps/auth/server/gql/cli-queries.ts
@@ -17,6 +17,186 @@ import {
} from '~/root/src/generated/gql/server';
export const cliQueries = (executor: IExecutor) => ({
+ cli_listApps: executor(
+ gql`
+ query Core_listApps(
+ $project: ProjectId!
+ $scope: WorkspaceOrEnvId!
+ $pq: CursorPaginationIn
+ ) {
+ core_listApps(project: $project, scope: $scope, pq: $pq) {
+ edges {
+ node {
+ displayName
+ markedForDeletion
+ metadata {
+ name
+ namespace
+ }
+ projectName
+ spec {
+ containers {
+ args
+ command
+ env {
+ key
+ optional
+ refKey
+ refName
+ type
+ value
+ }
+ envFrom {
+ refName
+ type
+ }
+ image
+ imagePullPolicy
+ livenessProbe {
+ failureThreshold
+
+ initialDelay
+ interval
+
+ type
+ }
+ name
+ readinessProbe {
+ failureThreshold
+ initialDelay
+ interval
+ type
+ }
+ resourceCpu {
+ max
+ min
+ }
+ resourceMemory {
+ max
+ min
+ }
+ volumes {
+ mountPath
+ refName
+ type
+ }
+ }
+ displayName
+ freeze
+ hpa {
+ enabled
+ maxReplicas
+ minReplicas
+ thresholdCpu
+ thresholdMemory
+ }
+ intercept {
+ enabled
+ toDevice
+ }
+ nodeSelector
+ region
+ replicas
+ serviceAccount
+ services {
+ name
+ port
+ targetPort
+ type
+ }
+ tolerations {
+ effect
+ key
+ operator
+ tolerationSeconds
+ value
+ }
+ }
+ status {
+ isReady
+ message {
+ RawMessage
+ }
+ }
+ workspaceName
+ }
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data,
+ vars: (_: any) => {},
+ }
+ ),
+ cli_listSecrets: executor(
+ gql`
+ query Core_listSecrets(
+ $project: ProjectId!
+ $scope: WorkspaceOrEnvId!
+ $pq: CursorPaginationIn
+ ) {
+ core_listSecrets(project: $project, scope: $scope, pq: $pq) {
+ edges {
+ node {
+ displayName
+ markedForDeletion
+ metadata {
+ name
+ namespace
+ }
+ status {
+ isReady
+ message {
+ RawMessage
+ }
+ }
+ stringData
+ }
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data,
+ vars: (_: any) => {},
+ }
+ ),
+ cli_updateDevice: executor(
+ gql`
+ mutation Mutation($clusterName: String!, $vpnDevice: VPNDeviceIn!) {
+ infra_updateVPNDevice(
+ clusterName: $clusterName
+ vpnDevice: $vpnDevice
+ ) {
+ metadata {
+ name
+ }
+ spec {
+ deviceNamespace
+ cnameRecords {
+ target
+ host
+ }
+ ports {
+ targetPort
+ port
+ }
+ }
+ status {
+ message {
+ RawMessage
+ }
+ isReady
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: any) => data.infra_updateVPNDevice,
+ vars: (_: any) => {},
+ }
+ ),
cli_listDevices: executor(
gql`
query Infra_listVPNDevices(
From f01f98fee567a6d6af0a3dd1e615898f8e22a452 Mon Sep 17 00:00:00 2001
From: Bikash
Date: Wed, 3 Jan 2024 15:50:35 +0530
Subject: [PATCH 04/10] WIP - warning - do not revert to this commit
---
Taskfile.yaml | 2 +-
fake-data-generator/gen.ts | 3 +-
gql-queries-generator/doc/queries.graphql | 813 +++++++--------
package.json | 2 +-
pnpm-lock.yaml | 8 +-
src/apps/console/components/id-selector.tsx | 6 +
.../console/components/key-value-pair.tsx | 130 +++
.../components/render-dynamic-field.tsx | 4 +-
.../$project+/$scope+/$workspace+/_layout.tsx | 8 +-
.../backing-service+/$service/_index.tsx | 102 --
.../resources/handle-backend-resources.tsx | 229 -----
.../$service/resources/managed-resources.tsx | 128 ---
.../$service/resources/route.tsx | 137 ---
.../$service/resources/tools.tsx | 57 --
.../backend-services-resources.tsx | 196 ----
.../handle-backend-service.tsx | 437 --------
.../$workspace+/backing-services/route.tsx | 108 --
.../$cluster+/$project+/$scope+/_index.tsx | 2 +-
.../$cluster+/$project+/$scope+/_layout.tsx | 7 +-
.../$account+/$cluster+/$project+/_layout.tsx | 63 +-
.../$project+/environments/route.tsx | 9 +-
.../$cluster+/$project+/settings+/_layout.tsx | 2 +-
.../$project+/workspaces/resources.tsx | 173 ----
.../$cluster+/$project+/workspaces/route.tsx | 116 ---
.../$cluster+/$project+/workspaces/tools.tsx | 13 -
.../routes/_main+/$account+/_layout.tsx | 6 +-
.../$account+/infra+/$cluster+/_layout.tsx | 57 +-
.../$cluster+/managedservices+/_layout.tsx | 24 +
.../managedservices+/helm-chart/_index.tsx | 93 ++
.../helm-chart/handle-helm-chart.tsx | 244 +++++
.../helm-chart/helm-chart-resources.tsx | 204 ++++
.../managedservices+/helm-chart}/tools.tsx | 2 -
.../backend-services-resources.tsx | 233 +++++
.../handle-backend-service.tsx | 628 ++++++++++++
.../kl-operator-services/route.tsx | 124 +++
.../kl-operator-services/tools.tsx | 29 +
.../infra+/$cluster+/network+/_layout.tsx | 14 +-
.../$cluster+/network+/vpn/handle-devices.tsx | 8 +-
.../infra+/$cluster+/network+/vpn/route.tsx | 2 +-
.../$cluster+/nodepools/handle-nodepool.tsx | 1 -
.../infra+/$cluster+/nodepools/route.tsx | 10 +-
.../infra+/$cluster+/settings+/_layout.tsx | 6 +-
.../domain/domain-detail.tsx | 0
.../domain/domain-resources.tsx | 0
.../domain/handle-domain.tsx | 0
.../{network+ => settings+}/domain/route.tsx | 2 +-
.../{network+ => settings+}/domain/tools.tsx | 0
.../_main+/$account+/infra+/_layout.tsx | 2 +-
.../$account+/infra+/clusters/route.tsx | 1 +
.../_main+/$account+/packages+/_index.tsx | 6 +-
.../_main+/$account+/packages+/_layout.tsx | 2 +-
.../$account+/packages+/repos/route.tsx | 8 +-
.../$account+/projects/project-resources.tsx | 4 +-
.../_main+/$account+/repo+/$repo+/_layout.tsx | 99 +-
.../buildruns-resources.tsx | 0
.../$repo+/{$build => buildruns}/route.tsx | 43 +-
.../$repo+/{$build => buildruns}/tools.tsx | 0
.../$account+/repo+/$repo+/builds/_index.tsx | 47 +-
.../$account+/repo+/$repo+/builds/_layout.tsx | 8 -
.../repo+/$repo+/builds/build-resources.tsx | 3 +-
.../repo+/$repo+/builds/handle-builds.tsx | 159 +--
.../$account+/repo+/$repo+/images/route.tsx | 4 +
.../repo+/$repo+/images/tags-resources.tsx | 6 +-
.../repo+/$repo+/settings/_index.tsx | 5 +
.../buildcaches/build-caches-resources.tsx | 0
.../buildcaches/handle-build-cache.tsx | 0
.../{ => settings}/buildcaches/route.tsx | 48 +-
.../{ => settings}/buildcaches/tools.tsx | 0
.../repo+/$repo+/settings/general/route.tsx | 115 +++
.../$account+/repo+/$repo+/settings/route.tsx | 19 +
.../settings+/cloud-providers/route.tsx | 3 +-
.../cluster-managed-services-queries.ts | 215 ++++
.../server/gql/queries/cluster-queries.ts | 18 +-
.../server/gql/queries/environment-queries.ts | 24 +-
.../server/gql/queries/helm-chart-queries.ts | 222 ++++
.../gql/queries/managed-service-queries.ts | 330 ------
.../gql/queries/managed-templates-queries.ts | 115 +++
.../server/gql/queries/nodepool-queries.ts | 27 +-
.../server/gql/queries/project-queries.ts | 17 +-
.../console/server/gql/queries/vpn-queries.ts | 14 +-
.../server/gql/queries/workspace-queries.ts | 70 +-
src/apps/console/server/gql/saved-queries.ts | 8 +-
src/apps/console/server/r-utils/common.ts | 24 +-
src/apps/console/utils/commons.tsx | 18 +-
src/generated/gql/sdl.graphql | 405 ++++++--
src/generated/gql/server.ts | 969 ++++++++++--------
86 files changed, 4027 insertions(+), 3473 deletions(-)
create mode 100644 src/apps/console/components/key-value-pair.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/_index.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/handle-backend-resources.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/managed-resources.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/route.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/tools.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/backend-services-resources.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/handle-backend-service.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/route.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/resources.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/route.tsx
delete mode 100644 src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/tools.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/_layout.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/_index.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/handle-helm-chart.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/helm-chart-resources.tsx
rename src/apps/console/routes/_main+/$account+/{$cluster+/$project+/$scope+/$workspace+/backing-services => infra+/$cluster+/managedservices+/helm-chart}/tools.tsx (90%)
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/backend-services-resources.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/handle-backend-service.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/route.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/tools.tsx
rename src/apps/console/routes/_main+/$account+/infra+/$cluster+/{network+ => settings+}/domain/domain-detail.tsx (100%)
rename src/apps/console/routes/_main+/$account+/infra+/$cluster+/{network+ => settings+}/domain/domain-resources.tsx (100%)
rename src/apps/console/routes/_main+/$account+/infra+/$cluster+/{network+ => settings+}/domain/handle-domain.tsx (100%)
rename src/apps/console/routes/_main+/$account+/infra+/$cluster+/{network+ => settings+}/domain/route.tsx (98%)
rename src/apps/console/routes/_main+/$account+/infra+/$cluster+/{network+ => settings+}/domain/tools.tsx (100%)
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{$build => buildruns}/buildruns-resources.tsx (100%)
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{$build => buildruns}/route.tsx (68%)
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{$build => buildruns}/tools.tsx (100%)
delete mode 100644 src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/_layout.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/_index.tsx
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{ => settings}/buildcaches/build-caches-resources.tsx (100%)
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{ => settings}/buildcaches/handle-build-cache.tsx (100%)
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{ => settings}/buildcaches/route.tsx (79%)
rename src/apps/console/routes/_main+/$account+/repo+/$repo+/{ => settings}/buildcaches/tools.tsx (100%)
create mode 100644 src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/general/route.tsx
create mode 100644 src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/route.tsx
create mode 100644 src/apps/console/server/gql/queries/cluster-managed-services-queries.ts
create mode 100644 src/apps/console/server/gql/queries/helm-chart-queries.ts
delete mode 100644 src/apps/console/server/gql/queries/managed-service-queries.ts
create mode 100644 src/apps/console/server/gql/queries/managed-templates-queries.ts
diff --git a/Taskfile.yaml b/Taskfile.yaml
index 44a4c35da..0ae03f4d6 100644
--- a/Taskfile.yaml
+++ b/Taskfile.yaml
@@ -35,7 +35,7 @@ tasks:
case $(whoami) in
"bikash")
- URL_SUFFIX=""
+ URL_SUFFIX="-bikash"
;;
"vision")
diff --git a/fake-data-generator/gen.ts b/fake-data-generator/gen.ts
index c569c0ac8..6ad903c25 100644
--- a/fake-data-generator/gen.ts
+++ b/fake-data-generator/gen.ts
@@ -18,8 +18,9 @@ const types: string[] = [
'ConsoleListAppsQuery',
'ConsoleListConfigsQuery',
'ConsoleListSecretsQuery',
- 'ConsoleListManagedServicesQuery',
+ 'ConsoleListClusterMSvsQuery',
'ConsoleListManagedResourceQuery',
+ 'ConsoleListHelmChartQuery',
];
async function fake(files: string[], types: string[] = []) {
diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql
index 89fa70e75..4c2f7ebe9 100644
--- a/gql-queries-generator/doc/queries.graphql
+++ b/gql-queries-generator/doc/queries.graphql
@@ -202,14 +202,6 @@ query consoleListProjects($clusterName: String, $pagination: CursorPaginationIn,
isReady
checks
}
- syncStatus {
- syncScheduledAt
- state
- recordVersion
- lastSyncedAt
- error
- action
- }
updateTime
accountName
}
@@ -273,9 +265,7 @@ query consoleListClusters($search: SearchCluster, $pagination: CursorPaginationI
syncScheduledAt
lastSyncedAt
recordVersion
- state
error
- action
}
status {
resources {
@@ -434,11 +424,9 @@ query consoleGetCluster($name: String!) {
}
}
syncStatus {
- action
error
lastSyncedAt
recordVersion
- state
syncScheduledAt
}
updateTime
@@ -630,14 +618,6 @@ query consoleGetNodePool($clusterName: String!, $poolName: String!) {
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -732,14 +712,6 @@ query consoleListNodePools($clusterName: String!, $search: SearchNodepool, $pagi
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -780,46 +752,6 @@ mutation consoleUpdateWorkspace($env: WorkspaceIn!) {
}
}
-query consoleListWorkspaces($project: ProjectId!, $search: SearchWorkspaces, $pagination: CursorPaginationIn) {
- core_listWorkspaces(project: $project, search: $search, pq: $pagination) {
- pageInfo {
- startCursor
- hasPreviousPage
- hasNextPage
- endCursor
- }
- totalCount
- edges {
- node {
- metadata {
- name
- namespace
- labels
- annotations
- }
- displayName
- clusterName
- updateTime
- creationTime
- spec {
- targetNamespace
- projectName
- }
- createdBy {
- userEmail
- userId
- userName
- }
- lastUpdatedBy {
- userEmail
- userId
- userName
- }
- }
- }
- }
-}
-
query consoleGetEnvironment($project: ProjectId!, $name: String!) {
core_getEnvironment(project: $project, name: $name) {
accountName
@@ -870,14 +802,6 @@ query consoleGetEnvironment($project: ProjectId!, $name: String!) {
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -947,14 +871,6 @@ query consoleListEnvironments($project: ProjectId!, $search: SearchWorkspaces, $
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -1444,8 +1360,6 @@ query consoleListVpnDevices($clusterName: String, $search: SearchVPNDevices, $pq
namespace
}
spec {
- accountName
- clusterName
ports {
port
targetPort
@@ -1513,8 +1427,6 @@ query consoleGetVpnDevice($clusterName: String!, $name: String!) {
namespace
}
spec {
- accountName
- clusterName
ports {
port
targetPort
@@ -1627,110 +1539,8 @@ mutation consoleDeleteAccountMembership($accountName: String!, $memberId: ID!) {
accounts_removeAccountMembership(accountName: $accountName, memberId: $memberId)
}
-query consoleGetTemplate($category: String!, $name: String!) {
- core_getManagedServiceTemplate(category: $category, name: $name) {
- active
- apiVersion
- description
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- kind
- logoUrl
- name
- outputs {
- description
- label
- name
- }
- resources {
- apiVersion
- description
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- kind
- name
- outputs {
- description
- label
- name
- }
- }
- }
-}
-
-query consoleListTemplates {
- core_listManagedServiceTemplates {
- category
- displayName
- items {
- description
- active
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- logoUrl
- name
- outputs {
- name
- label
- description
- }
- resources {
- description
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- name
- outputs {
- description
- label
- name
- }
- kind
- apiVersion
- }
- kind
- apiVersion
- }
- }
-}
-
-query consoleGetManagedService($project: ProjectId!, $scope: WorkspaceOrEnvId!, $name: String!) {
- core_getManagedService(project: $project, scope: $scope, name: $name) {
+query consoleGetManagedResource($project: ProjectId!, $scope: WorkspaceOrEnvId!, $name: String!) {
+ core_getManagedResource(project: $project, scope: $scope, name: $name) {
accountName
apiVersion
clusterName
@@ -1761,9 +1571,14 @@ query consoleGetManagedService($project: ProjectId!, $scope: WorkspaceOrEnvId!,
}
recordVersion
spec {
- serviceTemplate {
+ resourceTemplate {
apiVersion
kind
+ msvcRef {
+ name
+ kind
+ apiVersion
+ }
spec
}
}
@@ -1793,229 +1608,78 @@ query consoleGetManagedService($project: ProjectId!, $scope: WorkspaceOrEnvId!,
}
}
-query consoleListManagedServices($project: ProjectId!, $scope: WorkspaceOrEnvId!) {
- core_listManagedServices(project: $project, scope: $scope) {
+query consoleListManagedResource($project: ProjectId!, $scope: WorkspaceOrEnvId!, $search: SearchManagedResources, $pq: CursorPaginationIn) {
+ core_listManagedResources(
+ project: $project
+ scope: $scope
+ search: $search
+ pq: $pq
+ ) {
+ pageInfo {
+ endCursor
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ }
+ totalCount
+ edges {
+ cursor
+ node {
+ updateTime
+ metadata {
+ name
+ }
+ lastUpdatedBy {
+ userEmail
+ userName
+ }
+ kind
+ displayName
+ creationTime
+ createdBy {
+ userEmail
+ userName
+ }
+ }
+ }
+ }
+}
+
+mutation consoleCreateManagedResource($mres: ManagedResourceIn!) {
+ core_createManagedResource(mres: $mres) {
+ id
+ }
+}
+
+query consoleGetCredToken($username: String!) {
+ cr_getCredToken(username: $username)
+}
+
+query consoleListCred($search: SearchCreds, $pagination: CursorPaginationIn) {
+ cr_listCreds(search: $search, pagination: $pagination) {
edges {
cursor
node {
+ access
accountName
- apiVersion
- clusterName
createdBy {
userEmail
userId
userName
}
creationTime
- displayName
- enabled
+ expiration {
+ unit
+ value
+ }
id
- kind
lastUpdatedBy {
userEmail
userId
userName
}
markedForDeletion
- metadata {
- annotations
- creationTimestamp
- deletionTimestamp
- generation
- labels
- name
- namespace
- }
- recordVersion
- spec {
- serviceTemplate {
- apiVersion
- kind
- spec
- }
- }
- status {
- checks
- isReady
- lastReconcileTime
- message {
- RawMessage
- }
- resources {
- apiVersion
- kind
- name
- namespace
- }
- }
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
- updateTime
- }
- }
- pageInfo {
- endCursor
- hasNextPage
- hasPreviousPage
- startCursor
- }
- totalCount
- }
-}
-
-mutation consoleCreateManagedService($msvc: ManagedServiceIn!) {
- core_createManagedService(msvc: $msvc) {
- id
- }
-}
-
-query consoleGetManagedResource($project: ProjectId!, $scope: WorkspaceOrEnvId!, $name: String!) {
- core_getManagedResource(project: $project, scope: $scope, name: $name) {
- accountName
- apiVersion
- clusterName
- createdBy {
- userEmail
- userId
- userName
- }
- creationTime
- displayName
- enabled
- id
- kind
- lastUpdatedBy {
- userEmail
- userId
- userName
- }
- markedForDeletion
- metadata {
- annotations
- creationTimestamp
- deletionTimestamp
- generation
- labels
- name
- namespace
- }
- recordVersion
- spec {
- resourceTemplate {
- apiVersion
- kind
- msvcRef {
- name
- kind
- apiVersion
- }
- spec
- }
- }
- status {
- checks
- isReady
- lastReconcileTime
- message {
- RawMessage
- }
- resources {
- apiVersion
- kind
- name
- namespace
- }
- }
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
- updateTime
- }
-}
-
-query consoleListManagedResource($project: ProjectId!, $scope: WorkspaceOrEnvId!, $search: SearchManagedResources, $pq: CursorPaginationIn) {
- core_listManagedResources(
- project: $project
- scope: $scope
- search: $search
- pq: $pq
- ) {
- pageInfo {
- endCursor
- hasNextPage
- hasPreviousPage
- startCursor
- }
- totalCount
- edges {
- cursor
- node {
- updateTime
- metadata {
- name
- }
- lastUpdatedBy {
- userEmail
- userName
- }
- kind
- displayName
- creationTime
- createdBy {
- userEmail
- userName
- }
- }
- }
- }
-}
-
-mutation consoleCreateManagedResource($mres: ManagedResourceIn!) {
- core_createManagedResource(mres: $mres) {
- id
- }
-}
-
-query consoleGetCredToken($username: String!) {
- cr_getCredToken(username: $username)
-}
-
-query consoleListCred($search: SearchCreds, $pagination: CursorPaginationIn) {
- cr_listCreds(search: $search, pagination: $pagination) {
- edges {
- cursor
- node {
- access
- accountName
- createdBy {
- userEmail
- userId
- userName
- }
- creationTime
- expiration {
- unit
- value
- }
- id
- lastUpdatedBy {
- userEmail
- userId
- userName
- }
- markedForDeletion
- name
+ name
recordVersion
updateTime
username
@@ -2679,6 +2343,357 @@ query consoleGetBuildRun($repoName: String!, $buildRunName: String!) {
}
}
+query consoleGetClusterMSv($clusterName: String!, $name: String!) {
+ infra_getClusterManagedService(clusterName: $clusterName, name: $name) {
+ displayName
+ creationTime
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ clusterName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ spec {
+ msvcSpec {
+ serviceTemplate {
+ apiVersion
+ kind
+ spec
+ }
+ }
+ namespace
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+}
+
+mutation consoleCreateClusterMSv($clusterName: String!, $service: ClusterManagedServiceIn!) {
+ infra_createClusterManagedService(clusterName: $clusterName, service: $service) {
+ id
+ }
+}
+
+mutation consoleUpdateClusterMSv($clusterName: String!, $service: ClusterManagedServiceIn!) {
+ infra_updateClusterManagedService(clusterName: $clusterName, service: $service) {
+ id
+ }
+}
+
+query consoleListClusterMSvs($clusterName: String!) {
+ infra_listClusterManagedServices(clusterName: $clusterName) {
+ edges {
+ cursor
+ node {
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ name
+ }
+ spec {
+ msvcSpec {
+ serviceTemplate {
+ apiVersion
+ kind
+ spec
+ }
+ }
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+ }
+ pageInfo {
+ endCursor
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ }
+ totalCount
+ }
+}
+
+mutation consoleDeleteClusterMSv($clusterName: String!, $serviceName: String!) {
+ infra_deleteClusterManagedService(
+ clusterName: $clusterName
+ serviceName: $serviceName
+ )
+}
+
+query consoleGetMSvTemplate($category: String!, $name: String!) {
+ infra_getManagedServiceTemplate(category: $category, name: $name) {
+ active
+ apiVersion
+ description
+ displayName
+ fields {
+ defaultValue
+ inputType
+ label
+ max
+ min
+ name
+ required
+ unit
+ displayUnit
+ multiplier
+ }
+ kind
+ logoUrl
+ name
+ outputs {
+ description
+ label
+ name
+ }
+ resources {
+ apiVersion
+ description
+ displayName
+ kind
+ name
+ }
+ }
+}
+
+query consoleListMSvTemplates {
+ infra_listManagedServiceTemplates {
+ category
+ displayName
+ items {
+ active
+ apiVersion
+ description
+ displayName
+ fields {
+ defaultValue
+ inputType
+ label
+ max
+ min
+ name
+ required
+ unit
+ displayUnit
+ multiplier
+ }
+ kind
+ logoUrl
+ name
+ outputs {
+ description
+ label
+ name
+ }
+ resources {
+ apiVersion
+ description
+ displayName
+ kind
+ name
+ }
+ }
+ }
+}
+
+query consoleGetHelmChart($clusterName: String!, $name: String!) {
+ infra_getHelmRelease(clusterName: $clusterName, name: $name) {
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ spec {
+ chartName
+ chartRepo {
+ name
+ url
+ }
+ chartVersion
+ postInstall
+ postUninstall
+ preInstall
+ preUninstall
+ values
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ releaseNotes
+ releaseStatus
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+}
+
+query consoleListHelmChart($clusterName: String!) {
+ infra_listHelmReleases(clusterName: $clusterName) {
+ edges {
+ cursor
+ node {
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ spec {
+ chartName
+ chartRepo {
+ name
+ url
+ }
+ chartVersion
+ postInstall
+ postUninstall
+ preInstall
+ preUninstall
+ values
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ releaseNotes
+ releaseStatus
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+ }
+ pageInfo {
+ endCursor
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ }
+ totalCount
+ }
+}
+
+mutation consoleCreateHelmChart($clusterName: String!, $release: HelmReleaseIn!) {
+ infra_createHelmRelease(clusterName: $clusterName, release: $release) {
+ id
+ }
+}
+
+mutation consoleUpdateHelmChart($clusterName: String!, $release: HelmReleaseIn!) {
+ infra_updateHelmRelease(clusterName: $clusterName, release: $release) {
+ id
+ }
+}
+
+mutation consoleDeleteHelmChart($clusterName: String!, $releaseName: String!) {
+ infra_deleteHelmRelease(clusterName: $clusterName, releaseName: $releaseName)
+}
+
query authCli_getKubeConfig($name: String!) {
infra_getCluster(name: $name) {
adminKubeconfig {
diff --git a/package.json b/package.json
index 8cb270fc8..a8a54a5e3 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"dependencies": {
"@jengaicons/react": "^1.3.0",
"@mdx-js/react": "^2.3.0",
- "@oshq/react-select": "^1.0.1",
+ "@oshq/react-select": "^1.0.2",
"@radix-ui/primitive": "^1.0.1",
"@radix-ui/react-alert-dialog": "1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ae8503634..beab28a70 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12,8 +12,8 @@ dependencies:
specifier: ^2.3.0
version: 2.3.0(react@18.2.0)
'@oshq/react-select':
- specifier: ^1.0.1
- version: 1.0.1(@radix-ui/react-portal@1.0.4)(classnames@2.3.2)(framer-motion@10.16.16)(rc-virtual-list@3.11.3)(react@18.2.0)
+ specifier: ^1.0.2
+ version: 1.0.2(@radix-ui/react-portal@1.0.4)(classnames@2.3.2)(framer-motion@10.16.16)(rc-virtual-list@3.11.3)(react@18.2.0)
'@radix-ui/primitive':
specifier: ^1.0.1
version: 1.0.1
@@ -2505,8 +2505,8 @@ packages:
json-parse-even-better-errors: 2.3.1
dev: true
- /@oshq/react-select@1.0.1(@radix-ui/react-portal@1.0.4)(classnames@2.3.2)(framer-motion@10.16.16)(rc-virtual-list@3.11.3)(react@18.2.0):
- resolution: {integrity: sha512-jFaoj7C0dzQBZyj4gbisgS7N3ws2VspMOWfcKdF4aaN5Em0JA8TdVJAOS+xAb+wJcZOtVpKaHoXI4otANNmzaA==}
+ /@oshq/react-select@1.0.2(@radix-ui/react-portal@1.0.4)(classnames@2.3.2)(framer-motion@10.16.16)(rc-virtual-list@3.11.3)(react@18.2.0):
+ resolution: {integrity: sha512-YLLz708lyYwPeYRJBJmA9DtPUHDcuiFzDMLNczhALeZzclycvzth6oWPTThsbL1LuAkEADiEQHIqohLnMsl53w==}
peerDependencies:
'@radix-ui/react-portal': ^1.0.4
classnames: ^2.3.2
diff --git a/src/apps/console/components/id-selector.tsx b/src/apps/console/components/id-selector.tsx
index ac56baefd..267f53da6 100644
--- a/src/apps/console/components/id-selector.tsx
+++ b/src/apps/console/components/id-selector.tsx
@@ -67,6 +67,7 @@ export const IdSelector = ({
case 'environment':
case 'managed_service':
case 'managed_resource':
+ case 'helm_release':
case 'router':
case 'secret':
case 'workspace':
@@ -121,6 +122,11 @@ export const IdSelector = ({
clusterName: cluster,
}
: {}),
+ ...(resType === 'managed_resource'
+ ? {
+ namespace: '',
+ }
+ : {}),
});
if (errors) {
diff --git a/src/apps/console/components/key-value-pair.tsx b/src/apps/console/components/key-value-pair.tsx
new file mode 100644
index 000000000..72c8843d4
--- /dev/null
+++ b/src/apps/console/components/key-value-pair.tsx
@@ -0,0 +1,130 @@
+import { MinusCircle } from '@jengaicons/react';
+import { ReactNode, useEffect, useState } from 'react';
+import AnimateHide from '~/components/atoms/animate-hide';
+import { Button, IconButton } from '~/components/atoms/button';
+import { TextInput } from '~/components/atoms/input';
+import { cn, uuid } from '~/components/utils';
+
+interface IKeyValuePair {
+ onChange?(
+ itemArray: Array>,
+ itemObject: Record
+ ): void;
+ value?: Array>;
+ label?: ReactNode;
+ message?: ReactNode;
+ error?: boolean;
+}
+const KeyValuePair = ({
+ onChange,
+ value = [],
+ label,
+ message,
+ error,
+}: IKeyValuePair) => {
+ const newItem = [{ key: '', value: '', id: uuid() }];
+ const [items, setItems] = useState>>(newItem);
+
+ const handleChange = (_value = '', id = '', target = {}) => {
+ setItems(
+ items.map((i) => {
+ if (i.id === id) {
+ switch (target) {
+ case 'key':
+ return { ...i, key: _value };
+ case 'value':
+ default:
+ return { ...i, value: _value };
+ }
+ }
+ return i;
+ })
+ );
+ };
+
+ useEffect(() => {
+ const formatItems = items.reduce((acc, curr) => {
+ if (curr.key && curr.value) {
+ acc[curr.key] = curr.value;
+ }
+ return acc;
+ }, {});
+ if (onChange) onChange(Array.from(items), formatItems);
+ }, [items]);
+
+ useEffect(() => {
+ if (value.length > 0) {
+ setItems(Array.from(value).map((v) => ({ ...v, id: uuid() })));
+ }
+ }, []);
+
+ return (
+
+
+
+ {label && (
+
{label}
+ )}
+ {items.map((item) => (
+
+
+
+ handleChange(target.value, item.id, 'key')
+ }
+ />
+
+
+
+ handleChange(target.value, item.id, 'value')
+ }
+ />
+
+
}
+ variant="plain"
+ disabled={items.length < 2}
+ onClick={() => {
+ setItems(items.filter((i) => i.id !== item.id));
+ }}
+ />
+
+ ))}
+
+
+
+ {message}
+
+
+
+
+
+
+ );
+};
+
+export default KeyValuePair;
diff --git a/src/apps/console/components/render-dynamic-field.tsx b/src/apps/console/components/render-dynamic-field.tsx
index 2487b59da..7cb571152 100644
--- a/src/apps/console/components/render-dynamic-field.tsx
+++ b/src/apps/console/components/render-dynamic-field.tsx
@@ -1,5 +1,5 @@
import { NumberInput, TextInput } from '~/components/atoms/input';
-import { IManagedServiceTemplate } from '../server/gql/queries/managed-service-queries';
+import { IMSvTemplate } from '../server/gql/queries/managed-templates-queries';
const RenderDynamicField = ({
field,
@@ -8,7 +8,7 @@ const RenderDynamicField = ({
error,
message,
}: {
- field: IManagedServiceTemplate['resources'][number]['fields'][number];
+ field: IMSvTemplate['fields'][number];
onChange: (e: { target: { value: any } }) => void;
value: any;
error?: boolean;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx
index 943f2e360..2a9b604b7 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx
@@ -17,7 +17,6 @@ import {
BlackWorkspaceLogo,
} from '~/console/components/commons';
import HandleScope, { SCOPE } from '~/console/page-components/new-scope';
-import { IManagedServiceTemplates } from '~/console/server/gql/queries/managed-service-queries';
import { type IWorkspace } from '~/console/server/gql/queries/workspace-queries';
import { GQLServerHandler } from '~/console/server/gql/saved-queries';
import {
@@ -38,12 +37,12 @@ import { SubNavDataProvider } from '~/root/lib/client/hooks/use-create-subnav-ac
import useDebounce from '~/root/lib/client/hooks/use-debounce';
import { IRemixCtx } from '~/root/lib/types/common';
import { Truncate, handleError } from '~/root/lib/utils/common';
+import { IMSvTemplates } from '~/console/server/gql/queries/managed-templates-queries';
import { IProjectContext } from '../../_layout';
-
export interface IWorkspaceContext extends IProjectContext {
workspace: IWorkspace;
- managedTemplates: IManagedServiceTemplates;
+ managedTemplates: IMSvTemplates;
}
const Workspace = () => {
@@ -268,6 +267,7 @@ export const loader = async (ctx: IRemixCtx) => {
...getScopeAndProjectQuery(ctx),
name: workspace,
});
+
if (errors) {
logger.error(errors);
throw errors[0];
@@ -275,7 +275,7 @@ export const loader = async (ctx: IRemixCtx) => {
const { data: mTemplates, errors: mErrors } = await GQLServerHandler(
ctx.request
- ).listTemplates({});
+ ).listMSvTemplates({});
if (mErrors) {
throw mErrors[0];
}
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/_index.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/_index.tsx
deleted file mode 100644
index da361ad4c..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/_index.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import { redirect } from '@remix-run/node';
-import {
- Outlet,
- useLoaderData,
- useOutletContext,
- useParams,
-} from '@remix-run/react';
-import { CommonTabs } from '~/console/components/common-navbar-tabs';
-import { IManagedService } from '~/console/server/gql/queries/managed-service-queries';
-import { GQLServerHandler } from '~/console/server/gql/saved-queries';
-import { getScopeAndProjectQuery } from '~/console/server/r-utils/common';
-import {
- ensureAccountSet,
- ensureClusterSet,
-} from '~/console/server/utils/auth-utils';
-import logger from '~/root/lib/client/helpers/log';
-import { IRemixCtx } from '~/root/lib/types/common';
-import { IWorkspaceContext } from '../../_layout';
-
-
-export interface IManagedServiceContext extends IWorkspaceContext {
- backendService: IManagedService;
-}
-
-const BackendService = () => {
- const rootContext = useOutletContext();
- const { backendService } = useLoaderData();
- return ;
-};
-
-const Tabs = () => {
- const { account, cluster, project, scope, workspace, service } = useParams();
- return (
-
- );
-};
-
-export const handle = () => {
- return {
- navbar: ,
- };
-};
-
-export const loader = async (ctx: IRemixCtx) => {
- const { service } = ctx.params;
-
- ensureClusterSet(ctx);
- ensureAccountSet(ctx);
-
- const api = GQLServerHandler(ctx.request).getManagedService;
-
- try {
- const { data, errors } = await api({
- name: service,
- ...getScopeAndProjectQuery(ctx),
- });
- if (errors) {
- logger.error(errors);
- throw errors[0];
- }
- return {
- backendService: data || {},
- };
- } catch (err) {
- return redirect(`../backing-services`);
- }
-};
-
-export default BackendService;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/handle-backend-resources.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/handle-backend-resources.tsx
deleted file mode 100644
index 4c68d8ea3..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/handle-backend-resources.tsx
+++ /dev/null
@@ -1,229 +0,0 @@
-import { useOutletContext } from '@remix-run/react';
-import { useState } from 'react';
-import { TextInput } from '~/components/atoms/input';
-import Select from '~/components/atoms/select';
-import Popup from '~/components/molecule/popup';
-import { toast } from '~/components/molecule/toast';
-import { IdSelector } from '~/console/components/id-selector';
-import MultiStep, { useMultiStep } from '~/console/components/multi-step';
-import RenderDynamicField from '~/console/components/render-dynamic-field';
-import { IDialog } from '~/console/components/types.d';
-import { useConsoleApi } from '~/console/server/gql/api-provider';
-import { IManagedServiceTemplate } from '~/console/server/gql/queries/managed-service-queries';
-import useForm, { dummyEvent } from '~/root/lib/client/hooks/use-form';
-import Yup from '~/root/lib/server/helpers/yup';
-import { IManagedServiceContext } from '../_index';
-
-const HandleBackendResources = ({
- show,
- setShow,
- template,
-}: IDialog & { template: IManagedServiceTemplate }) => {
- const [isIDLoading, setIsIDLoading] = useState(false);
- const { currentStep, onNext, onPrevious } = useMultiStep({
- defaultStep: 1,
- totalSteps: 2,
- });
-
- const [selectedType, setSelectedType] = useState<{
- label: string;
- value: string;
- resource: IManagedServiceTemplate['resources'][number];
- }>();
-
- const api = useConsoleApi();
- const { backendService, workspace } =
- useOutletContext();
-
- const {
- values: valuesFirst,
- errors: errorsFirst,
- handleChange: handleChangeFirst,
- handleSubmit: handleSubmitFirst,
- } = useForm({
- initialValues: {
- name: '',
- displayName: '',
- type: '',
- },
- validationSchema: Yup.object({
- name: Yup.string().required(),
- displayName: Yup.string().required(),
- type: Yup.string().required(),
- }),
- onSubmit: () => {
- onNext();
- },
- });
-
- const {
- values: valuesSecond,
- errors: errorsSecond,
- handleChange: handleChangeSecond,
- handleSubmit: handleSubmitSecond,
- } = useForm({
- initialValues: {
- ...(selectedType?.resource.fields.reduce((acc, field) => {
- return {
- ...acc,
- [field.name]: field.defaultValue,
- };
- }, {}) || {}),
- },
- validationSchema: Yup.object({
- ...selectedType?.resource.fields.reduce((acc, curr) => {
- return {
- ...acc,
- [curr.name]: (() => {
- let returnYup: any = Yup;
- switch (curr.inputType) {
- case 'Number':
- returnYup = returnYup.number();
- if (curr.min) returnYup = returnYup.min(curr.min);
- if (curr.max) returnYup = returnYup.max(curr.max);
- break;
- case 'String':
- returnYup = returnYup.string();
- break;
- default:
- toast.error(
- `Unknown input type ${curr.inputType} for field ${curr.name}`
- );
- returnYup = returnYup.string();
- }
-
- if (curr.required) {
- returnYup = returnYup.required();
- }
-
- return returnYup;
- })(),
- };
- }, {}),
- }),
- onSubmit: async (val) => {
- // try {
- // const { errors: e } = await api.createManagedResource({
- // mres: {
- // displayName: valuesFirst.displayName,
- // metadata: {
- // name: valuesFirst.name,
- // namespace: parseTargetNs(workspace),
- // },
- // spec: {
- // mresKind: {
- // kind: selectedType?.resource.kind || '',
- // },
- // msvcRef: {
- // apiVersion: template.apiVersion || '',
- // name: parseName(backendService),
- // kind: template.kind!,
- // },
- // inputs: {
- // ...val,
- // },
- // },
- // },
- // });
- // if (e) {
- // throw e[0];
- // }
- // } catch (err) {
- // handleError(err);
- // }
- },
- });
-
- return (
- {
- setShow(e);
- }}
- >
- Create new resource
-
-
- );
-};
-
-export default HandleBackendResources;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/managed-resources.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/managed-resources.tsx
deleted file mode 100644
index 518d77ed0..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/managed-resources.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-import { DotsThreeVerticalFill } from '@jengaicons/react';
-import { Link } from '@remix-run/react';
-import { IconButton } from '~/components/atoms/button';
-import { generateKey, titleCase } from '~/components/utils';
-import {
- ListItem,
- ListTitle,
-} from '~/console/components/console-list-components';
-import Grid from '~/console/components/grid';
-import List from '~/console/components/list';
-import ListGridView from '~/console/components/list-grid-view';
-import { IManagedResources } from '~/console/server/gql/queries/managed-resource-queries';
-import {
- ExtractNodeType,
- parseName,
- parseUpdateOrCreatedBy,
- parseUpdateOrCreatedOn,
-} from '~/console/server/r-utils/common';
-
-const RESOURCE_NAME = 'resource';
-type BaseType = ExtractNodeType;
-
-const parseItem = (item: BaseType) => {
- return {
- name: item.displayName,
- id: parseName(item),
- updateInfo: {
- author: `Updated by ${titleCase(parseUpdateOrCreatedBy(item))}`,
- time: parseUpdateOrCreatedOn(item),
- },
- };
-};
-
-const GridView = ({ items }: { items: BaseType[] }) => {
- return (
-
- {items.map((item, index) => {
- const { name, id, updateInfo } = parseItem(item);
- const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
- return (
- (
- }
- variant="plain"
- onClick={(e) => e.stopPropagation()}
- />
- }
- />
- ),
- },
- {
- key: generateKey(keyPrefix, updateInfo.author),
- render: () => (
-
- ),
- },
- ]}
- />
- );
- })}
-
- );
-};
-
-const ListView = ({ items }: { items: BaseType[] }) => {
- return (
-
- {items.map((item, index) => {
- const { name, id, updateInfo } = parseItem(item);
- const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
- return (
- ,
- },
- {
- key: generateKey(keyPrefix, updateInfo.author),
- render: () => (
-
- ),
- },
- {
- key: generateKey(keyPrefix, 'action'),
- render: () => (
- }
- variant="plain"
- onClick={(e) => e.stopPropagation()}
- />
- ),
- },
- ]}
- />
- );
- })}
-
- );
-};
-
-const ManagedResources = ({ items }: { items: BaseType[] }) => {
- return (
- }
- gridView={}
- />
- );
-};
-
-export default ManagedResources;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/route.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/route.tsx
deleted file mode 100644
index 525c65405..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/route.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import { Plus, PlusFill } from '@jengaicons/react';
-import { defer } from '@remix-run/node';
-import { useLoaderData, useOutletContext } from '@remix-run/react';
-import { useState } from 'react';
-import { Button } from '~/components/atoms/button.jsx';
-import { LoadingComp, pWrapper } from '~/console/components/loading-component';
-import { IShowDialog } from '~/console/components/types.d';
-import Wrapper from '~/console/components/wrapper';
-import {
- getScopeAndProjectQuery,
- parseNodes,
-} from '~/console/server/r-utils/common';
-import { getSearch } from '~/console/server/utils/common';
-import { getManagedTemplate } from '~/console/utils/commons';
-import { IRemixCtx } from '~/root/lib/types/common';
-import fake from '~/root/fake-data-generator/fake';
-
-import {
- ensureAccountSet,
- ensureClusterSet,
-} from '~/console/server/utils/auth-utils';
-import { GQLServerHandler } from '~/console/server/gql/saved-queries';
-import HandleBackendResources from './handle-backend-resources';
-import ManagedResources from './managed-resources';
-import Tools from './tools';
-import { IManagedServiceContext } from '../_index';
-
-export const loader = async (ctx: IRemixCtx) => {
- ensureAccountSet(ctx);
- ensureClusterSet(ctx);
-
- const { service } = ctx.params;
- const promise = pWrapper(async () => {
- const { data, errors } = await GQLServerHandler(
- ctx.request
- ).listManagedResource({
- ...getScopeAndProjectQuery(ctx),
- search: {
- ...getSearch(ctx),
- managedServiceName: {
- matchType: 'exact',
- exact: service,
- },
- },
- });
- if (errors) {
- throw errors[0];
- }
- return {
- resourcesData: data || {},
- };
- });
-
- return defer({ promise });
-};
-
-const BackingResources = () => {
- const [showBackendResourceDialog, setShowBackendResourceDialog] =
- useState(null);
- const { promise } = useLoaderData();
-
- const { managedTemplates, backendService } =
- useOutletContext();
-
- return (
- <>
-
- {({ resourcesData }) => {
- const resources = parseNodes(resourcesData);
-
- if (!resources) {
- return null;
- }
- return (
- }
- onClick={() => {
- setShowBackendResourceDialog({ type: '', data: null });
- }}
- />
- ),
- }}
- empty={{
- is: resources.length === 0,
- title:
- 'This is where you’ll manage your backing service resources..',
- content: (
-
- You can create a new resource and manage the listed
- resources.
-
- ),
- action: {
- content: 'Create new resource',
- prefix: ,
- onClick: () => {
- setShowBackendResourceDialog({ type: '', data: null });
- },
- },
- }}
- tools={}
- >
-
-
- );
- }}
-
-
- >
- );
-};
-
-export default BackingResources;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/tools.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/tools.tsx
deleted file mode 100644
index dd5ecb243..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-service+/$service/resources/tools.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { useParams, useSearchParams } from '@remix-run/react';
-import { useMemo } from 'react';
-import CommonTools from '~/console/components/common-tools';
-import { useConsoleApi } from '~/console/server/gql/api-provider';
-import { parseName, parseNodes } from '~/console/server/r-utils/common';
-import { ensureAccountClientSide } from '~/console/server/utils/auth-utils';
-import { isValidRegex } from '~/console/server/utils/common';
-
-const Tools = () => {
- const [searchParams] = useSearchParams();
-
- const params = useParams();
-
- const api = useConsoleApi();
-
- const options = useMemo(
- () => [
- {
- name: 'Cluster',
- type: 'clusterName',
- search: true,
- dataFetcher: async (s: string) => {
- ensureAccountClientSide(params);
- const { data, errors } = await api.listClusters(
- isValidRegex(s)
- ? {
- search: {
- text: {
- matchType: 'regex',
- regex: s || '',
- },
- },
- }
- : {}
- );
-
- if (errors) {
- throw errors[0];
- }
-
- const datas = parseNodes(data);
- return datas.map((item) => {
- return {
- content: item.displayName,
- value: parseName(item),
- };
- });
- },
- },
- ],
- [searchParams]
- );
-
- return ;
-};
-
-export default Tools;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/backend-services-resources.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/backend-services-resources.tsx
deleted file mode 100644
index 1f5884769..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/backend-services-resources.tsx
+++ /dev/null
@@ -1,196 +0,0 @@
-import { DotsThreeVerticalFill } from '@jengaicons/react';
-import { Link } from '@remix-run/react';
-import { IconButton } from '~/components/atoms/button';
-import { generateKey, titleCase } from '~/components/utils';
-import {
- ListBody,
- ListItem,
- ListTitle,
-} from '~/console/components/console-list-components';
-import Grid from '~/console/components/grid';
-import List from '~/console/components/list';
-import ListGridView from '~/console/components/list-grid-view';
-import {
- IManagedServiceTemplates,
- IManagedServices,
-} from '~/console/server/gql/queries/managed-service-queries';
-import {
- ExtractNodeType,
- parseName,
- parseUpdateOrCreatedBy,
- parseUpdateOrCreatedOn,
-} from '~/console/server/r-utils/common';
-import { getManagedTemplate } from '~/console/utils/commons';
-
-const RESOURCE_NAME = 'backend service';
-
-const parseItem = (
- item: ExtractNodeType
- // templates: IManagedServiceTemplates
-) => {
- // const template = getManagedTemplate({
- // templates,
- // kind: item.spec.msvcKind.kind || '',
- // apiVersion: item.spec.msvcKind.apiVersion,
- // });
- return {
- name: item?.displayName,
- id: parseName(item),
- type: item?.kind,
- updateInfo: {
- author: `Updated by ${titleCase(parseUpdateOrCreatedBy(item))}`,
- time: parseUpdateOrCreatedOn(item),
- },
- logo: '',
- // logo: template?.logoUrl,
- };
-};
-
-const GridView = ({
- items = [],
- templates = [],
-}: {
- items: ExtractNodeType[];
- templates: ExtractNodeType;
-}) => {
- return (
-
- {items.map((item, index) => {
- const { name, id, type, logo, updateInfo } = parseItem(
- item
- // templates
- );
- const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
- return (
- (
- }
- variant="plain"
- onClick={(e) => e.stopPropagation()}
- />
- }
- avatar={
-
- }
- />
- ),
- },
- {
- key: generateKey(keyPrefix, type),
- render: () => (
-
-
-
- ),
- },
- {
- key: generateKey(keyPrefix, 'author'),
- render: () => (
-
- ),
- },
- ]}
- />
- );
- })}
-
- );
-};
-
-const ListView = ({
- items = [],
- templates = [],
-}: {
- items: ExtractNodeType[];
- templates: ExtractNodeType;
-}) => {
- return (
-
- {items.map((item, index) => {
- const { name, id, type, logo, updateInfo } = parseItem(
- item
- // templates
- );
- const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
-
- return (
- (
-
-
-
- }
- />
- ),
- },
- {
- key: generateKey(keyPrefix, type),
- className: 'w-[140px] text-start',
- render: () => ,
- },
- {
- key: generateKey(keyPrefix, 'author'),
- className: 'w-[180px]',
- render: () => (
-
- ),
- },
- {
- key: generateKey(keyPrefix, 'action'),
- render: () => (
- }
- variant="plain"
- onClick={(e) => e.stopPropagation()}
- />
- ),
- },
- ]}
- />
- );
- })}
-
- );
-};
-
-const BackendServicesResources = ({
- items = [],
- templates = [],
-}: {
- items: ExtractNodeType[];
- templates: ExtractNodeType;
-}) => {
- return (
- }
- gridView={}
- />
- );
-};
-
-export default BackendServicesResources;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/handle-backend-service.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/handle-backend-service.tsx
deleted file mode 100644
index 00417797d..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/handle-backend-service.tsx
+++ /dev/null
@@ -1,437 +0,0 @@
-import { ArrowLeft, Search } from '@jengaicons/react';
-import { useOutletContext } from '@remix-run/react';
-import { useState } from 'react';
-import ActionList from '~/components/atoms/action-list';
-import { IconButton } from '~/components/atoms/button';
-import { NumberInput, TextInput } from '~/components/atoms/input';
-import Popup from '~/components/molecule/popup';
-import { toast } from '~/components/molecule/toast';
-import { cn } from '~/components/utils';
-import Grid from '~/console/components/grid';
-import { IdSelector } from '~/console/components/id-selector';
-import NoResultsFound from '~/console/components/no-results-found';
-import { IDialog } from '~/console/components/types.d';
-import { useConsoleApi } from '~/console/server/gql/api-provider';
-import { IManagedServiceTemplates } from '~/console/server/gql/queries/managed-service-queries';
-import { useInputSearch } from '~/root/lib/client/helpers/search-filter';
-import useForm, { dummyEvent } from '~/root/lib/client/hooks/use-form';
-import Yup from '~/root/lib/server/helpers/yup';
-import { NN } from '~/root/lib/types/common';
-import { IWorkspaceContext } from '../_layout';
-
-type IActiveCategory = {
- name: string;
- displayName: string;
-} | null;
-
-type ISelectedService = {
- category: {
- name: string;
- displayName: string;
- };
-
- service: NN[number]['items'][number];
-} | null;
-
-const ServicePicker = ({
- activeCategory,
- setActiveCategory,
- templates,
- selectedService,
- setSelectedService,
-}: {
- activeCategory: IActiveCategory;
- setActiveCategory: React.Dispatch;
- templates: IManagedServiceTemplates;
- selectedService: ISelectedService;
- setSelectedService: React.Dispatch;
-}) => {
- const [searchProps, searchResults] = useInputSearch(
- {
- data:
- templates?.find((t) => t.category === activeCategory?.name)?.items ||
- [],
- keys: ['name'],
- reverse: false,
- threshold: 0.4,
- },
- [activeCategory]
- );
- return (
-
-
-
{
- setActiveCategory({
- name: v,
- displayName:
- templates?.find((t) => t.category === v)?.displayName || '',
- });
- }}
- >
- {templates?.map((t, index) => {
- if (!activeCategory && index === 0) {
- setActiveCategory({
- name: t.category,
- displayName: t.displayName,
- });
- }
- return (
-
- {t.displayName}
-
- );
- })}
-
-
-
-
}
- placeholder="Search"
- />
- {templates?.find((t) => t.category === activeCategory?.name)?.items
- .length === 0 ? (
-
- ) : null}
-
- {searchResults.map((item) => {
- return (
- {
- if (!item.apiVersion) {
- toast.error('not available now');
- return;
- }
- if (activeCategory) {
- setSelectedService({
- category: activeCategory,
- service: item,
- });
- }
- }}
- key={item.name}
- className={cn({
- '!bg-surface-basic-active':
- item.name === selectedService?.service.name,
- 'opacity-50 cursor-not-allowed': !item.apiVersion,
- })}
- rows={[
- {
- key: `${item.name}first`,
- render() {
- return (
-
-
-
-
-
- {item.displayName}
-
-
-
- );
- },
- },
- ]}
- />
- );
- })}
-
-
-
- );
-};
-
-const RenderField = ({
- field,
- value,
- onChange,
- error,
- message,
-}: {
- field: NN['service']['fields'][number];
- onChange: (e: { target: { value: any } }) => void;
- value: any;
- error: boolean;
- message?: string;
-}) => {
- if (field.inputType === 'Number') {
- return (
-
- );
- }
-
- if (field.inputType === 'String') {
- return (
-
- );
- }
- return unknown input type {field.inputType}
;
-};
-
-const Fill = ({
- selectedService,
- values,
- handleChange,
- errors,
-}: {
- selectedService: ISelectedService;
- values: { [key: string]: any };
- handleChange: (key: string) => (e: { target: { value: any } }) => void;
- errors: {
- [key: string]: string | undefined;
- };
-}) => {
- return (
-
-
- {
- handleChange('name')(dummyEvent(v));
- }}
- />
- {selectedService?.service.fields.map((field) => {
- const k = field.name;
- return (
-
- );
- })}
-
- );
-};
-
-const HandleBackendService = ({
- show,
- setShow,
- templates,
-}: IDialog & {
- templates: IManagedServiceTemplates;
-}) => {
- const [activeCategory, setActiveCategory] = useState(null);
- const [selectedService, setSelectedService] =
- useState(null);
-
- const [step, setStep] = useState<'choose' | 'fill'>('choose');
-
- const api = useConsoleApi();
- const { workspace } = useOutletContext();
- const { values, errors, handleChange, handleSubmit, resetValues, isLoading } =
- useForm({
- initialValues: {
- name: '',
- displayName: '',
- ...(selectedService?.service.fields.reduce((acc, field) => {
- return {
- ...acc,
- [field.name]: field.defaultValue,
- };
- }, {}) || {}),
- } as {
- [key: string]: any;
- },
- validationSchema: Yup.object({
- name: Yup.string().required(),
- displayName: Yup.string().required(),
- ...selectedService?.service.fields.reduce((acc, curr) => {
- return {
- ...acc,
- [curr.name]: (() => {
- let returnYup: any = Yup;
- switch (curr.inputType) {
- case 'Number':
- returnYup = returnYup.number();
- if (curr.min) returnYup = returnYup.min(curr.min);
- if (curr.max) returnYup = returnYup.max(curr.max);
- break;
- case 'String':
- returnYup = returnYup.string();
- break;
- default:
- toast.error(
- `Unknown input type ${curr.inputType} for field ${curr.name}`
- );
- returnYup = returnYup.string();
- }
-
- if (curr.required) {
- returnYup = returnYup.required();
- }
-
- return returnYup;
- })(),
- };
- }, {}),
- }),
- onSubmit: async (val) => {
- const tempVal = { ...val };
- delete tempVal.name;
- delete tempVal.displayName;
- // try {
- // const { errors: e } = await api.createManagedService({
- // msvc: {
- // displayName: val.displayName,
- // metadata: {
- // name: val.name,
- // namespace: parseTargetNs(workspace),
- // annotations: {},
- // },
- // spec: {
- // msvcKind: {
- // apiVersion: selectedService?.service.apiVersion || '',
- // kind: selectedService?.service.kind || '',
- // },
- // inputs: {
- // ...tempVal,
- // },
- // },
- // },
- // });
- // if (e) {
- // throw e[0];
- // }
- // } catch (err) {
- // handleError(err);
- // }
- },
- });
-
- return (
- {
- if (!e) {
- resetValues();
- }
- setShow(e);
- }}
- >
-
- {step === 'choose' ? (
- Choose a service
- ) : (
-
-
-
}
- size="xs"
- variant="plain"
- onClick={() => {
- resetValues({});
- setStep('choose');
- }}
- />
-
-
-
{selectedService?.service.displayName}
-
- )}
-
-
-
- );
-};
-
-export default HandleBackendService;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/route.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/route.tsx
deleted file mode 100644
index a22cf0041..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/route.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { Plus, PlusFill } from '@jengaicons/react';
-import { defer } from '@remix-run/node';
-import { useLoaderData, useOutletContext } from '@remix-run/react';
-import { useState } from 'react';
-import { Button } from '~/components/atoms/button.jsx';
-import { LoadingComp, pWrapper } from '~/console/components/loading-component';
-import { IShowDialog } from '~/console/components/types.d';
-import Wrapper from '~/console/components/wrapper';
-import { GQLServerHandler } from '~/console/server/gql/saved-queries';
-import {
- getScopeAndProjectQuery,
- parseNodes,
-} from '~/console/server/r-utils/common';
-import { IRemixCtx } from '~/root/lib/types/common';
-import fake from '~/root/fake-data-generator/fake';
-
-import BackendServicesResources from './backend-services-resources';
-import HandleBackendService from './handle-backend-service';
-import Tools from './tools';
-import { IWorkspaceContext } from '../_layout';
-
-export const loader = (ctx: IRemixCtx) => {
- const promise = pWrapper(async () => {
- const { data: mData, errors: mErrors } = await GQLServerHandler(
- ctx.request
- ).listManagedServices({ ...getScopeAndProjectQuery(ctx) });
-
- if (mErrors) {
- throw mErrors[0];
- }
-
- return { managedServices: mData };
- });
- return defer({ promise });
-};
-
-const BackendServices = () => {
- const [showHandleBackendService, setShowHanldeBackendService] =
- useState(null);
- const { promise } = useLoaderData();
-
- const { managedTemplates } = useOutletContext();
-
- return (
-
- {({ managedServices }) => {
- const backendServices = parseNodes(managedServices);
-
- return (
- <>
- 0 && (
- }
- onClick={() => {
- setShowHanldeBackendService({ type: 'add', data: null });
- }}
- />
- ),
- }}
- empty={{
- is: backendServices.length === 0,
- title: 'This is where you’ll manage your Backing services.',
- content: (
-
- You can create a new backing service and manage the listed
- backing service.
-
- ),
- action: {
- content: 'Create new backing service',
- prefix: ,
- onClick: () => {
- setShowHanldeBackendService({ type: 'add', data: null });
- },
- },
- }}
- >
-
-
-
-
-
- >
- );
- }}
-
- );
-};
-
-export default BackendServices;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_index.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_index.tsx
index a26ddc40f..18dbdff3f 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_index.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_index.tsx
@@ -3,5 +3,5 @@ import { IRemixCtx } from '~/root/lib/types/common';
export const loader = (ctx: IRemixCtx) => {
const { project, account, cluster } = ctx.params;
- return redirect(`/${account}/${cluster}/${project}/workspaces`);
+ return redirect(`/${account}/${cluster}/${project}/environments`);
};
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_layout.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_layout.tsx
index 293c7a1f2..5ffc11f17 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/_layout.tsx
@@ -3,11 +3,14 @@ import { Link, Outlet, useOutletContext, useParams } from '@remix-run/react';
import { ProdLogo } from '~/components/branding/prod-logo';
import { WorkspacesLogo } from '~/components/branding/workspace-logo';
import { SCOPE } from '~/console/page-components/new-scope';
-import { ensureAccountSet, ensureClusterSet } from '~/console/server/utils/auth-utils';
+import {
+ ensureAccountSet,
+ ensureClusterSet,
+} from '~/console/server/utils/auth-utils';
import { IRemixCtx } from '~/root/lib/types/common';
-import { IProjectContext } from '../_layout';
import Breadcrum from '~/console/components/breadcrum';
import LogoWrapper from '~/console/components/logo-wrapper';
+import { IProjectContext } from '../_layout';
export const loader = async (ctx: IRemixCtx) => {
ensureAccountSet(ctx);
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/_layout.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/_layout.tsx
index dfa231857..10bb3b6f8 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/_layout.tsx
@@ -1,5 +1,6 @@
import { redirect } from '@remix-run/node';
import {
+ Link,
Outlet,
useLoaderData,
useOutletContext,
@@ -8,11 +9,20 @@ import {
import logger from '~/root/lib/client/helpers/log';
import { SubNavDataProvider } from '~/root/lib/client/hooks/use-create-subnav-action';
import { IRemixCtx } from '~/root/lib/types/common';
-import { IClusterContext } from '../../infra+/$cluster+/_layout';
-import { IProject } from '~/console/server/gql/queries/project-queries';
+import {
+ IProject,
+ IProjects,
+} from '~/console/server/gql/queries/project-queries';
import { CommonTabs } from '~/console/components/common-navbar-tabs';
-import { ensureAccountSet, ensureClusterSet } from '~/console/server/utils/auth-utils';
+import {
+ ensureAccountSet,
+ ensureClusterSet,
+} from '~/console/server/utils/auth-utils';
import { GQLServerHandler } from '~/console/server/gql/saved-queries';
+import Breadcrum from '~/console/components/breadcrum';
+import { ChevronRight } from '@jengaicons/react';
+import { ExtractNodeType, parseName } from '~/console/server/r-utils/common';
+import { IClusterContext } from '../../infra+/$cluster+/_layout';
export interface IProjectContext extends IClusterContext {
project: IProject;
@@ -28,26 +38,48 @@ const Project = () => {
);
};
+const LocalBreadcrum = ({
+ project,
+}: {
+ project: ExtractNodeType;
+}) => {
+ const { account, cluster } = useParams();
+ return (
+
+
+ Projects
+
+ }
+ />
+ {project.displayName}}
+ />
+
+ );
+};
+
const ProjectTabs = () => {
const { account, cluster, project } = useParams();
return (
{
);
};
-export const handle = () => {
+export const handle = ({
+ project,
+}: {
+ project: ExtractNodeType;
+}) => {
return {
navbar: ,
+ breadcrum: () => ,
};
};
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/route.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/route.tsx
index 2b395c220..33c6935f9 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/route.tsx
@@ -13,10 +13,13 @@ import { getPagination, getSearch } from '~/console/server/utils/common';
import { IRemixCtx } from '~/root/lib/types/common';
import fake from '~/root/fake-data-generator/fake';
+import {
+ ensureAccountSet,
+ ensureClusterSet,
+} from '~/console/server/utils/auth-utils';
+import { GQLServerHandler } from '~/console/server/gql/saved-queries';
import Resources from './resources';
import Tools from './tools';
-import { ensureAccountSet, ensureClusterSet } from '~/console/server/utils/auth-utils';
-import { GQLServerHandler } from '~/console/server/gql/saved-queries';
export const loader = async (ctx: IRemixCtx) => {
ensureAccountSet(ctx);
@@ -61,6 +64,8 @@ const Workspaces = () => {
}}
>
{({ environmentData }) => {
+ console.log('environment: ', environmentData);
+
const environments = parseNodes(environmentData);
if (!environments) {
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/settings+/_layout.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/settings+/_layout.tsx
index 49bce69e5..87a49af2e 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/settings+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/settings+/_layout.tsx
@@ -1,7 +1,7 @@
import { Outlet, useOutletContext } from '@remix-run/react';
import { useSubNavData } from '~/root/lib/client/hooks/use-create-subnav-action';
-import { IProjectContext } from '../_layout';
import SidebarLayout from '~/console/components/sidebar-layout';
+import { IProjectContext } from '../_layout';
const Settings = () => {
const rootContext = useOutletContext();
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/resources.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/resources.tsx
deleted file mode 100644
index 1f79ca454..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/resources.tsx
+++ /dev/null
@@ -1,173 +0,0 @@
-import { DotsThreeVerticalFill } from '@jengaicons/react';
-import { Link, useParams } from '@remix-run/react';
-import { IconButton } from '~/components/atoms/button';
-import { generateKey, titleCase } from '~/components/utils';
-import ConsoleAvatar from '~/console/components/console-avatar';
-import {
- ListBody,
- ListItem,
- ListTitle,
-} from '~/console/components/console-list-components';
-import Grid from '~/console/components/grid';
-import List from '~/console/components/list';
-import ListGridView from '~/console/components/list-grid-view';
-import { IWorkspaces } from '~/console/server/gql/queries/workspace-queries';
-import {
- ExtractNodeType,
- parseName,
- parseUpdateOrCreatedBy,
- parseUpdateOrCreatedOn,
-} from '~/console/server/r-utils/common';
-
-const RESOURCE_NAME = 'workspace';
-
-const parseItem = (item: ExtractNodeType) => {
- return {
- name: item.displayName,
- id: parseName(item),
- cluster: item.clusterName,
- path: `workspaces/${parseName(item)}`,
- updateInfo: {
- author: `Updated by ${titleCase(parseUpdateOrCreatedBy(item))}`,
- time: parseUpdateOrCreatedOn(item),
- },
- };
-};
-
-const GridView = ({
- items = [],
-}: {
- items: ExtractNodeType[];
-}) => {
- const { account, project } = useParams();
- return (
-
- {items.map((item, index) => {
- const { name, id, path, cluster, updateInfo } = parseItem(item);
- const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
- return (
- (
- }
- variant="plain"
- onClick={(e) => e.stopPropagation()}
- />
- }
- avatar={}
- />
- ),
- },
- {
- key: generateKey(keyPrefix, path + cluster),
- render: () => (
-
-
-
-
- ),
- },
- {
- key: generateKey(keyPrefix, updateInfo.author),
- render: () => (
-
- ),
- },
- ]}
- />
- );
- })}
-
- );
-};
-
-const ListView = ({ items }: { items: ExtractNodeType[] }) => {
- const { account, project } = useParams();
-
- return (
-
- {items.map((item, index) => {
- const { name, id, path, cluster, updateInfo } = parseItem(item);
- const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
- return (
- (
- }
- />
- ),
- },
-
- {
- key: generateKey(keyPrefix, path),
- className: 'w-[230px] text-start',
- render: () => ,
- },
- {
- key: generateKey(keyPrefix, cluster),
- className: 'w-[120px] text-start',
- render: () => ,
- },
- {
- key: generateKey(keyPrefix, updateInfo.author),
- className: 'w-[180px]',
- render: () => (
-
- ),
- },
- {
- key: generateKey(keyPrefix, 'action'),
- render: () => (
- }
- variant="plain"
- onClick={(e) => e.stopPropagation()}
- />
- ),
- },
- ]}
- />
- );
- })}
-
- );
-};
-
-const Resources = ({
- items = [],
-}: {
- items: ExtractNodeType[];
-}) => {
- return (
- }
- gridView={}
- />
- );
-};
-
-export default Resources;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/route.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/route.tsx
deleted file mode 100644
index ebfccee97..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/route.tsx
+++ /dev/null
@@ -1,116 +0,0 @@
-import { Plus, PlusFill } from '@jengaicons/react';
-import { defer } from '@remix-run/node';
-import { useLoaderData } from '@remix-run/react';
-import { useState } from 'react';
-import { Button } from '~/components/atoms/button.jsx';
-import { LoadingComp, pWrapper } from '~/console/components/loading-component';
-import { IShowDialog } from '~/console/components/types.d';
-import Wrapper from '~/console/components/wrapper';
-import HandleScope, { SCOPE } from '~/console/page-components/new-scope';
-import { IWorkspace } from '~/console/server/gql/queries/workspace-queries';
-import { parseNodes } from '~/console/server/r-utils/common';
-import { getPagination, getSearch } from '~/console/server/utils/common';
-import { IRemixCtx } from '~/root/lib/types/common';
-import fake from '~/root/fake-data-generator/fake';
-
-import Resources from './resources';
-import Tools from './tools';
-import { ensureAccountSet, ensureClusterSet } from '~/console/server/utils/auth-utils';
-import { GQLServerHandler } from '~/console/server/gql/saved-queries';
-
-export const loader = async (ctx: IRemixCtx) => {
- ensureAccountSet(ctx);
- ensureClusterSet(ctx);
- const { project } = ctx.params;
- const promise = pWrapper(async () => {
- const { data, errors } = await GQLServerHandler(ctx.request).listWorkspaces(
- {
- project: {
- type: 'name',
- value: project,
- },
- pagination: getPagination(ctx),
- search: getSearch(ctx),
- }
- );
- if (errors) {
- throw errors[0];
- }
-
- return {
- workspacesData: data || {},
- };
- });
-
- return defer({ promise });
-};
-
-const Workspaces = () => {
- const [showAddWS, setShowAddWS] =
- useState>(null);
- const { promise } = useLoaderData();
-
- return (
- <>
-
- {({ workspacesData }) => {
- const workspaces = parseNodes(workspacesData);
-
- if (!workspaces) {
- return null;
- }
-
- return (
- 0 && (
- }
- onClick={() => {
- setShowAddWS({ type: 'add', data: null });
- }}
- />
- ),
- }}
- empty={{
- is: workspaces.length === 0,
- title: 'This is where you’ll manage your workspaces.',
- content: (
-
- You can create a new workspace and manage the listed
- workspaces.
-
- ),
- action: {
- content: 'Create new workspace',
- prefix: ,
- onClick: () => {
- setShowAddWS({ type: 'add', data: null });
- },
- },
- }}
- tools={}
- >
-
-
- );
- }}
-
-
- >
- );
-};
-
-export default Workspaces;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/tools.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/tools.tsx
deleted file mode 100644
index 3bfdc3c7c..000000000
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/workspaces/tools.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { useSearchParams } from '@remix-run/react';
-import { useMemo } from 'react';
-import CommonTools from '~/console/components/common-tools';
-
-const Tools = () => {
- const [searchParams] = useSearchParams();
-
- const options = useMemo(() => [], [searchParams]);
-
- return ;
-};
-
-export default Tools;
diff --git a/src/apps/console/routes/_main+/$account+/_layout.tsx b/src/apps/console/routes/_main+/$account+/_layout.tsx
index 5888db34c..11629ada1 100644
--- a/src/apps/console/routes/_main+/$account+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/_layout.tsx
@@ -17,8 +17,10 @@ import { useDataFromMatches } from '~/root/lib/client/hooks/use-custom-matches';
import { useUnsavedChanges } from '~/root/lib/client/hooks/use-unsaved-changes';
import { IRemixCtx, LoaderResult } from '~/root/lib/types/common';
-
-import { IAccount, IAccounts } from '~/console/server/gql/queries/account-queries';
+import {
+ IAccount,
+ IAccounts,
+} from '~/console/server/gql/queries/account-queries';
import { parseName } from '~/console/server/r-utils/common';
import { ensureAccountClientSide } from '~/console/server/utils/auth-utils';
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/_layout.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/_layout.tsx
index 6ddf6974f..6f45ed962 100644
--- a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/_layout.tsx
@@ -9,7 +9,16 @@ import {
import withContext from '~/root/lib/app-setup/with-contxt';
import { IExtRemixCtx } from '~/root/lib/types/common';
import { BrandLogo } from '~/components/branding/brand-logo';
-import { ChevronRight } from '@jengaicons/react';
+import {
+ BackingServices,
+ ChevronRight,
+ CirclesThreePlus,
+ Cpu,
+ Database,
+ GearSix,
+ HouseLine,
+ WireGuardlogo,
+} from '@jengaicons/react';
import {
ICluster,
IClusters,
@@ -37,31 +46,67 @@ const Cluster = () => {
const ClusterTabs = () => {
const { account, cluster } = useParams();
+ const iconSize = 16;
return (
+
+ Overview
+
+ ),
to: '/overview',
value: '/overview',
},
{
- label: 'Compute',
+ label: (
+
+
+ Nodepools
+
+ ),
to: '/nodepools',
value: '/nodepools',
},
{
- label: 'Storage',
+ label: (
+
+
+ Storage
+
+ ),
to: '/storage',
value: '/storage',
},
{
- label: 'Network',
+ label: (
+
+
+ VPN
+
+ ),
to: '/network/vpn',
value: '/network',
},
{
- label: 'Settings',
+ label: (
+
+
+ Managed services
+
+ ),
+ to: '/managedservices/kl-operator-services',
+ value: '/managedservices',
+ },
+ {
+ label: (
+
+
+ Settings
+
+ ),
to: '/settings/general',
value: '/settings',
},
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/_layout.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/_layout.tsx
new file mode 100644
index 000000000..b2416d7aa
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/_layout.tsx
@@ -0,0 +1,24 @@
+import { Outlet, useOutletContext } from '@remix-run/react';
+import SidebarLayout from '~/console/components/sidebar-layout';
+
+const ManagedServicesLayout = () => {
+ const rootContext = useOutletContext();
+ // const noLayout = useHandleFromMatches('noLayout', null);
+
+ // if (noLayout) {
+ // return ;
+ // }
+ return (
+
+
+
+ );
+};
+
+export default ManagedServicesLayout;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/_index.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/_index.tsx
new file mode 100644
index 000000000..23784a2aa
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/_index.tsx
@@ -0,0 +1,93 @@
+import { Plus, PlusFill } from '@jengaicons/react';
+import { defer } from '@remix-run/node';
+import { useLoaderData } from '@remix-run/react';
+import { useState } from 'react';
+import { Button } from '~/components/atoms/button.jsx';
+import { LoadingComp, pWrapper } from '~/console/components/loading-component';
+import Wrapper from '~/console/components/wrapper';
+import { GQLServerHandler } from '~/console/server/gql/saved-queries';
+import { parseNodes } from '~/console/server/r-utils/common';
+import { IRemixCtx } from '~/root/lib/types/common';
+import Tools from './tools';
+import HelmChartResources from './helm-chart-resources';
+import HandleHelmChart from './handle-helm-chart';
+
+export const loader = (ctx: IRemixCtx) => {
+ const { cluster } = ctx.params;
+ const promise = pWrapper(async () => {
+ const { data: mData, errors: mErrors } = await GQLServerHandler(
+ ctx.request
+ ).listHelmChart({
+ clusterName: cluster,
+ });
+
+ if (mErrors) {
+ throw mErrors[0];
+ }
+
+ return { helmChartData: mData };
+ });
+ return defer({ promise });
+};
+
+const HelmCharts = () => {
+ const [visible, setVisible] = useState(false);
+ const { promise } = useLoaderData();
+
+ return (
+ <>
+
+ {({ helmChartData }) => {
+ const helmCharts = parseNodes(helmChartData);
+
+ return (
+ 0 && (
+ }
+ onClick={() => {
+ setVisible(true);
+ }}
+ />
+ ),
+ }}
+ empty={{
+ is: helmCharts.length === 0,
+ title: 'This is where you’ll manage your Helm charts.',
+ content: (
+
+ You can create a new backing service and manage the listed
+ backing service.
+
+ ),
+ action: {
+ content: 'Create helm chart',
+ prefix: ,
+ onClick: () => {
+ setVisible(true);
+ },
+ },
+ }}
+ tools={}
+ >
+
+
+ );
+ }}
+
+
+ >
+ );
+};
+
+export default HelmCharts;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/handle-helm-chart.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/handle-helm-chart.tsx
new file mode 100644
index 000000000..d4577da1e
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/handle-helm-chart.tsx
@@ -0,0 +1,244 @@
+/* eslint-disable react/destructuring-assignment */
+import * as Chips from '~/components/atoms/chips';
+import { TextArea, TextInput } from '~/components/atoms/input';
+import Popup from '~/components/molecule/popup';
+import { yamlDump } from '~/console/components/diff-viewer';
+import { IdSelector } from '~/console/components/id-selector';
+import { IDialogBase } from '~/console/components/types.d';
+import { useConsoleApi } from '~/console/server/gql/api-provider';
+import { IHelmCharts } from '~/console/server/gql/queries/helm-chart-queries';
+import { ExtractNodeType, parseName } from '~/console/server/r-utils/common';
+import { useReload } from '~/root/lib/client/helpers/reloader';
+import useForm, { dummyEvent } from '~/root/lib/client/hooks/use-form';
+import Yup from '~/root/lib/server/helpers/yup';
+import { handleError } from '~/root/lib/utils/common';
+import yaml from 'js-yaml';
+import { useParams } from '@remix-run/react';
+import axios from 'axios';
+import useDebounce from '~/root/lib/client/hooks/use-debounce';
+import { useEffect, useState } from 'react';
+import Select from '~/components/atoms/select';
+
+type IDialog = IDialogBase>;
+
+type IHelmDoc = {
+ apiVersion: string;
+ entries: {
+ [key: string]: { version: string }[];
+ };
+ generated: string;
+};
+const Root = (props: IDialog) => {
+ const { isUpdate, setVisible } = props;
+ const api = useConsoleApi();
+ const reloadPage = useReload();
+ const { cluster } = useParams();
+ const [repoNames, setRepoNames] = useState<
+ Array<{ label: string; value: string }>
+ >([]);
+ const [repoNamesLoading, setRepoNamesLoading] = useState(false);
+
+ const repoUrlChanges = async (repoUrl: string) => {
+ try {
+ setRepoNamesLoading(true);
+ const res = await axios.get(`${repoUrl}/index.yaml`);
+ const repos = yaml.load(res.data, { json: true }) as IHelmDoc;
+ setRepoNames(
+ Object.keys(repos.entries).map((v) => ({ label: v, value: v }))
+ );
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setRepoNamesLoading(false);
+ }
+ };
+
+ const { values, errors, handleSubmit, handleChange, isLoading, resetValues } =
+ useForm({
+ initialValues: isUpdate
+ ? {
+ displayName: '',
+ name: '',
+ namespace: '',
+ chartName: '',
+ chartRepo: {
+ name: '',
+ url: '',
+ },
+ chartVersion: '',
+ values: '',
+ }
+ : {
+ displayName: '',
+ name: '',
+ namespace: '',
+ chartName: '',
+ chartRepo: {
+ name: '',
+ url: '',
+ },
+ chartVersion: '',
+ values: '',
+ },
+ validationSchema: isUpdate
+ ? Yup.object({
+ displayName: Yup.string().required(),
+ name: Yup.string().required(),
+ namespace: Yup.string().required(),
+ chartRepo: Yup.object({
+ name: Yup.string(),
+ url: Yup.string(),
+ }),
+ })
+ : Yup.object({
+ displayName: Yup.string().required(),
+ name: Yup.string().required(),
+ namespace: Yup.string().required(),
+ chartRepo: Yup.object({
+ name: Yup.string(),
+ url: Yup.string(),
+ }),
+ }),
+
+ onSubmit: async (val) => {
+ console.log('yamlvalue', yaml.load(val.values, { json: true }));
+ if (!cluster) {
+ throw new Error('Cluster is required.');
+ }
+ try {
+ const { errors } = await api.createHelmChart({
+ clusterName: cluster || '',
+ release: {
+ displayName: val.displayName,
+ metadata: {
+ name: val.name,
+ },
+ spec: {
+ chartName: val.chartName,
+ chartVersion: val.chartVersion,
+ chartRepo: val.chartRepo,
+ values: yaml.load(val.values, { json: true }),
+ },
+ },
+ });
+
+ if (errors) {
+ throw errors[0];
+ }
+ reloadPage();
+ setVisible(false);
+ resetValues();
+ } catch (error) {
+ handleError(error);
+ }
+ },
+ });
+
+ useDebounce(() => repoUrlChanges(values.chartRepo.url), 300, [
+ values.chartRepo.url,
+ ]);
+
+ return (
+
+
+
+
+ {isUpdate && (
+
+ )}
+ {!isUpdate && (
+ {
+ handleChange('name')({ target: { value: id } });
+ }}
+ />
+ )}
+ {
+ handleChange('namespace')(dummyEvent(target.value));
+ }}
+ error={!!errors.namespace}
+ message={errors.namespace}
+ value={values.namespace}
+ name="helm-chart-namespace"
+ />
+ {
+ handleChange('chartRepo.url')(dummyEvent(target.value));
+ setRepoNamesLoading(true);
+ }}
+ error={!!errors.chartRepo}
+ message={errors.chartRepo}
+ value={values.chartRepo.url}
+ name="helm-chart-repo-url"
+ />
+
+
+
+
+
+
+
+ );
+};
+
+const HandleHelmChart = (props: IDialog) => {
+ const { isUpdate, setVisible, visible } = props;
+
+ return (
+ setVisible(v)}>
+
+ {isUpdate ? 'Edit helm chart' : 'Add new helm chart'}
+
+ {(!isUpdate || (isUpdate && props.data)) && }
+
+ );
+};
+
+export default HandleHelmChart;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/helm-chart-resources.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/helm-chart-resources.tsx
new file mode 100644
index 000000000..872d9858b
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/helm-chart-resources.tsx
@@ -0,0 +1,204 @@
+import { Trash } from '@jengaicons/react';
+import { generateKey, titleCase } from '~/components/utils';
+import {
+ ListItem,
+ ListTitle,
+} from '~/console/components/console-list-components';
+import Grid from '~/console/components/grid';
+import List from '~/console/components/list';
+import ListGridView from '~/console/components/list-grid-view';
+import {
+ ExtractNodeType,
+ parseName,
+ parseUpdateOrCreatedBy,
+ parseUpdateOrCreatedOn,
+} from '~/console/server/r-utils/common';
+import DeleteDialog from '~/console/components/delete-dialog';
+import ResourceExtraAction from '~/console/components/resource-extra-action';
+import { useConsoleApi } from '~/console/server/gql/api-provider';
+import { useReload } from '~/root/lib/client/helpers/reloader';
+import { useState } from 'react';
+import { handleError } from '~/root/lib/utils/common';
+import { toast } from '~/components/molecule/toast';
+import { useParams } from '@remix-run/react';
+import { IHelmCharts } from '~/console/server/gql/queries/helm-chart-queries';
+
+const RESOURCE_NAME = 'managed service';
+type BaseType = ExtractNodeType;
+
+const parseItem = (item: BaseType) => {
+ return {
+ name: item?.displayName,
+ id: parseName(item),
+ updateInfo: {
+ author: `Updated by ${titleCase(parseUpdateOrCreatedBy(item))}`,
+ time: parseUpdateOrCreatedOn(item),
+ },
+ };
+};
+
+type OnAction = ({
+ action,
+ item,
+}: {
+ action: 'delete';
+ item: BaseType;
+}) => void;
+
+type IExtraButton = {
+ onAction: OnAction;
+ item: BaseType;
+};
+
+const ExtraButton = ({ onAction, item }: IExtraButton) => {
+ return (
+ ,
+ type: 'item',
+ onClick: () => onAction({ action: 'delete', item }),
+ key: 'delete',
+ className: '!text-text-critical',
+ },
+ ]}
+ />
+ );
+};
+
+interface IResource {
+ items: BaseType[];
+ onAction: OnAction;
+}
+
+const GridView = ({ items = [], onAction }: IResource) => {
+ return (
+
+ {items.map((item, index) => {
+ const { name, id, updateInfo } = parseItem(item);
+ const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
+ return (
+ (
+ }
+ />
+ ),
+ },
+ {
+ key: generateKey(keyPrefix, 'author'),
+ render: () => (
+
+ ),
+ },
+ ]}
+ />
+ );
+ })}
+
+ );
+};
+
+const ListView = ({ items = [], onAction }: IResource) => {
+ return (
+
+ {items.map((item, index) => {
+ const { name, id, updateInfo } = parseItem(item);
+ const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
+
+ return (
+ ,
+ },
+ {
+ key: generateKey(keyPrefix, 'author'),
+ className: 'w-[180px]',
+ render: () => (
+
+ ),
+ },
+ {
+ key: generateKey(keyPrefix, 'action'),
+ render: () => ,
+ },
+ ]}
+ />
+ );
+ })}
+
+ );
+};
+
+const HelmChartResources = ({ items = [] }: { items: BaseType[] }) => {
+ const [showDeleteDialog, setShowDeleteDialog] = useState(
+ null
+ );
+ const api = useConsoleApi();
+ const reloadPage = useReload();
+ const params = useParams();
+
+ const props: IResource = {
+ items,
+ onAction: ({ action, item }) => {
+ switch (action) {
+ case 'delete':
+ setShowDeleteDialog(item);
+ break;
+ default:
+ break;
+ }
+ },
+ };
+ return (
+ <>
+ }
+ gridView={}
+ />
+ {
+ try {
+ const { errors } = await api.deleteClusterMSv({
+ serviceName: parseName(showDeleteDialog),
+ clusterName: params.cluster || '',
+ });
+
+ if (errors) {
+ throw errors[0];
+ }
+ reloadPage();
+ toast.success(`${titleCase(RESOURCE_NAME)} deleted successfully`);
+ setShowDeleteDialog(null);
+ } catch (err) {
+ handleError(err);
+ }
+ }}
+ />
+ >
+ );
+};
+
+export default HelmChartResources;
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/tools.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/tools.tsx
similarity index 90%
rename from src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/tools.tsx
rename to src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/tools.tsx
index b7a29e20a..263c9bd9c 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/backing-services/tools.tsx
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/helm-chart/tools.tsx
@@ -1,7 +1,6 @@
import { useMemo } from 'react';
import { useSearchParams } from '@remix-run/react';
import CommonTools, { IModeProps } from '~/console/components/common-tools';
-import { toast } from 'react-toastify';
const Tools = ({ viewMode, setViewMode }: IModeProps) => {
const [searchParams] = useSearchParams();
@@ -13,7 +12,6 @@ const Tools = ({ viewMode, setViewMode }: IModeProps) => {
type: 'text',
search: false,
dataFetcher: async () => {
- toast.info(`todo status`);
return [
{ content: 'Active', value: 'active' },
{ content: 'Freezed', value: 'freezed' },
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/backend-services-resources.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/backend-services-resources.tsx
new file mode 100644
index 000000000..1fd3bf941
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/backend-services-resources.tsx
@@ -0,0 +1,233 @@
+import { Trash } from '@jengaicons/react';
+import { generateKey, titleCase } from '~/components/utils';
+import {
+ ListItem,
+ ListTitle,
+} from '~/console/components/console-list-components';
+import Grid from '~/console/components/grid';
+import List from '~/console/components/list';
+import ListGridView from '~/console/components/list-grid-view';
+import { IClusterMSvs } from '~/console/server/gql/queries/cluster-managed-services-queries';
+import {
+ ExtractNodeType,
+ parseName,
+ parseUpdateOrCreatedBy,
+ parseUpdateOrCreatedOn,
+} from '~/console/server/r-utils/common';
+import { IMSvTemplates } from '~/console/server/gql/queries/managed-templates-queries';
+import { getManagedTemplate } from '~/console/utils/commons';
+import DeleteDialog from '~/console/components/delete-dialog';
+import ResourceExtraAction from '~/console/components/resource-extra-action';
+import { useConsoleApi } from '~/console/server/gql/api-provider';
+import { useReload } from '~/root/lib/client/helpers/reloader';
+import { useState } from 'react';
+import { handleError } from '~/root/lib/utils/common';
+import { toast } from '~/components/molecule/toast';
+import { useParams } from '@remix-run/react';
+
+const RESOURCE_NAME = 'managed service';
+type BaseType = ExtractNodeType;
+
+const parseItem = (item: BaseType, templates: IMSvTemplates) => {
+ const template = getManagedTemplate({
+ templates,
+ kind: item.spec?.msvcSpec?.serviceTemplate.kind || '',
+ apiVersion: item.spec?.msvcSpec?.serviceTemplate.apiVersion || '',
+ });
+ return {
+ name: item?.displayName,
+ id: parseName(item),
+ updateInfo: {
+ author: `Updated by ${titleCase(parseUpdateOrCreatedBy(item))}`,
+ time: parseUpdateOrCreatedOn(item),
+ },
+ logo: template?.logoUrl,
+ };
+};
+
+type OnAction = ({
+ action,
+ item,
+}: {
+ action: 'delete';
+ item: BaseType;
+}) => void;
+
+type IExtraButton = {
+ onAction: OnAction;
+ item: BaseType;
+};
+
+const ExtraButton = ({ onAction, item }: IExtraButton) => {
+ return (
+ ,
+ type: 'item',
+ onClick: () => onAction({ action: 'delete', item }),
+ key: 'delete',
+ className: '!text-text-critical',
+ },
+ ]}
+ />
+ );
+};
+
+interface IResource {
+ items: BaseType[];
+ templates: IMSvTemplates;
+ onAction: OnAction;
+}
+
+const GridView = ({ items = [], templates = [], onAction }: IResource) => {
+ return (
+
+ {items.map((item, index) => {
+ const { name, id, logo, updateInfo } = parseItem(item, templates);
+ const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
+ return (
+ (
+ }
+ avatar={
+
+ }
+ />
+ ),
+ },
+ {
+ key: generateKey(keyPrefix, 'author'),
+ render: () => (
+
+ ),
+ },
+ ]}
+ />
+ );
+ })}
+
+ );
+};
+
+const ListView = ({ items = [], templates = [], onAction }: IResource) => {
+ return (
+
+ {items.map((item, index) => {
+ const { name, id, logo, updateInfo } = parseItem(item, templates);
+ const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
+
+ return (
+ (
+
+
+
+ }
+ />
+ ),
+ },
+ {
+ key: generateKey(keyPrefix, 'author'),
+ className: 'w-[180px]',
+ render: () => (
+
+ ),
+ },
+ {
+ key: generateKey(keyPrefix, 'action'),
+ render: () => ,
+ },
+ ]}
+ />
+ );
+ })}
+
+ );
+};
+
+const BackendServicesResources = ({
+ items = [],
+ templates = [],
+}: {
+ items: BaseType[];
+ templates: IMSvTemplates;
+}) => {
+ const [showDeleteDialog, setShowDeleteDialog] = useState(
+ null
+ );
+ const api = useConsoleApi();
+ const reloadPage = useReload();
+ const params = useParams();
+
+ const props: IResource = {
+ items,
+ templates,
+ onAction: ({ action, item }) => {
+ switch (action) {
+ case 'delete':
+ setShowDeleteDialog(item);
+ break;
+ default:
+ break;
+ }
+ },
+ };
+ return (
+ <>
+ }
+ gridView={}
+ />
+ {
+ try {
+ const { errors } = await api.deleteClusterMSv({
+ serviceName: parseName(showDeleteDialog),
+ clusterName: params.cluster || '',
+ });
+
+ if (errors) {
+ throw errors[0];
+ }
+ reloadPage();
+ toast.success(`${titleCase(RESOURCE_NAME)} deleted successfully`);
+ setShowDeleteDialog(null);
+ } catch (err) {
+ handleError(err);
+ }
+ }}
+ />
+ >
+ );
+};
+
+export default BackendServicesResources;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/handle-backend-service.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/handle-backend-service.tsx
new file mode 100644
index 000000000..22c12894e
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/handle-backend-service.tsx
@@ -0,0 +1,628 @@
+/* eslint-disable guard-for-in */
+/* eslint-disable react/destructuring-assignment */
+import { ArrowRight, Search, Check } from '@jengaicons/react';
+import { useParams } from '@remix-run/react';
+import { useEffect, useState } from 'react';
+import ActionList from '~/components/atoms/action-list';
+import { NumberInput, TextInput } from '~/components/atoms/input';
+import Popup from '~/components/molecule/popup';
+import { toast } from '~/components/molecule/toast';
+import { ListTitle } from '~/console/components/console-list-components';
+import { IdSelector } from '~/console/components/id-selector';
+import List from '~/console/components/list';
+import NoResultsFound from '~/console/components/no-results-found';
+import { IDialogBase } from '~/console/components/types.d';
+import { useConsoleApi } from '~/console/server/gql/api-provider';
+import { IClusterMSvs } from '~/console/server/gql/queries/cluster-managed-services-queries';
+import { ExtractNodeType } from '~/console/server/r-utils/common';
+import { useReload } from '~/root/lib/client/helpers/reloader';
+import { useInputSearch } from '~/root/lib/client/helpers/search-filter';
+import useForm, { dummyEvent } from '~/root/lib/client/hooks/use-form';
+import Yup from '~/root/lib/server/helpers/yup';
+import { NN } from '~/root/lib/types/common';
+import { handleError } from '~/root/lib/utils/common';
+import { IMSvTemplates } from '~/console/server/gql/queries/managed-templates-queries';
+import { Switch } from '~/components/atoms/switch';
+import { cn } from '~/components/utils';
+
+type IDialog = IDialogBase> & {
+ templates: IMSvTemplates;
+};
+
+type IActiveCategory = {
+ name: string;
+ displayName: string;
+} | null;
+
+type ISelectedService = {
+ category: {
+ name: string;
+ displayName: string;
+ };
+
+ service: NN[number]['items'][number];
+} | null;
+
+const ServicePicker = ({
+ activeCategory,
+ setActiveCategory,
+ templates,
+ selectedService,
+ setSelectedService,
+}: {
+ activeCategory: IActiveCategory;
+ setActiveCategory: React.Dispatch;
+ templates: IMSvTemplates;
+ selectedService: ISelectedService;
+ setSelectedService: React.Dispatch;
+}) => {
+ const [searchProps, searchResults] = useInputSearch(
+ {
+ data:
+ templates?.find((t) => t.category === activeCategory?.name)?.items ||
+ [],
+ keys: ['name'],
+ reverse: false,
+ threshold: 0.4,
+ },
+ [activeCategory]
+ );
+ return (
+
+
+
{
+ setActiveCategory({
+ name: v,
+ displayName:
+ templates?.find((t) => t.category === v)?.displayName || '',
+ });
+ }}
+ >
+ {templates?.map((t, index) => {
+ if (!activeCategory && index === 0) {
+ setActiveCategory({
+ name: t.category,
+ displayName: t.displayName,
+ });
+ }
+ return (
+
+ {t.displayName}
+
+ );
+ })}
+
+
+
+
}
+ placeholder="Search"
+ />
+ {templates?.find((t) => t.category === activeCategory?.name)?.items
+ .length === 0 ? (
+
}
+ subtitle="No Services Available now"
+ />
+ ) : (
+
+ {searchResults.map((item) => {
+ return (
+ {
+ if (!item.apiVersion) {
+ toast.error('not available now');
+ return;
+ }
+ if (activeCategory) {
+ setSelectedService({
+ category: activeCategory,
+ service: item,
+ });
+ }
+ }}
+ columns={[
+ {
+ key: item.name,
+ className: 'flex-grow',
+ render: () => (
+
+ }
+ title={
+ {item.displayName}
+ }
+ />
+ ),
+ },
+ {
+ key: `${item.name}-arrow`,
+ render: () =>
+ selectedService?.service.name === item.name ? (
+
+ ) : (
+
+ ),
+ },
+ ]}
+ />
+ );
+ })}
+
+ )}
+
+ {/*
+ {searchResults.map((item) => {
+ return (
+ {
+ if (!item.apiVersion) {
+ toast.error('not available now');
+ return;
+ }
+ if (activeCategory) {
+ setSelectedService({
+ category: activeCategory,
+ service: item,
+ });
+ }
+ }}
+ key={item.name}
+ className={cn({
+ '!bg-surface-basic-active':
+ item.name === selectedService?.service.name,
+ 'opacity-50 cursor-not-allowed': !item.apiVersion,
+ })}
+ rows={[
+ {
+ key: `${item.name}first`,
+ render() {
+ return (
+
+
+
+
+
+ {item.displayName}
+
+
+
+ );
+ },
+ },
+ ]}
+ />
+ );
+ })}
+ */}
+
+
+ );
+};
+
+const RenderField = ({
+ field,
+ value,
+ onChange,
+ error,
+ message,
+}: {
+ field: NN['service']['fields'][number];
+ onChange: (e: string) => (e: { target: { value: any } }) => void;
+ value: any;
+ error: boolean;
+ message?: string;
+}) => {
+ console.log('value', value);
+
+ const [qos, setQos] = useState(false);
+ if (field.inputType === 'Number') {
+ return (
+ {
+ onChange(`${field.name}`)(
+ dummyEvent(
+ `${parseFloat(target.value) * (field.multiplier || 1)}${
+ field.unit
+ }`
+ )
+ );
+ }}
+ suffix={field.displayUnit}
+ />
+ );
+ }
+
+ if (field.inputType === 'String') {
+ return (
+
+ );
+ }
+ if (field.inputType === 'Resource') {
+ return (
+
+
{`${field.label}${
+ field.required ? ' *' : ''
+ }`}
+
+
+
+ {
+ onChange(`${field.name}.min`)(
+ dummyEvent(
+ `${parseFloat(target.value) * (field.multiplier || 1)}${
+ field.unit
+ }`
+ )
+ );
+ if (qos) {
+ onChange(`${field.name}.max`)(
+ dummyEvent(
+ `${parseFloat(target.value) * (field.multiplier || 1)}${
+ field.unit
+ }`
+ )
+ );
+ }
+ }}
+ suffix={field.displayUnit}
+ />
+
+ {!qos && (
+
+ {
+ onChange(`${field.name}.max`)(
+ dummyEvent(
+ `${parseFloat(target.value) * (field.multiplier || 1)}${
+ field.unit
+ }`
+ )
+ );
+ }}
+ suffix={field.displayUnit}
+ />
+
+ )}
+
+
+ {
+ setQos(_value);
+ if (_value) {
+ onChange(`${field.name}.max`)(dummyEvent(`${value.min}`));
+ }
+ }}
+ />
+
+
+
+ );
+ }
+ return unknown input type {field.inputType}
;
+};
+
+const Fill = ({
+ selectedService,
+ values,
+ handleChange,
+ errors,
+}: {
+ selectedService: ISelectedService;
+ values: { [key: string]: any };
+ handleChange: (key: string) => (e: { target: { value: any } }) => void;
+ errors: {
+ [key: string]: string | undefined;
+ };
+}) => {
+ console.log('values: ', values);
+
+ return (
+
+
+ {
+ handleChange('name')(dummyEvent(v));
+ }}
+ />
+ {selectedService?.service.fields.map((field) => {
+ const k = field.name;
+ const x = k.split('.').reduce((acc, curr) => {
+ if (!acc) {
+ return values[curr];
+ }
+ return acc[curr];
+ }, null);
+
+ return (
+
+ );
+ })}
+
+ );
+};
+
+const flatM = (obj) => {
+ const flatJson = {};
+ for (const key in obj) {
+ const parts = key.split('.');
+ let temp = flatJson;
+
+ parts.forEach((part, index) => {
+ if (index === parts.length - 1) {
+ temp[part] = {
+ min: null,
+ max: null,
+ };
+ } else {
+ temp[part] = temp[part] || {};
+ }
+ temp = temp[part];
+ });
+ }
+ console.log('flatjson ', flatJson);
+
+ return flatJson;
+};
+
+const Root = (props: IDialog) => {
+ const { isUpdate, setVisible, templates } = props;
+ const [activeCategory, setActiveCategory] = useState(null);
+ const [selectedService, setSelectedService] =
+ useState(null);
+
+ const api = useConsoleApi();
+ const reload = useReload();
+
+ const { cluster } = useParams();
+ const [step, setStep] = useState<'choose' | 'fill'>('choose');
+
+ console.log(selectedService);
+
+ const {
+ values,
+ errors,
+ handleChange,
+ handleSubmit,
+ resetValues,
+ isLoading,
+ setValues,
+ } = useForm({
+ initialValues: {
+ name: '',
+ displayName: '',
+ },
+ validationSchema: Yup.object({}),
+ onSubmit: async (val) => {
+ const tempVal = { ...val };
+ delete tempVal.name;
+ delete tempVal.displayName;
+
+ try {
+ if (!cluster) {
+ throw new Error('Cluster not found.');
+ }
+ if (
+ !selectedService?.service.apiVersion ||
+ !selectedService.service.kind
+ ) {
+ throw new Error('Service apiversion or kind error.');
+ }
+ const { errors: e } = await api.createClusterMSv({
+ clusterName: cluster,
+ service: {
+ displayName: val.displayName,
+ metadata: {
+ name: val.name,
+ },
+
+ spec: {
+ msvcSpec: {
+ serviceTemplate: {
+ apiVersion: selectedService.service.apiVersion,
+ kind: selectedService.service.kind,
+ spec: {
+ ...tempVal,
+ },
+ },
+ },
+ namespace: '',
+ },
+ },
+ });
+ if (e) {
+ throw e[0];
+ }
+ setVisible(false);
+ reload();
+ } catch (err) {
+ handleError(err);
+ }
+ },
+ });
+
+ useEffect(() => {
+ if (selectedService?.service.fields) {
+ setValues({
+ name: '',
+ displayName: '',
+ ...flatM(
+ selectedService?.service.fields.reduce((acc, curr) => {
+ return { ...acc, [curr.name]: curr.defaultValue };
+ }, {})
+ ),
+ });
+ }
+ }, [selectedService]);
+
+ return (
+ //
+ // {step === 'choose' ? (
+ // Choose a service
+ // ) : (
+ //
+ //
+ //
}
+ // size="xs"
+ // variant="plain"
+ // onClick={() => {
+ // resetValues({});
+ // setStep('choose');
+ // }}
+ // />
+ //
+ //
+ //
{selectedService?.service.displayName}
+ //
+ // )}
+ //
+ {
+ if (step === 'choose') {
+ setStep('fill');
+ e.preventDefault();
+ } else handleSubmit(e);
+ }}
+ >
+
+ {step === 'choose' ? (
+
+ ) : (
+
+ )}
+
+
+ {step === 'fill' ? (
+ {
+ resetValues({});
+ setSelectedService(null);
+ setStep('choose');
+ }}
+ content="Back"
+ />
+ ) : null}
+
+
+
+ );
+};
+
+const HandleBackendService = (props: IDialog) => {
+ const { isUpdate, setVisible, visible } = props;
+ return (
+ setVisible(v)}
+ >
+
+ {isUpdate ? 'Edit cloud provider' : 'Add new cloud provider'}
+
+ {(!isUpdate || (isUpdate && props.data)) && }
+
+ );
+};
+
+export default HandleBackendService;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/route.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/route.tsx
new file mode 100644
index 000000000..574865016
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/route.tsx
@@ -0,0 +1,124 @@
+import { Plus, PlusFill } from '@jengaicons/react';
+import { defer } from '@remix-run/node';
+import { useLoaderData } from '@remix-run/react';
+import { Dispatch, SetStateAction, useEffect, useState } from 'react';
+import { Button } from '~/components/atoms/button.jsx';
+import { LoadingComp, pWrapper } from '~/console/components/loading-component';
+import Wrapper from '~/console/components/wrapper';
+import { GQLServerHandler } from '~/console/server/gql/saved-queries';
+import { parseNodes } from '~/console/server/r-utils/common';
+import { IRemixCtx } from '~/root/lib/types/common';
+import fake from '~/root/fake-data-generator/fake';
+import { IMSvTemplates } from '~/console/server/gql/queries/managed-templates-queries';
+import Tools from './tools';
+import HandleBackendService from './handle-backend-service';
+import BackendServicesResources from './backend-services-resources';
+
+export const loader = (ctx: IRemixCtx) => {
+ const { cluster } = ctx.params;
+ const promise = pWrapper(async () => {
+ const { data: mData, errors: mErrors } = await GQLServerHandler(
+ ctx.request
+ ).listClusterMSvs({
+ clusterName: cluster,
+ });
+
+ const { data: msvTemplates, errors: msvError } = await GQLServerHandler(
+ ctx.request
+ ).listMSvTemplates({});
+
+ if (mErrors) {
+ throw mErrors[0];
+ }
+
+ if (msvError) {
+ throw msvError[0];
+ }
+
+ return { managedServices: mData, templates: msvTemplates };
+ });
+ return defer({ promise });
+};
+
+const SetValue = ({
+ templates,
+ setTemplate,
+}: {
+ templates: IMSvTemplates;
+ setTemplate: Dispatch>;
+}) => {
+ useEffect(() => {
+ setTemplate(templates);
+ }, []);
+ return null;
+};
+
+const KlOperatorServices = () => {
+ const [visible, setVisible] = useState(false);
+ const { promise } = useLoaderData();
+ const [templates, setTemplates] = useState(null);
+
+ return (
+ <>
+
+ {({ managedServices, templates: templatesData }) => {
+ const backendServices = parseNodes(managedServices);
+
+ return (
+ <>
+
+ 0 && (
+ }
+ onClick={() => {
+ setVisible(true);
+ }}
+ />
+ ),
+ }}
+ empty={{
+ is: backendServices.length === 0,
+ title: 'This is where you’ll manage your Managed services.',
+ content: (
+
+ You can create a new backing service and manage the listed
+ backing service.
+
+ ),
+ action: {
+ content: 'Create new managed service',
+ prefix: ,
+ onClick: () => {
+ setVisible(true);
+ },
+ },
+ }}
+ tools={}
+ >
+
+
+ >
+ );
+ }}
+
+
+ >
+ );
+};
+
+export default KlOperatorServices;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/tools.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/tools.tsx
new file mode 100644
index 000000000..263c9bd9c
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/managedservices+/kl-operator-services/tools.tsx
@@ -0,0 +1,29 @@
+import { useMemo } from 'react';
+import { useSearchParams } from '@remix-run/react';
+import CommonTools, { IModeProps } from '~/console/components/common-tools';
+
+const Tools = ({ viewMode, setViewMode }: IModeProps) => {
+ const [searchParams] = useSearchParams();
+
+ const options = useMemo(
+ () => [
+ {
+ name: 'Status',
+ type: 'text',
+ search: false,
+ dataFetcher: async () => {
+ return [
+ { content: 'Active', value: 'active' },
+ { content: 'Freezed', value: 'freezed' },
+ { content: 'Archived', value: 'archived' },
+ ];
+ },
+ },
+ ],
+ [searchParams]
+ );
+
+ return ;
+};
+
+export default Tools;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/_layout.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/_layout.tsx
index 770e6ab03..0b344e0f9 100644
--- a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/_layout.tsx
@@ -1,21 +1,9 @@
import { Outlet, useOutletContext } from '@remix-run/react';
import { IClusterContext } from '../_layout';
-import SidebarLayout from '~/console/components/sidebar-layout';
const ContainerRegistry = () => {
const rootContext = useOutletContext();
- return (
-
-
-
- );
+ return ;
};
export default ContainerRegistry;
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/handle-devices.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/handle-devices.tsx
index 68fb7707c..86a99926f 100644
--- a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/handle-devices.tsx
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/handle-devices.tsx
@@ -41,10 +41,8 @@ import { LoadingPlaceHolder } from '~/console/components/loading';
import { downloadFile } from '~/console/utils/commons';
import CodeView from '~/console/components/code-view';
import { InfoLabel } from '~/console/components/commons';
-import { IAccountContext } from '../../../../_layout';
import { parseValue } from '~/console/page-components/util';
-
-
+import { IAccountContext } from '../../../../_layout';
interface IExposedPorts {
targetPort?: number;
@@ -433,8 +431,6 @@ const Root = (props: IDialog) => {
namespace: ENV_NAMESPACE,
},
spec: {
- accountName: parseName(account),
- clusterName: ensureResource(cluster),
ports: val.ports,
},
},
@@ -452,8 +448,6 @@ const Root = (props: IDialog) => {
namespace: ENV_NAMESPACE,
},
spec: {
- accountName: parseName(account),
- clusterName: ensureResource(cluster),
ports: val.ports,
},
},
diff --git a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/route.tsx b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/route.tsx
index c79a32be9..e1f1d44d8 100644
--- a/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/infra+/$cluster+/network+/vpn/route.tsx
@@ -55,7 +55,7 @@ const VPN = () => {
const devices = devicesData.edges?.map(({ node }) => node);
return (
0 && (
+ ),
+ }}
+ tools={}
+ >
+
+
);
}}
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/_layout.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/_layout.tsx
deleted file mode 100644
index c8176a967..000000000
--- a/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/_layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Outlet, useOutletContext } from '@remix-run/react';
-
-const Builds = () => {
- const rootContext = useOutletContext();
- return ;
-};
-
-export default Builds;
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/build-resources.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/build-resources.tsx
index f6cc59a23..293464998 100644
--- a/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/build-resources.tsx
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/builds/build-resources.tsx
@@ -123,14 +123,13 @@ const GridView = ({ items, onDelete, onEdit }: IResource) => {
const ListView = ({ items, onDelete, onEdit }: IResource) => {
return (
-
+
{items.map((item, index) => {
const { name, id, status, updateInfo, cluster } = parseItem(item);
const keyPrefix = `${RESOURCE_NAME}-${id}-${index}`;
return (
>,
- itemObject: Record
- ): void;
- value?: Array>;
- label?: ReactNode;
- message?: ReactNode;
- error?: boolean;
-}
-export const KeyValuePair = ({
- onChange,
- value = [],
- label,
- message,
- error,
-}: IKeyValuePair) => {
- const newItem = [{ key: '', value: '', id: uuid() }];
- const [items, setItems] = useState>>(newItem);
-
- const handleChange = (_value = '', id = '', target = {}) => {
- setItems(
- items.map((i) => {
- if (i.id === id) {
- switch (target) {
- case 'key':
- return { ...i, key: _value };
- case 'value':
- default:
- return { ...i, value: _value };
- }
- }
- return i;
- })
- );
- };
-
- useEffect(() => {
- const formatItems = items.reduce((acc, curr) => {
- if (curr.key && curr.value) {
- acc[curr.key] = curr.value;
- }
- return acc;
- }, {});
- if (onChange) onChange(Array.from(items), formatItems);
- }, [items]);
-
- useEffect(() => {
- if (value.length > 0) {
- setItems(Array.from(value).map((v) => ({ ...v, id: uuid() })));
- }
- }, []);
-
- return (
-
-
-
- {label && (
-
{label}
- )}
- {items.map((item) => (
-
-
-
- handleChange(target.value, item.id, 'key')
- }
- />
-
-
-
- handleChange(target.value, item.id, 'value')
- }
- />
-
-
}
- variant="plain"
- disabled={items.length < 2}
- onClick={() => {
- setItems(items.filter((i) => i.id !== item.id));
- }}
- />
-
- ))}
-
-
-
- {message}
-
-
-
- {
- setItems([...items, { ...newItem[0], id: uuid() }]);
- }}
- />
-
-
-
- );
-};
+import KeyValuePair from '~/console/components/key-value-pair';
interface ISource {
repo: string;
@@ -311,24 +190,24 @@ const Root = (props: IDialog) => {
.test('is-valid', 'Tags is required', (value) => {
return value.length > 0;
}),
- buildArgs: Yup.object().when('advanceOptions', {
- is: true,
- then: (schema) =>
- schema
- .required()
- .test('is-valid', 'Build args is required', (value) => {
- return Object.keys(value).length > 0;
- }),
- }),
- buildContexts: Yup.object().when('advanceOptions', {
- is: true,
- then: (schema) =>
- schema
- .required()
- .test('is-valid', 'Build contexts is required', (value) => {
- return Object.keys(value).length > 0;
- }),
- }),
+ // buildArgs: Yup.object().when('advanceOptions', {
+ // is: true,
+ // then: (schema) =>
+ // schema
+ // .required()
+ // .test('is-valid', 'Build args is required', (value) => {
+ // return Object.keys(value).length > 0;
+ // }),
+ // }),
+ // buildContexts: Yup.object().when('advanceOptions', {
+ // is: true,
+ // then: (schema) =>
+ // schema
+ // .required()
+ // .test('is-valid', 'Build contexts is required', (value) => {
+ // return Object.keys(value).length > 0;
+ // }),
+ // }),
}),
onSubmit: async (val) => {
if (source) {
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/images/route.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/images/route.tsx
index 9ea5d8461..6383e9695 100644
--- a/src/apps/console/routes/_main+/$account+/repo+/$repo+/images/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/images/route.tsx
@@ -7,6 +7,7 @@ import { ensureAccountSet } from '~/console/server/utils/auth-utils';
import { getPagination, getSearch } from '~/console/server/utils/common';
import logger from '~/root/lib/client/helpers/log';
import { IRemixCtx } from '~/root/lib/types/common';
+import SecondarySubHeader from '~/console/components/secondary-sub-header';
import TagsResources from './tags-resources';
import Tools from './tools';
@@ -41,6 +42,9 @@ const Images = () => {
return (
- {tag}
+ }>
+ {tag}
+
))}
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/_index.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/_index.tsx
new file mode 100644
index 000000000..e1e200e2d
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/_index.tsx
@@ -0,0 +1,5 @@
+import { redirect } from '@remix-run/node';
+
+export const loader = async () => {
+ return redirect('general');
+};
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/build-caches-resources.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/build-caches-resources.tsx
similarity index 100%
rename from src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/build-caches-resources.tsx
rename to src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/build-caches-resources.tsx
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/handle-build-cache.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/handle-build-cache.tsx
similarity index 100%
rename from src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/handle-build-cache.tsx
rename to src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/handle-build-cache.tsx
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/route.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/route.tsx
similarity index 79%
rename from src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/route.tsx
rename to src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/route.tsx
index a1dce33e8..08cda8462 100644
--- a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/route.tsx
@@ -12,6 +12,7 @@ import { getPagination, getSearch } from '~/console/server/utils/common';
import logger from '~/root/lib/client/helpers/log';
import { IRemixCtx } from '~/root/lib/types/common';
import { Plus } from '@jengaicons/react';
+import SecondarySubHeader from '~/console/components/secondary-sub-header';
import Tools from './tools';
import BuildCachesResources from './build-caches-resources';
import HandleBuildCache from './handle-build-cache';
@@ -38,24 +39,6 @@ export const loader = async (ctx: IRemixCtx) => {
return defer({ promise });
};
-const Tabs = () => {
- const { account } = useParams();
- return (
-
- );
-};
-
-export const handle = () => {
- return {
- navbar: ,
- };
-};
-
const Builds = () => {
const [visible, setVisible] = useState(false);
const { promise } = useLoaderData();
@@ -66,18 +49,21 @@ const Builds = () => {
const buildsCaches = buildCachesData.edges?.map(({ node }) => node);
return (
- <>
- {buildsCaches.length > 0 && (
-
- {
- setVisible(true);
- }}
- />
-
- )}
+
+ 0 && (
+ {
+ setVisible(true);
+ }}
+ />
+ )
+ }
+ />
{
>
- >
+
);
}}
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/tools.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/tools.tsx
similarity index 100%
rename from src/apps/console/routes/_main+/$account+/repo+/$repo+/buildcaches/tools.tsx
rename to src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/buildcaches/tools.tsx
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/general/route.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/general/route.tsx
new file mode 100644
index 000000000..7cc4ed6a2
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/general/route.tsx
@@ -0,0 +1,115 @@
+import { CopySimple } from '@jengaicons/react';
+import { useNavigate, useParams } from '@remix-run/react';
+import { useState } from 'react';
+import { TextInput } from '~/components/atoms/input';
+import { toast } from '~/components/molecule/toast';
+import {
+ Box,
+ DeleteContainer,
+} from '~/console/components/common-console-components';
+import DeleteDialog from '~/console/components/delete-dialog';
+import { useConsoleApi } from '~/console/server/gql/api-provider';
+import useClipboard from '~/root/lib/client/hooks/use-clipboard';
+import { consoleBaseUrl } from '~/root/lib/configs/base-url.cjs';
+import { handleError } from '~/root/lib/utils/common';
+
+const ProjectSettingGeneral = () => {
+ const { repo = '', account } = useParams();
+ const api = useConsoleApi();
+ const navigate = useNavigate();
+ const [deleteRepo, setDeleteRepo] = useState(false);
+
+ const { copy } = useClipboard({
+ onSuccess() {
+ toast.success('Text copied to clipboard.');
+ },
+ });
+
+ return (
+ <>
+
+
+
+
+
+
+ copy(`${consoleBaseUrl}/${account}/repo/${repo}}`)
+ }
+ className="outline-none hover:bg-surface-basic-hovered active:bg-surface-basic-active rounded text-text-default"
+ tabIndex={-1}
+ >
+
+
+
+ }
+ />
+
+
+
+ copy(repo)}
+ className="outline-none hover:bg-surface-basic-hovered active:bg-surface-basic-active rounded text-text-default"
+ tabIndex={-1}
+ >
+
+
+
+ }
+ disabled
+ />
+
+
+
+ {
+ setDeleteRepo(true);
+ }}
+ >
+ Permanently remove your Repo and all of its contents from the Kloudlite
+ platform. This action is not reversible — please continue with caution.
+
+ {
+ try {
+ const { errors } = await api.deleteRepo({
+ name: repo,
+ });
+
+ if (errors) {
+ throw errors[0];
+ }
+ toast.success(`Repo deleted successfully`);
+ setDeleteRepo(false);
+ navigate(`/${account}/packages`);
+ } catch (err) {
+ handleError(err);
+ }
+ }}
+ />
+ >
+ );
+};
+export default ProjectSettingGeneral;
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/route.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/route.tsx
new file mode 100644
index 000000000..5475e8cec
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/settings/route.tsx
@@ -0,0 +1,19 @@
+import { Outlet, useOutletContext } from '@remix-run/react';
+import SidebarLayout from '~/console/components/sidebar-layout';
+
+const Settings = () => {
+ const rootContext = useOutletContext();
+ return (
+
+
+
+ );
+};
+
+export default Settings;
diff --git a/src/apps/console/routes/_main+/$account+/settings+/cloud-providers/route.tsx b/src/apps/console/routes/_main+/$account+/settings+/cloud-providers/route.tsx
index 14b726160..e626d3b0f 100644
--- a/src/apps/console/routes/_main+/$account+/settings+/cloud-providers/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/settings+/cloud-providers/route.tsx
@@ -11,11 +11,10 @@ import { IRemixCtx } from '~/root/lib/types/common';
import fake from '~/root/fake-data-generator/fake';
import { useState } from 'react';
-
+import { GQLServerHandler } from '~/console/server/gql/saved-queries';
import HandleProvider from './handle-provider';
import ProviderResources from './provider-resources';
import Tools from './tools';
-import { GQLServerHandler } from '~/console/server/gql/saved-queries';
export const loader = async (ctx: IRemixCtx) => {
const promise = pWrapper(async () => {
diff --git a/src/apps/console/server/gql/queries/cluster-managed-services-queries.ts b/src/apps/console/server/gql/queries/cluster-managed-services-queries.ts
new file mode 100644
index 000000000..d721231cf
--- /dev/null
+++ b/src/apps/console/server/gql/queries/cluster-managed-services-queries.ts
@@ -0,0 +1,215 @@
+import gql from 'graphql-tag';
+import { IExecutor } from '~/root/lib/server/helpers/execute-query-with-context';
+import { NN } from '~/root/lib/types/common';
+import {
+ ConsoleGetClusterMSvQuery,
+ ConsoleGetClusterMSvQueryVariables,
+ ConsoleListClusterMSvsQuery,
+ ConsoleListClusterMSvsQueryVariables,
+ ConsoleCreateClusterMSvMutation,
+ ConsoleCreateClusterMSvMutationVariables,
+ ConsoleUpdateClusterMSvMutation,
+ ConsoleUpdateClusterMSvMutationVariables,
+ ConsoleDeleteClusterMSvMutation,
+ ConsoleDeleteClusterMSvMutationVariables,
+} from '~/root/src/generated/gql/server';
+
+export type IClusterMSv = NN<
+ ConsoleGetClusterMSvQuery['infra_getClusterManagedService']
+>;
+export type IClusterMSvs = NN<
+ ConsoleListClusterMSvsQuery['infra_listClusterManagedServices']
+>;
+
+export const clusterManagedServicesQueries = (executor: IExecutor) => ({
+ getClusterMSv: executor(
+ gql`
+ query Infra_getClusterManagedService(
+ $clusterName: String!
+ $name: String!
+ ) {
+ infra_getClusterManagedService(clusterName: $clusterName, name: $name) {
+ displayName
+ creationTime
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ clusterName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ spec {
+ msvcSpec {
+ serviceTemplate {
+ apiVersion
+ kind
+ spec
+ }
+ }
+ namespace
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+ }
+ `,
+ {
+ transformer(data: ConsoleGetClusterMSvQuery) {
+ return data.infra_getClusterManagedService;
+ },
+ vars(_: ConsoleGetClusterMSvQueryVariables) { },
+ }
+ ),
+ createClusterMSv: executor(
+ gql`
+ mutation Infra_createClusterManagedService(
+ $clusterName: String!
+ $service: ClusterManagedServiceIn!
+ ) {
+ infra_createClusterManagedService(
+ clusterName: $clusterName
+ service: $service
+ ) {
+ id
+ }
+ }
+ `,
+ {
+ transformer: (data: ConsoleCreateClusterMSvMutation) =>
+ data.infra_createClusterManagedService,
+ vars(_: ConsoleCreateClusterMSvMutationVariables) { },
+ }
+ ),
+ updateClusterMSv: executor(
+ gql`
+ mutation Infra_updateClusterManagedService(
+ $clusterName: String!
+ $service: ClusterManagedServiceIn!
+ ) {
+ infra_updateClusterManagedService(
+ clusterName: $clusterName
+ service: $service
+ ) {
+ id
+ }
+ }
+ `,
+ {
+ transformer: (data: ConsoleUpdateClusterMSvMutation) =>
+ data.infra_updateClusterManagedService,
+ vars(_: ConsoleUpdateClusterMSvMutationVariables) { },
+ }
+ ),
+ listClusterMSvs: executor(
+ gql`
+ query Infra_listClusterManagedServices($clusterName: String!) {
+ infra_listClusterManagedServices(clusterName: $clusterName) {
+ edges {
+ cursor
+ node {
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ name
+ }
+ spec {
+ msvcSpec {
+ serviceTemplate {
+ apiVersion
+ kind
+ spec
+ }
+ }
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+ }
+ pageInfo {
+ endCursor
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ }
+ totalCount
+ }
+ }
+ `,
+ {
+ transformer: (data: ConsoleListClusterMSvsQuery) =>
+ data.infra_listClusterManagedServices,
+ vars(_: ConsoleListClusterMSvsQueryVariables) { },
+ }
+ ),
+ deleteClusterMSv: executor(
+ gql`
+ mutation Infra_deleteClusterManagedService(
+ $clusterName: String!
+ $serviceName: String!
+ ) {
+ infra_deleteClusterManagedService(
+ clusterName: $clusterName
+ serviceName: $serviceName
+ )
+ }
+ `,
+ {
+ transformer: (data: ConsoleDeleteClusterMSvMutation) =>
+ data.infra_deleteClusterManagedService,
+ vars(_: ConsoleDeleteClusterMSvMutationVariables) { },
+ }
+ ),
+});
diff --git a/src/apps/console/server/gql/queries/cluster-queries.ts b/src/apps/console/server/gql/queries/cluster-queries.ts
index b8d869d7c..abdcbacba 100644
--- a/src/apps/console/server/gql/queries/cluster-queries.ts
+++ b/src/apps/console/server/gql/queries/cluster-queries.ts
@@ -32,7 +32,7 @@ export const clusterQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateClusterMutation) =>
data.infra_createCluster,
- vars(_: ConsoleCreateClusterMutationVariables) {},
+ vars(_: ConsoleCreateClusterMutationVariables) { },
}
),
deleteCluster: executor(
@@ -44,7 +44,7 @@ export const clusterQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleDeleteClusterMutation) =>
data.infra_deleteCluster,
- vars(_: ConsoleDeleteClusterMutationVariables) {},
+ vars(_: ConsoleDeleteClusterMutationVariables) { },
}
),
clustersCount: executor(
@@ -57,7 +57,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleClustersCountQuery) => data.infra_listClusters,
- vars(_: ConsoleClustersCountQueryVariables) {},
+ vars(_: ConsoleClustersCountQueryVariables) { },
}
),
@@ -100,9 +100,7 @@ export const clusterQueries = (executor: IExecutor) => ({
syncScheduledAt
lastSyncedAt
recordVersion
- state
error
- action
}
status {
resources {
@@ -169,7 +167,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleListClustersQuery) => data.infra_listClusters,
- vars(_: ConsoleListClustersQueryVariables) {},
+ vars(_: ConsoleListClustersQueryVariables) { },
}
),
getCluster: executor(
@@ -270,11 +268,9 @@ export const clusterQueries = (executor: IExecutor) => ({
}
}
syncStatus {
- action
error
lastSyncedAt
recordVersion
- state
syncScheduledAt
}
updateTime
@@ -283,7 +279,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleGetClusterQuery) => data.infra_getCluster,
- vars(_: ConsoleGetClusterQueryVariables) {},
+ vars(_: ConsoleGetClusterQueryVariables) { },
}
),
getKubeConfig: executor(
@@ -299,7 +295,7 @@ export const clusterQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleGetKubeConfigQuery) => data.infra_getCluster,
- vars(_: ConsoleGetClusterQueryVariables) {},
+ vars(_: ConsoleGetClusterQueryVariables) { },
}
),
updateCluster: executor(
@@ -313,7 +309,7 @@ export const clusterQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleUpdateClusterMutation) =>
data.infra_updateCluster,
- vars(_: ConsoleUpdateClusterMutationVariables) {},
+ vars(_: ConsoleUpdateClusterMutationVariables) { },
}
),
});
diff --git a/src/apps/console/server/gql/queries/environment-queries.ts b/src/apps/console/server/gql/queries/environment-queries.ts
index 4f2e9ed16..727990412 100644
--- a/src/apps/console/server/gql/queries/environment-queries.ts
+++ b/src/apps/console/server/gql/queries/environment-queries.ts
@@ -73,14 +73,6 @@ export const environmentQueries = (executor: IExecutor) => ({
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -88,7 +80,7 @@ export const environmentQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleGetEnvironmentQuery) =>
data.core_getEnvironment,
- vars(_: ConsoleGetEnvironmentQueryVariables) {},
+ vars(_: ConsoleGetEnvironmentQueryVariables) { },
}
),
createEnvironment: executor(
@@ -102,7 +94,7 @@ export const environmentQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateEnvironmentMutation) =>
data.core_createEnvironment,
- vars(_: ConsoleCreateEnvironmentMutationVariables) {},
+ vars(_: ConsoleCreateEnvironmentMutationVariables) { },
}
),
updateEnvironment: executor(
@@ -117,7 +109,7 @@ export const environmentQueries = (executor: IExecutor) => ({
transformer(data: ConsoleUpdateEnvironmentMutation) {
return data.core_updateEnvironment;
},
- vars(_: ConsoleUpdateEnvironmentMutationVariables) {},
+ vars(_: ConsoleUpdateEnvironmentMutationVariables) { },
}
),
@@ -184,14 +176,6 @@ export const environmentQueries = (executor: IExecutor) => ({
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -208,7 +192,7 @@ export const environmentQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleListEnvironmentsQuery) =>
data.core_listEnvironments,
- vars(_: ConsoleListEnvironmentsQueryVariables) {},
+ vars(_: ConsoleListEnvironmentsQueryVariables) { },
}
),
});
diff --git a/src/apps/console/server/gql/queries/helm-chart-queries.ts b/src/apps/console/server/gql/queries/helm-chart-queries.ts
new file mode 100644
index 000000000..e6c31a67c
--- /dev/null
+++ b/src/apps/console/server/gql/queries/helm-chart-queries.ts
@@ -0,0 +1,222 @@
+import gql from 'graphql-tag';
+import { IExecutor } from '~/root/lib/server/helpers/execute-query-with-context';
+import { NN } from '~/root/lib/types/common';
+import {
+ ConsoleListHelmChartQuery,
+ ConsoleGetHelmChartQueryVariables,
+ ConsoleListHelmChartQueryVariables,
+ ConsoleGetHelmChartQuery,
+ ConsoleCreateHelmChartMutation,
+ ConsoleCreateHelmChartMutationVariables,
+ ConsoleUpdateHelmChartMutation,
+ ConsoleUpdateHelmChartMutationVariables,
+ ConsoleDeleteHelmChartMutation,
+ ConsoleDeleteHelmChartMutationVariables,
+} from '~/root/src/generated/gql/server';
+
+export type IHelmCharts = NN<
+ ConsoleListHelmChartQuery['infra_listHelmReleases']
+>;
+
+export const helmChartQueries = (executor: IExecutor) => ({
+ getHelmChart: executor(
+ gql`
+ query Infra_getHelmRelease($clusterName: String!, $name: String!) {
+ infra_getHelmRelease(clusterName: $clusterName, name: $name) {
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ spec {
+ chartName
+ chartRepo {
+ name
+ url
+ }
+ chartVersion
+ postInstall
+ postUninstall
+ preInstall
+ preUninstall
+ values
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ releaseNotes
+ releaseStatus
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+ }
+ `,
+ {
+ transformer(data: ConsoleGetHelmChartQuery) {
+ return data.infra_getHelmRelease;
+ },
+ vars(_: ConsoleGetHelmChartQueryVariables) { },
+ }
+ ),
+ listHelmChart: executor(
+ gql`
+ query Infra_listHelmReleases($clusterName: String!) {
+ infra_listHelmReleases(clusterName: $clusterName) {
+ edges {
+ cursor
+ node {
+ createdBy {
+ userEmail
+ userId
+ userName
+ }
+ creationTime
+ displayName
+ lastUpdatedBy {
+ userEmail
+ userId
+ userName
+ }
+ markedForDeletion
+ metadata {
+ annotations
+ creationTimestamp
+ deletionTimestamp
+ generation
+ labels
+ name
+ namespace
+ }
+ spec {
+ chartName
+ chartRepo {
+ name
+ url
+ }
+ chartVersion
+
+ postInstall
+ postUninstall
+ preInstall
+ preUninstall
+ values
+ }
+ status {
+ checks
+ isReady
+ lastReadyGeneration
+ lastReconcileTime
+ message {
+ RawMessage
+ }
+ releaseNotes
+ releaseStatus
+ resources {
+ apiVersion
+ kind
+ name
+ namespace
+ }
+ }
+ updateTime
+ }
+ }
+ pageInfo {
+ endCursor
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ }
+ totalCount
+ }
+ }
+ `,
+ {
+ transformer: (data: ConsoleListHelmChartQuery) =>
+ data.infra_listHelmReleases,
+ vars(_: ConsoleListHelmChartQueryVariables) { },
+ }
+ ),
+ createHelmChart: executor(
+ gql`
+ mutation Infra_createHelmRelease(
+ $clusterName: String!
+ $release: HelmReleaseIn!
+ ) {
+ infra_createHelmRelease(clusterName: $clusterName, release: $release) {
+ id
+ }
+ }
+ `,
+ {
+ transformer: (data: ConsoleCreateHelmChartMutation) =>
+ data.infra_createHelmRelease,
+ vars(_: ConsoleCreateHelmChartMutationVariables) { },
+ }
+ ),
+ updateHelmChart: executor(
+ gql`
+ mutation Infra_updateHelmRelease(
+ $clusterName: String!
+ $release: HelmReleaseIn!
+ ) {
+ infra_updateHelmRelease(clusterName: $clusterName, release: $release) {
+ id
+ }
+ }
+ `,
+ {
+ transformer(data: ConsoleUpdateHelmChartMutation) {
+ return data.infra_updateHelmRelease;
+ },
+ vars(_: ConsoleUpdateHelmChartMutationVariables) { },
+ }
+ ),
+ deleteHelmChart: executor(
+ gql`
+ mutation Infra_deleteHelmRelease(
+ $clusterName: String!
+ $releaseName: String!
+ ) {
+ infra_deleteHelmRelease(
+ clusterName: $clusterName
+ releaseName: $releaseName
+ )
+ }
+ `,
+ {
+ transformer(data: ConsoleDeleteHelmChartMutation) {
+ return data.infra_deleteHelmRelease;
+ },
+ vars(_: ConsoleDeleteHelmChartMutationVariables) { },
+ }
+ ),
+});
diff --git a/src/apps/console/server/gql/queries/managed-service-queries.ts b/src/apps/console/server/gql/queries/managed-service-queries.ts
deleted file mode 100644
index 96907a73d..000000000
--- a/src/apps/console/server/gql/queries/managed-service-queries.ts
+++ /dev/null
@@ -1,330 +0,0 @@
-import gql from 'graphql-tag';
-import { IExecutor } from '~/root/lib/server/helpers/execute-query-with-context';
-import { NN } from '~/root/lib/types/common';
-import {
- ConsoleCreateManagedServiceMutation,
- ConsoleCreateManagedServiceMutationVariables,
- ConsoleGetManagedServiceQuery,
- ConsoleGetManagedServiceQueryVariables,
- ConsoleGetTemplateQuery,
- ConsoleGetTemplateQueryVariables,
- ConsoleListManagedServicesQuery,
- ConsoleListManagedServicesQueryVariables,
- ConsoleListTemplatesQuery,
- ConsoleListTemplatesQueryVariables,
-} from '~/root/src/generated/gql/server';
-
-export type IManagedServiceTemplates =
- NN['core_listManagedServiceTemplates'];
-
-export type IManagedServiceTemplate = NN<
- NN['core_getManagedServiceTemplate']
->;
-
-export type IManagedService = NN<
- NN['core_getManagedService']
->;
-
-export type IManagedServices = NN<
- NN['core_listManagedServices']
->;
-
-export const managedServiceQueries = (executor: IExecutor) => ({
- getTemplate: executor(
- gql`
- query Core_getManagedServiceTemplate($category: String!, $name: String!) {
- core_getManagedServiceTemplate(category: $category, name: $name) {
- active
- apiVersion
- description
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- kind
- logoUrl
- name
- outputs {
- description
- label
- name
- }
- resources {
- apiVersion
- description
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- kind
- name
- outputs {
- description
- label
- name
- }
- }
- }
- }
- `,
- {
- transformer(data: ConsoleGetTemplateQuery) {
- return data.core_getManagedServiceTemplate;
- },
- vars(_: ConsoleGetTemplateQueryVariables) {},
- }
- ),
- listTemplates: executor(
- gql`
- query Core_listManagedServiceTemplates {
- core_listManagedServiceTemplates {
- category
- displayName
- items {
- description
- active
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- logoUrl
- name
- outputs {
- name
- label
- description
- }
- resources {
- description
- displayName
- fields {
- defaultValue
- inputType
- label
- max
- min
- name
- required
- unit
- }
- name
- outputs {
- description
- label
- name
- }
- kind
- apiVersion
- }
- kind
- apiVersion
- }
- }
- }
- `,
- {
- transformer(data: ConsoleListTemplatesQuery) {
- return data.core_listManagedServiceTemplates;
- },
- vars(_: ConsoleListTemplatesQueryVariables) {},
- }
- ),
- getManagedService: executor(
- gql`
- query Edges(
- $project: ProjectId!
- $scope: WorkspaceOrEnvId!
- $name: String!
- ) {
- core_getManagedService(project: $project, scope: $scope, name: $name) {
- accountName
- apiVersion
- clusterName
- createdBy {
- userEmail
- userId
- userName
- }
- creationTime
- displayName
- enabled
- id
- kind
- lastUpdatedBy {
- userEmail
- userId
- userName
- }
- markedForDeletion
- metadata {
- annotations
- creationTimestamp
- deletionTimestamp
- generation
- labels
- name
- namespace
- }
- recordVersion
- spec {
- serviceTemplate {
- apiVersion
- kind
- spec
- }
- }
- status {
- checks
- isReady
- lastReconcileTime
- message {
- RawMessage
- }
- resources {
- apiVersion
- kind
- name
- namespace
- }
- }
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
- updateTime
- }
- }
- `,
- {
- transformer(data: ConsoleGetManagedServiceQuery) {
- return data.core_getManagedService;
- },
- vars(_: ConsoleGetManagedServiceQueryVariables) {},
- }
- ),
- listManagedServices: executor(
- gql`
- query Edges($project: ProjectId!, $scope: WorkspaceOrEnvId!) {
- core_listManagedServices(project: $project, scope: $scope) {
- edges {
- cursor
- node {
- accountName
- apiVersion
- clusterName
- createdBy {
- userEmail
- userId
- userName
- }
- creationTime
- displayName
- enabled
- id
- kind
- lastUpdatedBy {
- userEmail
- userId
- userName
- }
- markedForDeletion
- metadata {
- annotations
- creationTimestamp
- deletionTimestamp
- generation
- labels
- name
- namespace
- }
- recordVersion
- spec {
- serviceTemplate {
- apiVersion
- kind
- spec
- }
- }
- status {
- checks
- isReady
- lastReconcileTime
- message {
- RawMessage
- }
- resources {
- apiVersion
- kind
- name
- namespace
- }
- }
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
- updateTime
- }
- }
- pageInfo {
- endCursor
- hasNextPage
- hasPreviousPage
- startCursor
- }
- totalCount
- }
- }
- `,
- {
- transformer(data: ConsoleListManagedServicesQuery) {
- return data.core_listManagedServices;
- },
- vars(_: ConsoleListManagedServicesQueryVariables) {},
- }
- ),
- createManagedService: executor(
- gql`
- mutation Mutation($msvc: ManagedServiceIn!) {
- core_createManagedService(msvc: $msvc) {
- id
- }
- }
- `,
- {
- transformer(data: ConsoleCreateManagedServiceMutation) {
- return data.core_createManagedService;
- },
- vars(_: ConsoleCreateManagedServiceMutationVariables) {},
- }
- ),
-});
diff --git a/src/apps/console/server/gql/queries/managed-templates-queries.ts b/src/apps/console/server/gql/queries/managed-templates-queries.ts
new file mode 100644
index 000000000..b5e546256
--- /dev/null
+++ b/src/apps/console/server/gql/queries/managed-templates-queries.ts
@@ -0,0 +1,115 @@
+import gql from 'graphql-tag';
+import { IExecutor } from '~/root/lib/server/helpers/execute-query-with-context';
+import { NN } from '~/root/lib/types/common';
+import {
+ ConsoleGetMSvTemplateQuery,
+ ConsoleGetMSvTemplateQueryVariables,
+ ConsoleListMSvTemplatesQuery,
+ ConsoleListMSvTemplatesQueryVariables,
+} from '~/root/src/generated/gql/server';
+
+export type IMSvTemplate = NN<
+ ConsoleGetMSvTemplateQuery['infra_getManagedServiceTemplate']
+>;
+export type IMSvTemplates = NN<
+ ConsoleListMSvTemplatesQuery['infra_listManagedServiceTemplates']
+>;
+
+export const managedTemplateQueries = (executor: IExecutor) => ({
+ getMSvTemplate: executor(
+ gql`
+ query Infra_getManagedServiceTemplate(
+ $category: String!
+ $name: String!
+ ) {
+ infra_getManagedServiceTemplate(category: $category, name: $name) {
+ active
+ apiVersion
+ description
+ displayName
+ fields {
+ defaultValue
+ inputType
+ label
+ max
+ min
+ name
+ required
+ unit
+ displayUnit
+ multiplier
+ }
+ kind
+ logoUrl
+ name
+ outputs {
+ description
+ label
+ name
+ }
+ resources {
+ apiVersion
+ description
+ displayName
+ kind
+ name
+ }
+ }
+ }
+ `,
+ {
+ transformer(data: ConsoleGetMSvTemplateQuery) {
+ return data.infra_getManagedServiceTemplate;
+ },
+ vars(_: ConsoleGetMSvTemplateQueryVariables) { },
+ }
+ ),
+ listMSvTemplates: executor(
+ gql`
+ query Infra_listManagedServiceTemplates {
+ infra_listManagedServiceTemplates {
+ category
+ displayName
+ items {
+ active
+ apiVersion
+ description
+ displayName
+ fields {
+ defaultValue
+ inputType
+ label
+ max
+ min
+ name
+ required
+ unit
+ displayUnit
+ multiplier
+ }
+ kind
+ logoUrl
+ name
+ outputs {
+ description
+ label
+ name
+ }
+ resources {
+ apiVersion
+ description
+ displayName
+ kind
+ name
+ }
+ }
+ }
+ }
+ `,
+ {
+ transformer: (data: ConsoleListMSvTemplatesQuery) =>
+ data.infra_listManagedServiceTemplates,
+ vars(_: ConsoleListMSvTemplatesQueryVariables) { },
+ }
+ ),
+});
diff --git a/src/apps/console/server/gql/queries/nodepool-queries.ts b/src/apps/console/server/gql/queries/nodepool-queries.ts
index 285eb5ef3..666c07370 100644
--- a/src/apps/console/server/gql/queries/nodepool-queries.ts
+++ b/src/apps/console/server/gql/queries/nodepool-queries.ts
@@ -96,14 +96,6 @@ export const nodepoolQueries = (executor: IExecutor) => ({
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
updateTime
}
}
@@ -112,7 +104,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({
transformer(data: ConsoleGetNodePoolQuery) {
return data.infra_getNodePool;
},
- vars(_: ConsoleGetNodePoolQueryVariables) {},
+ vars(_: ConsoleGetNodePoolQueryVariables) { },
}
),
createNodePool: executor(
@@ -126,7 +118,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateNodePoolMutation) =>
data.infra_createNodePool,
- vars(_: ConsoleCreateNodePoolMutationVariables) {},
+ vars(_: ConsoleCreateNodePoolMutationVariables) { },
}
),
updateNodePool: executor(
@@ -140,7 +132,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateNodePoolMutation) =>
data.infra_createNodePool,
- vars(_: ConsoleCreateNodePoolMutationVariables) {},
+ vars(_: ConsoleCreateNodePoolMutationVariables) { },
}
),
listNodePools: executor(
@@ -227,14 +219,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({
namespace
}
}
- syncStatus {
- action
- error
- lastSyncedAt
- recordVersion
- state
- syncScheduledAt
- }
+
updateTime
}
}
@@ -244,7 +229,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleListNodePoolsQuery) =>
data.infra_listNodePools,
- vars(_: ConsoleListNodePoolsQueryVariables) {},
+ vars(_: ConsoleListNodePoolsQueryVariables) { },
}
),
deleteNodePool: executor(
@@ -256,7 +241,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleDeleteNodePoolMutation) =>
data.infra_deleteNodePool,
- vars(_: ConsoleDeleteNodePoolMutationVariables) {},
+ vars(_: ConsoleDeleteNodePoolMutationVariables) { },
}
),
});
diff --git a/src/apps/console/server/gql/queries/project-queries.ts b/src/apps/console/server/gql/queries/project-queries.ts
index 7975632f5..3b3b74227 100644
--- a/src/apps/console/server/gql/queries/project-queries.ts
+++ b/src/apps/console/server/gql/queries/project-queries.ts
@@ -27,7 +27,7 @@ export const projectQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateProjectMutation) =>
data.core_createProject,
- vars(_: ConsoleCreateProjectMutationVariables) {},
+ vars(_: ConsoleCreateProjectMutationVariables) { },
}
),
updateProject: executor(
@@ -41,7 +41,7 @@ export const projectQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleUpdateProjectMutation) =>
data.core_updateProject,
- vars(_: ConsoleUpdateProjectMutationVariables) {},
+ vars(_: ConsoleUpdateProjectMutationVariables) { },
}
),
getProject: executor(
@@ -100,7 +100,7 @@ export const projectQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleGetProjectQuery) => data.core_getProject,
- vars(_: ConsoleGetProjectQueryVariables) {},
+ vars(_: ConsoleGetProjectQueryVariables) { },
}
),
listProjects: executor(
@@ -165,14 +165,7 @@ export const projectQueries = (executor: IExecutor) => ({
isReady
checks
}
- syncStatus {
- syncScheduledAt
- state
- recordVersion
- lastSyncedAt
- error
- action
- }
+
updateTime
accountName
}
@@ -188,7 +181,7 @@ export const projectQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleListProjectsQuery) => data.core_listProjects,
- vars(_: ConsoleListProjectsQueryVariables) {},
+ vars(_: ConsoleListProjectsQueryVariables) { },
}
),
});
diff --git a/src/apps/console/server/gql/queries/vpn-queries.ts b/src/apps/console/server/gql/queries/vpn-queries.ts
index 4723b578b..fdd0cb6d0 100644
--- a/src/apps/console/server/gql/queries/vpn-queries.ts
+++ b/src/apps/console/server/gql/queries/vpn-queries.ts
@@ -34,7 +34,7 @@ export const vpnQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateVpnDeviceMutation) =>
data.infra_createVPNDevice,
- vars(_: ConsoleCreateVpnDeviceMutationVariables) {},
+ vars(_: ConsoleCreateVpnDeviceMutationVariables) { },
}
),
@@ -56,7 +56,7 @@ export const vpnQueries = (executor: IExecutor) => ({
transformer: (v: ConsoleUpdateVpnDeviceMutation) => {
return v.infra_updateVPNDevice;
},
- vars(_: ConsoleUpdateVpnDeviceMutationVariables) {},
+ vars(_: ConsoleUpdateVpnDeviceMutationVariables) { },
}
),
listVpnDevices: executor(
@@ -98,8 +98,6 @@ export const vpnQueries = (executor: IExecutor) => ({
namespace
}
spec {
- accountName
- clusterName
ports {
port
targetPort
@@ -145,7 +143,7 @@ export const vpnQueries = (executor: IExecutor) => ({
transformer(data: ConsoleListVpnDevicesQuery) {
return data.infra_listVPNDevices;
},
- vars(_: ConsoleListVpnDevicesQueryVariables) {},
+ vars(_: ConsoleListVpnDevicesQueryVariables) { },
}
),
getVpnDevice: executor(
@@ -176,8 +174,6 @@ export const vpnQueries = (executor: IExecutor) => ({
namespace
}
spec {
- accountName
- clusterName
ports {
port
targetPort
@@ -218,7 +214,7 @@ export const vpnQueries = (executor: IExecutor) => ({
transformer(data: ConsoleGetVpnDeviceQuery) {
return data.infra_getVPNDevice;
},
- vars(_: ConsoleGetVpnDeviceQueryVariables) {},
+ vars(_: ConsoleGetVpnDeviceQueryVariables) { },
}
),
deleteVpnDevice: executor(
@@ -237,7 +233,7 @@ export const vpnQueries = (executor: IExecutor) => ({
transformer(data: ConsoleDeleteVpnDeviceMutation) {
return data.infra_deleteVPNDevice;
},
- vars(_: ConsoleDeleteVpnDeviceMutationVariables) {},
+ vars(_: ConsoleDeleteVpnDeviceMutationVariables) { },
}
),
});
diff --git a/src/apps/console/server/gql/queries/workspace-queries.ts b/src/apps/console/server/gql/queries/workspace-queries.ts
index 477bb3f2e..c83097647 100644
--- a/src/apps/console/server/gql/queries/workspace-queries.ts
+++ b/src/apps/console/server/gql/queries/workspace-queries.ts
@@ -6,14 +6,16 @@ import {
ConsoleCreateWorkspaceMutationVariables,
ConsoleGetWorkspaceQuery,
ConsoleGetWorkspaceQueryVariables,
- ConsoleListWorkspacesQuery,
- ConsoleListWorkspacesQueryVariables,
+ ConsoleListEnvironmentsQuery,
+ ConsoleListEnvironmentsQueryVariables,
ConsoleUpdateWorkspaceMutation,
ConsoleUpdateWorkspaceMutationVariables,
} from '~/root/src/generated/gql/server';
export type IWorkspace = NN;
-export type IWorkspaces = NN;
+export type IWorkspaces = NN<
+ ConsoleListEnvironmentsQuery['core_listEnvironments']
+>;
export const workspaceQueries = (executor: IExecutor) => ({
getWorkspace: executor(
gql`
@@ -37,7 +39,7 @@ export const workspaceQueries = (executor: IExecutor) => ({
`,
{
transformer: (data: ConsoleGetWorkspaceQuery) => data.core_getWorkspace,
- vars(_: ConsoleGetWorkspaceQueryVariables) {},
+ vars(_: ConsoleGetWorkspaceQueryVariables) { },
}
),
createWorkspace: executor(
@@ -51,7 +53,7 @@ export const workspaceQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleCreateWorkspaceMutation) =>
data.core_createWorkspace,
- vars(_: ConsoleCreateWorkspaceMutationVariables) {},
+ vars(_: ConsoleCreateWorkspaceMutationVariables) { },
}
),
updateWorkspace: executor(
@@ -66,63 +68,7 @@ export const workspaceQueries = (executor: IExecutor) => ({
transformer(data: ConsoleUpdateWorkspaceMutation) {
return data.core_updateWorkspace;
},
- vars(_: ConsoleUpdateWorkspaceMutationVariables) {},
- }
- ),
- listWorkspaces: executor(
- gql`
- query Core_listWorkspaces(
- $project: ProjectId!
- $search: SearchWorkspaces
- $pagination: CursorPaginationIn
- ) {
- core_listWorkspaces(
- project: $project
- search: $search
- pq: $pagination
- ) {
- pageInfo {
- startCursor
- hasPreviousPage
- hasNextPage
- endCursor
- }
- totalCount
- edges {
- node {
- metadata {
- name
- namespace
- labels
- annotations
- }
- displayName
- clusterName
- updateTime
- creationTime
- spec {
- targetNamespace
- projectName
- }
- createdBy {
- userEmail
- userId
- userName
- }
- lastUpdatedBy {
- userEmail
- userId
- userName
- }
- }
- }
- }
- }
- `,
- {
- transformer: (data: ConsoleListWorkspacesQuery) =>
- data.core_listWorkspaces,
- vars(_: ConsoleListWorkspacesQueryVariables) {},
+ vars(_: ConsoleUpdateWorkspaceMutationVariables) { },
}
),
});
diff --git a/src/apps/console/server/gql/saved-queries.ts b/src/apps/console/server/gql/saved-queries.ts
index febeeeb4e..a0861508b 100644
--- a/src/apps/console/server/gql/saved-queries.ts
+++ b/src/apps/console/server/gql/saved-queries.ts
@@ -14,7 +14,6 @@ import { domainQueries } from './queries/domain-queries';
import { environmentQueries } from './queries/environment-queries';
import { gitQueries } from './queries/git-queries';
import { managedResourceQueries } from './queries/managed-resource-queries';
-import { managedServiceQueries } from './queries/managed-service-queries';
import { nodepoolQueries } from './queries/nodepool-queries';
import { projectQueries } from './queries/project-queries';
import { providerSecretQueries } from './queries/provider-secret-queries';
@@ -25,6 +24,9 @@ import { tagsQueries } from './queries/tags-queries';
import { vpnQueries } from './queries/vpn-queries';
import { workspaceQueries } from './queries/workspace-queries';
import { pvcQueries } from './queries/pvc-queries';
+import { clusterManagedServicesQueries } from './queries/cluster-managed-services-queries';
+import { managedTemplateQueries } from './queries/managed-templates-queries';
+import { helmChartQueries } from './queries/helm-chart-queries';
export const GQLServerHandler = ({ headers, cookies }: IGQLServerProps) => {
const executor = ExecuteQueryWithContext(headers, cookies);
@@ -43,7 +45,6 @@ export const GQLServerHandler = ({ headers, cookies }: IGQLServerProps) => {
...secretQueries(executor),
...vpnQueries(executor),
...accessQueries(executor),
- ...managedServiceQueries(executor),
...managedResourceQueries(executor),
...crQueries(executor),
...repoQueries(executor),
@@ -54,6 +55,9 @@ export const GQLServerHandler = ({ headers, cookies }: IGQLServerProps) => {
...buildCachesQueries(executor),
...pvcQueries(executor),
...buildRunQueries(executor),
+ ...clusterManagedServicesQueries(executor),
+ ...managedTemplateQueries(executor),
+ ...helmChartQueries(executor),
};
};
diff --git a/src/apps/console/server/r-utils/common.ts b/src/apps/console/server/r-utils/common.ts
index 23628d569..1f7949ec1 100644
--- a/src/apps/console/server/r-utils/common.ts
+++ b/src/apps/console/server/r-utils/common.ts
@@ -60,10 +60,10 @@ export const parseNodes = (resources: IparseNodes | undefined): T[] =>
type IparseName =
| {
- metadata?: {
- name: string;
- };
- }
+ metadata?: {
+ name: string;
+ };
+ }
| undefined
| null;
@@ -87,10 +87,10 @@ export const parseName = (resource: IparseName, ensure = false) => {
type IparseNamespace =
| {
- metadata: {
- namespace: string;
- };
- }
+ metadata: {
+ namespace: string;
+ };
+ }
| undefined
| null;
@@ -99,10 +99,10 @@ export const parseNamespace = (resource: IparseNamespace) =>
type IparseTargetNs =
| {
- spec?: {
- targetNamespace: string;
- };
- }
+ spec?: {
+ targetNamespace: string;
+ };
+ }
| undefined
| null;
diff --git a/src/apps/console/utils/commons.tsx b/src/apps/console/utils/commons.tsx
index a8a17cb37..03c938c13 100644
--- a/src/apps/console/utils/commons.tsx
+++ b/src/apps/console/utils/commons.tsx
@@ -1,19 +1,20 @@
import { AWSlogoFill } from '@jengaicons/react';
import { Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider as CloudProviders } from '~/root/src/generated/gql/server';
+import { json } from 'react-router-dom';
import {
- IManagedServiceTemplate,
- IManagedServiceTemplates,
-} from '../server/gql/queries/managed-service-queries';
+ IMSvTemplate,
+ IMSvTemplates,
+} from '../server/gql/queries/managed-templates-queries';
export const getManagedTemplate = ({
templates,
kind,
apiVersion,
}: {
- templates: IManagedServiceTemplates;
+ templates: IMSvTemplates;
kind: string;
apiVersion: string;
-}): IManagedServiceTemplate | undefined => {
+}): IMSvTemplate | undefined => {
return templates
?.flatMap((t) => t.items.flat())
.find((t) => t.kind === kind && t.apiVersion === apiVersion);
@@ -125,3 +126,10 @@ export const renderCloudProvider = ({
return cloudprovider;
}
};
+
+export const flatMap = (data: any) => {
+ const keys = data.split('.');
+
+ const jsonObject = keys.reduceRight((acc, key) => ({ [key]: acc }), null);
+ return jsonObject;
+};
diff --git a/src/generated/gql/sdl.graphql b/src/generated/gql/sdl.graphql
index 9ceef7538..215a56221 100644
--- a/src/generated/gql/sdl.graphql
+++ b/src/generated/gql/sdl.graphql
@@ -95,7 +95,6 @@ type AppPaginatedRecords {
}
type Build {
- accountName: String!
buildClusterName: String!
createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
creationTime: Date!
@@ -506,46 +505,6 @@ type GitBranch {
protected: Boolean
}
-type Github__com___kloudlite___api___apps___console___internal___entities__InputField {
- defaultValue: Any
- inputType: String!
- label: String!
- max: Float
- min: Float
- name: String!
- required: Boolean
- unit: String
-}
-
-type Github__com___kloudlite___api___apps___console___internal___entities__MresTemplate {
- apiVersion: String
- description: String!
- displayName: String!
- fields: [Github__com___kloudlite___api___apps___console___internal___entities__InputField!]!
- kind: String
- name: String!
- outputs: [Github__com___kloudlite___api___apps___console___internal___entities__OutputField!]!
-}
-
-type Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry {
- active: Boolean!
- apiVersion: String
- description: String!
- displayName: String!
- fields: [Github__com___kloudlite___api___apps___console___internal___entities__InputField!]!
- kind: String
- logoUrl: String!
- name: String!
- outputs: [Github__com___kloudlite___api___apps___console___internal___entities__OutputField!]!
- resources: [Github__com___kloudlite___api___apps___console___internal___entities__MresTemplate!]!
-}
-
-type Github__com___kloudlite___api___apps___console___internal___entities__OutputField {
- description: String!
- label: String!
- name: String!
-}
-
enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus {
error
failed
@@ -666,6 +625,48 @@ input Github__com___kloudlite___api___apps___infra___internal___entities__AWSSec
secretKey: String
}
+type Github__com___kloudlite___api___apps___infra___internal___entities__InputField {
+ defaultValue: Any
+ displayUnit: String
+ inputType: String!
+ label: String!
+ max: Float
+ min: Float
+ multiplier: Float
+ name: String!
+ required: Boolean
+ unit: String
+}
+
+type Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate {
+ apiVersion: String
+ description: String!
+ displayName: String!
+ fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]!
+ kind: String
+ name: String!
+ outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]!
+}
+
+type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry {
+ active: Boolean!
+ apiVersion: String
+ description: String!
+ displayName: String!
+ fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]!
+ kind: String
+ logoUrl: String!
+ name: String!
+ outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]!
+ resources: [Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate!]!
+}
+
+type Github__com___kloudlite___api___apps___infra___internal___entities__OutputField {
+ description: String!
+ label: String!
+ name: String!
+}
+
type Github__com___kloudlite___api___common__CreatedOrUpdatedBy {
userEmail: String!
userId: String!
@@ -677,26 +678,29 @@ type Github__com___kloudlite___api___pkg___types__EncodedString {
value: String!
}
-type Github__com___kloudlite___api___pkg___types__SyncStatus {
- action: Github__com___kloudlite___api___pkg___types__SyncStatusAction!
- error: String
- lastSyncedAt: Date
- recordVersion: Int!
- state: Github__com___kloudlite___api___pkg___types__SyncStatusState!
- syncScheduledAt: Date
-}
-
-enum Github__com___kloudlite___api___pkg___types__SyncStatusAction {
+enum Github__com___kloudlite___api___pkg___types__SyncAction {
APPLY
DELETE
}
-enum Github__com___kloudlite___api___pkg___types__SyncStatusState {
+enum Github__com___kloudlite___api___pkg___types__SyncState {
APPLIED_AT_AGENT
+ DELETED_AT_AGENT
+ DELETING_AT_AGENT
ERRORED_AT_AGENT
IDLE
IN_QUEUE
RECEIVED_UPDATE_FROM_AGENT
+ UPDATED_AT_AGENT
+}
+
+type Github__com___kloudlite___api___pkg___types__SyncStatus {
+ action: Github__com___kloudlite___api___pkg___types__SyncAction!
+ error: String
+ lastSyncedAt: Date
+ recordVersion: Int!
+ state: Github__com___kloudlite___api___pkg___types__SyncState!
+ syncScheduledAt: Date
}
type Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig {
@@ -1022,6 +1026,16 @@ input Github__com___kloudlite___operator___apis___crds___v1__BasicAuthIn {
username: String
}
+type Github__com___kloudlite___operator___apis___crds___v1__ChartRepo {
+ name: String!
+ url: String!
+}
+
+input Github__com___kloudlite___operator___apis___crds___v1__ChartRepoIn {
+ name: String!
+ url: String!
+}
+
type Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec {
msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec!
namespace: String!
@@ -1111,6 +1125,41 @@ input Github__com___kloudlite___operator___apis___crds___v1__EnvFromIn {
type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret!
}
+type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec {
+ chartName: String!
+ chartRepo: Github__com___kloudlite___operator___apis___crds___v1__ChartRepo!
+ chartVersion: String!
+ jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVars
+ postInstall: String
+ postUninstall: String
+ preInstall: String
+ preUninstall: String
+ values: Map!
+}
+
+input Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn {
+ chartName: String!
+ chartRepo: Github__com___kloudlite___operator___apis___crds___v1__ChartRepoIn!
+ chartVersion: String!
+ jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn
+ postInstall: String
+ postUninstall: String
+ preInstall: String
+ preUninstall: String
+ values: Map!
+}
+
+type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus {
+ checks: Map
+ isReady: Boolean!
+ lastReadyGeneration: Int
+ lastReconcileTime: Date
+ message: Github__com___kloudlite___operator___pkg___raw____json__RawJson
+ releaseNotes: String!
+ releaseStatus: String!
+ resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!]
+}
+
type Github__com___kloudlite___operator___apis___crds___v1__HPA {
enabled: Boolean
maxReplicas: Int
@@ -1159,6 +1208,20 @@ input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn {
toDevice: String!
}
+type Github__com___kloudlite___operator___apis___crds___v1__JobVars {
+ affinity: K8s__io___api___core___v1__Affinity
+ backOffLimit: Int
+ nodeSelector: Map
+ tolerations: [K8s__io___api___core___v1__Toleration!]
+}
+
+input Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn {
+ affinity: K8s__io___api___core___v1__AffinityIn
+ backOffLimit: Int
+ nodeSelector: Map
+ tolerations: [K8s__io___api___core___v1__TolerationIn!]
+}
+
type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec {
resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate!
}
@@ -1191,12 +1254,14 @@ type Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef {
apiVersion: String!
kind: String!
name: String!
+ namespace: String!
}
input Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn {
apiVersion: String!
kind: String!
name: String!
+ namespace: String!
}
type Github__com___kloudlite___operator___apis___crds___v1__Probe {
@@ -1296,6 +1361,8 @@ type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate {
}
input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn {
+ apiVersion: String!
+ kind: String!
spec: Map!
}
@@ -1388,17 +1455,25 @@ input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn
memoryInMb: Int!
}
+type Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord {
+ host: String
+ target: String
+}
+
+input Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn {
+ host: String
+ target: String
+}
+
type Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec {
- accountName: String!
- clusterName: String!
+ cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord!]
deviceNamespace: String
nodeSelector: Map
ports: [Github__com___kloudlite___operator___apis___wireguard___v1__Port!]
}
input Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn {
- accountName: String!
- clusterName: String!
+ cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn!]
deviceNamespace: String
nodeSelector: Map
ports: [Github__com___kloudlite___operator___apis___wireguard___v1__PortIn!]
@@ -1529,6 +1604,42 @@ type GitlabProject {
webUrl: String!
}
+type HelmRelease {
+ accountName: String!
+ apiVersion: String!
+ clusterName: String!
+ createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ creationTime: Date!
+ displayName: String!
+ id: String!
+ kind: String!
+ lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ markedForDeletion: Boolean
+ metadata: Metadata
+ recordVersion: Int!
+ spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec
+ status: Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus
+ syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!
+ updateTime: Date!
+}
+
+type HelmReleaseEdge {
+ cursor: String!
+ node: HelmRelease!
+}
+
+input HelmReleaseIn {
+ displayName: String!
+ metadata: MetadataIn
+ spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn
+}
+
+type HelmReleasePaginatedRecords {
+ edges: [HelmReleaseEdge!]!
+ pageInfo: PageInfo!
+ totalCount: Int!
+}
+
type ImagePullSecret {
accountName: String!
creationTime: Date!
@@ -1585,12 +1696,73 @@ input InvitationIn {
scalar Json
+type K8s__io___api___core___v1__Affinity {
+ nodeAffinity: K8s__io___api___core___v1__NodeAffinity
+ podAffinity: K8s__io___api___core___v1__PodAffinity
+ podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinity
+}
+
+input K8s__io___api___core___v1__AffinityIn {
+ nodeAffinity: K8s__io___api___core___v1__NodeAffinityIn
+ podAffinity: K8s__io___api___core___v1__PodAffinityIn
+ podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinityIn
+}
+
enum K8s__io___api___core___v1__ConditionStatus {
False
True
Unknown
}
+type K8s__io___api___core___v1__NodeAffinity {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTerm!]
+ requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelector
+}
+
+input K8s__io___api___core___v1__NodeAffinityIn {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTermIn!]
+ requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelectorIn
+}
+
+type K8s__io___api___core___v1__NodeSelector {
+ nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTerm!]!
+}
+
+input K8s__io___api___core___v1__NodeSelectorIn {
+ nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTermIn!]!
+}
+
+enum K8s__io___api___core___v1__NodeSelectorOperator {
+ DoesNotExist
+ Exists
+ Gt
+ In
+ Lt
+ NotIn
+}
+
+type K8s__io___api___core___v1__NodeSelectorRequirement {
+ key: String!
+ operator: K8s__io___api___core___v1__NodeSelectorOperator!
+ values: [String!]
+}
+
+input K8s__io___api___core___v1__NodeSelectorRequirementIn {
+ key: String!
+ operator: K8s__io___api___core___v1__NodeSelectorOperator!
+ values: [String!]
+}
+
+type K8s__io___api___core___v1__NodeSelectorTerm {
+ matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirement!]
+ matchFields: [K8s__io___api___core___v1__NodeSelectorRequirement!]
+}
+
+input K8s__io___api___core___v1__NodeSelectorTermIn {
+ matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirementIn!]
+ matchFields: [K8s__io___api___core___v1__NodeSelectorRequirementIn!]
+}
+
type K8s__io___api___core___v1__PersistentVolumeClaimCondition {
lastProbeTime: Date
lastTransitionTime: Date
@@ -1660,6 +1832,50 @@ input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn {
phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase
}
+type K8s__io___api___core___v1__PodAffinity {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!]
+}
+
+input K8s__io___api___core___v1__PodAffinityIn {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!]
+}
+
+type K8s__io___api___core___v1__PodAffinityTerm {
+ labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector
+ namespaces: [String!]
+ namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector
+ topologyKey: String!
+}
+
+input K8s__io___api___core___v1__PodAffinityTermIn {
+ labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn
+ namespaces: [String!]
+ namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn
+ topologyKey: String!
+}
+
+type K8s__io___api___core___v1__PodAntiAffinity {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!]
+}
+
+input K8s__io___api___core___v1__PodAntiAffinityIn {
+ preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!]
+ requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!]
+}
+
+type K8s__io___api___core___v1__PreferredSchedulingTerm {
+ preference: K8s__io___api___core___v1__NodeSelectorTerm!
+ weight: Int!
+}
+
+input K8s__io___api___core___v1__PreferredSchedulingTermIn {
+ preference: K8s__io___api___core___v1__NodeSelectorTermIn!
+ weight: Int!
+}
+
type K8s__io___api___core___v1__ResourceClaim {
name: String!
}
@@ -1758,6 +1974,16 @@ input K8s__io___api___core___v1__TypedObjectReferenceIn {
namespace: String
}
+type K8s__io___api___core___v1__WeightedPodAffinityTerm {
+ podAffinityTerm: K8s__io___api___core___v1__PodAffinityTerm!
+ weight: Int!
+}
+
+input K8s__io___api___core___v1__WeightedPodAffinityTermIn {
+ podAffinityTerm: K8s__io___api___core___v1__PodAffinityTermIn!
+ weight: Int!
+}
+
enum K8s__io___apimachinery___pkg___api___resource__Format {
BinarySI
DecimalExponent
@@ -1839,44 +2065,6 @@ type ManagedResourcePaginatedRecords {
totalCount: Int!
}
-type ManagedService {
- accountName: String!
- apiVersion: String!
- clusterName: String!
- createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
- creationTime: Date!
- displayName: String!
- enabled: Boolean
- id: String!
- kind: String!
- lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
- markedForDeletion: Boolean
- metadata: Metadata
- recordVersion: Int!
- spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec!
- status: Github__com___kloudlite___operator___pkg___operator__Status
- syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!
- updateTime: Date!
-}
-
-type ManagedServiceEdge {
- cursor: String!
- node: ManagedService!
-}
-
-input ManagedServiceIn {
- displayName: String!
- enabled: Boolean
- metadata: MetadataIn
- spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn!
-}
-
-type ManagedServicePaginatedRecords {
- edges: [ManagedServiceEdge!]!
- pageInfo: PageInfo!
- totalCount: Int!
-}
-
scalar Map
type MatchFilter {
@@ -1919,7 +2107,7 @@ input MetadataIn {
type MsvcTemplate {
category: String!
displayName: String!
- items: [Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry!]!
+ items: [Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry!]!
}
type Mutation {
@@ -1953,7 +2141,6 @@ type Mutation {
core_createEnvironment(env: WorkspaceIn!): Workspace
core_createImagePullSecret(imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret
core_createManagedResource(mres: ManagedResourceIn!): ManagedResource
- core_createManagedService(msvc: ManagedServiceIn!): ManagedService
core_createProject(project: ProjectIn!): Project
core_createRouter(router: RouterIn!): Router
core_createSecret(secret: SecretIn!): Secret
@@ -1963,7 +2150,6 @@ type Mutation {
core_deleteEnvironment(name: String!, namespace: String!): Boolean!
core_deleteImagePullSecret(name: String!, namespace: String!): Boolean!
core_deleteManagedResource(name: String!, namespace: String!): Boolean!
- core_deleteManagedService(name: String!, namespace: String!): Boolean!
core_deleteProject(name: String!): Boolean!
core_deleteRouter(name: String!, namespace: String!): Boolean!
core_deleteSecret(name: String!, namespace: String!): Boolean!
@@ -1972,7 +2158,6 @@ type Mutation {
core_updateConfig(config: ConfigIn!): Config
core_updateEnvironment(env: WorkspaceIn!): Workspace
core_updateManagedResource(mres: ManagedResourceIn!): ManagedResource
- core_updateManagedService(msvc: ManagedServiceIn!): ManagedService
core_updateProject(project: ProjectIn!): Project
core_updateRouter(router: RouterIn!): Router
core_updateSecret(secret: SecretIn!): Secret
@@ -1993,18 +2178,21 @@ type Mutation {
infra_createCluster(cluster: ClusterIn!): Cluster
infra_createClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService
infra_createDomainEntry(domainEntry: DomainEntryIn!): DomainEntry
+ infra_createHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease
infra_createNodePool(clusterName: String!, pool: NodePoolIn!): NodePool
infra_createProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret
infra_createVPNDevice(clusterName: String!, vpnDevice: VPNDeviceIn!): VPNDevice
infra_deleteCluster(name: String!): Boolean!
infra_deleteClusterManagedService(clusterName: String!, serviceName: String!): Boolean!
infra_deleteDomainEntry(domainName: String!): Boolean!
+ infra_deleteHelmRelease(clusterName: String!, releaseName: String!): Boolean!
infra_deleteNodePool(clusterName: String!, poolName: String!): Boolean!
infra_deleteProviderSecret(secretName: String!): Boolean!
infra_deleteVPNDevice(clusterName: String!, deviceName: String!): Boolean!
infra_updateCluster(cluster: ClusterIn!): Cluster
infra_updateClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService
infra_updateDomainEntry(domainEntry: DomainEntryIn!): DomainEntry
+ infra_updateHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease
infra_updateNodePool(clusterName: String!, pool: NodePoolIn!): NodePool
infra_updateProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret
infra_updateVPNDevice(clusterName: String!, vpnDevice: VPNDeviceIn!): VPNDevice
@@ -2114,6 +2302,7 @@ type PersistentVolumeClaim {
recordVersion: Int!
spec: K8s__io___api___core___v1__PersistentVolumeClaimSpec
status: K8s__io___api___core___v1__PersistentVolumeClaimStatus
+ syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!
updateTime: Date!
}
@@ -2197,8 +2386,6 @@ type Query {
core_getEnvironment(name: String!, project: ProjectId!): Workspace
core_getImagePullSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId): ImagePullSecret
core_getManagedResource(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): ManagedResource
- core_getManagedService(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): ManagedService
- core_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry
core_getProject(name: String!): Project
core_getRouter(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Router
core_getSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Secret
@@ -2208,18 +2395,14 @@ type Query {
core_listEnvironments(pq: CursorPaginationIn, project: ProjectId!, search: SearchWorkspaces): WorkspacePaginatedRecords
core_listImagePullSecrets(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId, search: SearchImagePullSecrets): ImagePullSecretPaginatedRecords
core_listManagedResources(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchManagedResources): ManagedResourcePaginatedRecords
- core_listManagedServices(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchManagedServices): ManagedServicePaginatedRecords
- core_listManagedServiceTemplates: [MsvcTemplate!]
core_listProjects(clusterName: String, pq: CursorPaginationIn, search: SearchProjects): ProjectPaginatedRecords
core_listRouters(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchRouters): RouterPaginatedRecords
core_listSecrets(pq: CursorPaginationIn, project: ProjectId!, scope: WorkspaceOrEnvId!, search: SearchSecrets): SecretPaginatedRecords
- core_listWorkspaces(pq: CursorPaginationIn, project: ProjectId!, search: SearchWorkspaces): WorkspacePaginatedRecords
core_resyncApp(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncConfig(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncEnvironment(name: String!, project: ProjectId!): Boolean!
core_resyncImagePullSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId): Boolean!
core_resyncManagedResource(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
- core_resyncManagedService(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncProject(name: String!): Boolean!
core_resyncRouter(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
core_resyncSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Boolean!
@@ -2246,6 +2429,8 @@ type Query {
infra_getCluster(name: String!): Cluster
infra_getClusterManagedService(clusterName: String!, name: String!): ClusterManagedService
infra_getDomainEntry(domainName: String!): DomainEntry
+ infra_getHelmRelease(clusterName: String!, name: String!): HelmRelease
+ infra_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry
infra_getNodePool(clusterName: String!, poolName: String!): NodePool
infra_getProviderSecret(name: String!): CloudProviderSecret
infra_getPVC(clusterName: String!, name: String!): PersistentVolumeClaim
@@ -2253,6 +2438,8 @@ type Query {
infra_listClusterManagedServices(clusterName: String!, pagination: CursorPaginationIn, search: SearchClusterManagedService): ClusterManagedServicePaginatedRecords
infra_listClusters(pagination: CursorPaginationIn, search: SearchCluster): ClusterPaginatedRecords
infra_listDomainEntries(pagination: CursorPaginationIn, search: SearchDomainEntry): DomainEntryPaginatedRecords
+ infra_listHelmReleases(clusterName: String!, pagination: CursorPaginationIn, search: SearchHelmRelease): HelmReleasePaginatedRecords
+ infra_listManagedServiceTemplates: [MsvcTemplate!]
infra_listNodePools(clusterName: String!, pagination: CursorPaginationIn, search: SearchNodepool): NodePoolPaginatedRecords
infra_listProviderSecrets(pagination: CursorPaginationIn, search: SearchProviderSecret): CloudProviderSecretPaginatedRecords
infra_listPVCs(clusterName: String!, pq: CursorPaginationIn, search: SearchPersistentVolumeClaims): PersistentVolumeClaimPaginatedRecords
@@ -2294,6 +2481,7 @@ type RepositoryPaginatedRecords {
enum ResType {
cluster
+ helm_release
nodepool
providersecret
vpn_device
@@ -2389,21 +2577,20 @@ input SearchEnvironments {
text: MatchFilterIn
}
-input SearchImagePullSecrets {
+input SearchHelmRelease {
isReady: MatchFilterIn
- markedForDeletion: MatchFilterIn
text: MatchFilterIn
}
-input SearchManagedResources {
+input SearchImagePullSecrets {
isReady: MatchFilterIn
- managedServiceName: MatchFilterIn
markedForDeletion: MatchFilterIn
text: MatchFilterIn
}
-input SearchManagedServices {
+input SearchManagedResources {
isReady: MatchFilterIn
+ managedServiceName: MatchFilterIn
markedForDeletion: MatchFilterIn
text: MatchFilterIn
}
diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts
index 46c7b2c59..f4adb3746 100644
--- a/src/generated/gql/server.ts
+++ b/src/generated/gql/server.ts
@@ -80,16 +80,19 @@ export type K8s__Io___Api___Core___V1__TaintEffect =
export type K8s__Io___Api___Core___V1__TolerationOperator = 'Equal' | 'Exists';
-export type Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction =
+export type Github__Com___Kloudlite___Api___Pkg___Types__SyncAction =
| 'APPLY'
| 'DELETE';
-export type Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState =
+export type Github__Com___Kloudlite___Api___Pkg___Types__SyncState =
| 'APPLIED_AT_AGENT'
+ | 'DELETED_AT_AGENT'
+ | 'DELETING_AT_AGENT'
| 'ERRORED_AT_AGENT'
| 'IDLE'
| 'IN_QUEUE'
- | 'RECEIVED_UPDATE_FROM_AGENT';
+ | 'RECEIVED_UPDATE_FROM_AGENT'
+ | 'UPDATED_AT_AGENT';
export type K8s__Io___Api___Core___V1__SecretType =
| 'bootstrap__kubernetes__io___token'
@@ -153,12 +156,6 @@ export type SearchManagedResources = {
text?: InputMaybe;
};
-export type SearchManagedServices = {
- isReady?: InputMaybe;
- markedForDeletion?: InputMaybe;
- text?: InputMaybe;
-};
-
export type SearchProjects = {
isReady?: InputMaybe;
markedForDeletion?: InputMaybe;
@@ -214,7 +211,12 @@ export type PaginationIn = {
per_page?: InputMaybe;
};
-export type ResType = 'cluster' | 'nodepool' | 'providersecret' | 'vpn_device';
+export type ResType =
+ | 'cluster'
+ | 'helm_release'
+ | 'nodepool'
+ | 'providersecret'
+ | 'vpn_device';
export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__ClusterSpecAvailabilityMode =
'dev' | 'HA';
@@ -222,12 +224,20 @@ export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__ClusterSp
export type Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider =
'aws' | 'azure' | 'do' | 'gcp';
-export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__AwsPoolType =
- 'ec2' | 'spot';
+export type K8s__Io___Api___Core___V1__NodeSelectorOperator =
+ | 'DoesNotExist'
+ | 'Exists'
+ | 'Gt'
+ | 'In'
+ | 'Lt'
+ | 'NotIn';
export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorOperator =
'DoesNotExist' | 'Exists' | 'In' | 'NotIn';
+export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__AwsPoolType =
+ 'ec2' | 'spot';
+
export type K8s__Io___Api___Core___V1__ConditionStatus =
| 'False'
| 'True'
@@ -259,6 +269,11 @@ export type SearchDomainEntry = {
text?: InputMaybe;
};
+export type SearchHelmRelease = {
+ isReady?: InputMaybe;
+ text?: InputMaybe;
+};
+
export type SearchNodepool = {
text?: InputMaybe;
};
@@ -496,23 +511,7 @@ export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcNamedRefI
apiVersion: Scalars['String']['input'];
kind: Scalars['String']['input'];
name: Scalars['String']['input'];
- };
-
-export type ManagedServiceIn = {
- displayName: Scalars['String']['input'];
- enabled?: InputMaybe;
- metadata?: InputMaybe;
- spec: Github__Com___Kloudlite___Operator___Apis___Crds___V1__ManagedServiceSpecIn;
-};
-
-export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ManagedServiceSpecIn =
- {
- serviceTemplate: Github__Com___Kloudlite___Operator___Apis___Crds___V1__ServiceTemplateIn;
- };
-
-export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ServiceTemplateIn =
- {
- spec: Scalars['Map']['input'];
+ namespace: Scalars['String']['input'];
};
export type ProjectIn = {
@@ -711,12 +710,137 @@ export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ClusterManage
namespace: Scalars['String']['input'];
};
+export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ManagedServiceSpecIn =
+ {
+ serviceTemplate: Github__Com___Kloudlite___Operator___Apis___Crds___V1__ServiceTemplateIn;
+ };
+
+export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ServiceTemplateIn =
+ {
+ apiVersion: Scalars['String']['input'];
+ kind: Scalars['String']['input'];
+ spec: Scalars['Map']['input'];
+ };
+
export type DomainEntryIn = {
clusterName: Scalars['String']['input'];
displayName: Scalars['String']['input'];
domainName: Scalars['String']['input'];
};
+export type HelmReleaseIn = {
+ displayName: Scalars['String']['input'];
+ metadata?: InputMaybe;
+ spec?: InputMaybe;
+};
+
+export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__HelmChartSpecIn =
+ {
+ chartName: Scalars['String']['input'];
+ chartRepo: Github__Com___Kloudlite___Operator___Apis___Crds___V1__ChartRepoIn;
+ chartVersion: Scalars['String']['input'];
+ jobVars?: InputMaybe;
+ postInstall?: InputMaybe;
+ postUninstall?: InputMaybe;
+ preInstall?: InputMaybe;
+ preUninstall?: InputMaybe;
+ values: Scalars['Map']['input'];
+ };
+
+export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ChartRepoIn =
+ {
+ name: Scalars['String']['input'];
+ url: Scalars['String']['input'];
+ };
+
+export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__JobVarsIn = {
+ affinity?: InputMaybe;
+ backOffLimit?: InputMaybe;
+ nodeSelector?: InputMaybe;
+ tolerations?: InputMaybe>;
+};
+
+export type K8s__Io___Api___Core___V1__AffinityIn = {
+ nodeAffinity?: InputMaybe;
+ podAffinity?: InputMaybe;
+ podAntiAffinity?: InputMaybe;
+};
+
+export type K8s__Io___Api___Core___V1__NodeAffinityIn = {
+ preferredDuringSchedulingIgnoredDuringExecution?: InputMaybe<
+ Array
+ >;
+ requiredDuringSchedulingIgnoredDuringExecution?: InputMaybe;
+};
+
+export type K8s__Io___Api___Core___V1__PreferredSchedulingTermIn = {
+ preference: K8s__Io___Api___Core___V1__NodeSelectorTermIn;
+ weight: Scalars['Int']['input'];
+};
+
+export type K8s__Io___Api___Core___V1__NodeSelectorTermIn = {
+ matchExpressions?: InputMaybe<
+ Array
+ >;
+ matchFields?: InputMaybe<
+ Array
+ >;
+};
+
+export type K8s__Io___Api___Core___V1__NodeSelectorRequirementIn = {
+ key: Scalars['String']['input'];
+ operator: K8s__Io___Api___Core___V1__NodeSelectorOperator;
+ values?: InputMaybe>;
+};
+
+export type K8s__Io___Api___Core___V1__NodeSelectorIn = {
+ nodeSelectorTerms: Array;
+};
+
+export type K8s__Io___Api___Core___V1__PodAffinityIn = {
+ preferredDuringSchedulingIgnoredDuringExecution?: InputMaybe<
+ Array
+ >;
+ requiredDuringSchedulingIgnoredDuringExecution?: InputMaybe<
+ Array
+ >;
+};
+
+export type K8s__Io___Api___Core___V1__WeightedPodAffinityTermIn = {
+ podAffinityTerm: K8s__Io___Api___Core___V1__PodAffinityTermIn;
+ weight: Scalars['Int']['input'];
+};
+
+export type K8s__Io___Api___Core___V1__PodAffinityTermIn = {
+ labelSelector?: InputMaybe;
+ namespaces?: InputMaybe>;
+ namespaceSelector?: InputMaybe;
+ topologyKey: Scalars['String']['input'];
+};
+
+export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorIn = {
+ matchExpressions?: InputMaybe<
+ Array
+ >;
+ matchLabels?: InputMaybe;
+};
+
+export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorRequirementIn =
+ {
+ key: Scalars['String']['input'];
+ operator: K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorOperator;
+ values?: InputMaybe>;
+ };
+
+export type K8s__Io___Api___Core___V1__PodAntiAffinityIn = {
+ preferredDuringSchedulingIgnoredDuringExecution?: InputMaybe<
+ Array
+ >;
+ requiredDuringSchedulingIgnoredDuringExecution?: InputMaybe<
+ Array
+ >;
+};
+
export type NodePoolIn = {
displayName: Scalars['String']['input'];
metadata?: InputMaybe;
@@ -802,8 +926,9 @@ export type VpnDeviceIn = {
export type Github__Com___Kloudlite___Operator___Apis___Wireguard___V1__DeviceSpecIn =
{
- accountName: Scalars['String']['input'];
- clusterName: Scalars['String']['input'];
+ cnameRecords?: InputMaybe<
+ Array
+ >;
deviceNamespace?: InputMaybe;
nodeSelector?: InputMaybe;
ports?: InputMaybe<
@@ -811,6 +936,12 @@ export type Github__Com___Kloudlite___Operator___Apis___Wireguard___V1__DeviceSp
>;
};
+export type Github__Com___Kloudlite___Operator___Apis___Wireguard___V1__CNameRecordIn =
+ {
+ host?: InputMaybe;
+ target?: InputMaybe;
+ };
+
export type Github__Com___Kloudlite___Operator___Apis___Wireguard___V1__PortIn =
{
port?: InputMaybe;
@@ -926,20 +1057,6 @@ export type K8s__Io___Api___Core___V1__ResourceClaimIn = {
name: Scalars['String']['input'];
};
-export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorIn = {
- matchExpressions?: InputMaybe<
- Array
- >;
- matchLabels?: InputMaybe;
-};
-
-export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorRequirementIn =
- {
- key: Scalars['String']['input'];
- operator: K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorOperator;
- values?: InputMaybe>;
- };
-
export type K8s__Io___Api___Core___V1__PersistentVolumeClaimStatusIn = {
accessModes?: InputMaybe>;
allocatedResources?: InputMaybe;
@@ -1134,11 +1251,11 @@ export type ConsoleGetProjectQuery = {
};
syncStatus: {
syncScheduledAt?: any;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
recordVersion: number;
lastSyncedAt?: any;
error?: string;
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
};
};
};
@@ -1193,14 +1310,6 @@ export type ConsoleListProjectsQuery = {
}>;
message?: { RawMessage?: any };
};
- syncStatus: {
- syncScheduledAt?: any;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- recordVersion: number;
- lastSyncedAt?: any;
- error?: string;
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- };
};
}>;
pageInfo: {
@@ -1263,9 +1372,7 @@ export type ConsoleListClustersQuery = {
syncScheduledAt?: any;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
error?: string;
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
};
status?: {
lastReconcileTime?: any;
@@ -1402,11 +1509,9 @@ export type ConsoleGetClusterQuery = {
}>;
};
syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
error?: string;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
syncScheduledAt?: any;
};
};
@@ -1575,14 +1680,6 @@ export type ConsoleGetNodePoolQuery = {
namespace: string;
}>;
};
- syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- error?: string;
- lastSyncedAt?: any;
- recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- syncScheduledAt?: any;
- };
};
};
@@ -1662,14 +1759,6 @@ export type ConsoleListNodePoolsQuery = {
namespace: string;
}>;
};
- syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- error?: string;
- lastSyncedAt?: any;
- recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- syncScheduledAt?: any;
- };
};
}>;
};
@@ -1718,41 +1807,6 @@ export type ConsoleUpdateWorkspaceMutation = {
core_updateWorkspace?: { id: string };
};
-export type ConsoleListWorkspacesQueryVariables = Exact<{
- project: ProjectId;
- search?: InputMaybe;
- pagination?: InputMaybe;
-}>;
-
-export type ConsoleListWorkspacesQuery = {
- core_listWorkspaces?: {
- totalCount: number;
- pageInfo: {
- startCursor?: string;
- hasPreviousPage?: boolean;
- hasNextPage?: boolean;
- endCursor?: string;
- };
- edges: Array<{
- node: {
- displayName: string;
- clusterName: string;
- updateTime: any;
- creationTime: any;
- metadata?: {
- name: string;
- namespace?: string;
- labels?: any;
- annotations?: any;
- };
- spec?: { targetNamespace: string; projectName: string };
- createdBy: { userEmail: string; userId: string; userName: string };
- lastUpdatedBy: { userEmail: string; userId: string; userName: string };
- };
- }>;
- };
-};
-
export type ConsoleGetEnvironmentQueryVariables = Exact<{
project: ProjectId;
name: Scalars['String']['input'];
@@ -1799,14 +1853,6 @@ export type ConsoleGetEnvironmentQuery = {
namespace: string;
}>;
};
- syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- error?: string;
- lastSyncedAt?: any;
- recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- syncScheduledAt?: any;
- };
};
};
@@ -1877,14 +1923,6 @@ export type ConsoleListEnvironmentsQuery = {
namespace: string;
}>;
};
- syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- error?: string;
- lastSyncedAt?: any;
- recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- syncScheduledAt?: any;
- };
};
}>;
pageInfo: {
@@ -2006,11 +2044,11 @@ export type ConsoleGetAppQuery = {
};
syncStatus: {
syncScheduledAt?: any;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
recordVersion: number;
lastSyncedAt?: any;
error?: string;
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
};
};
};
@@ -2050,11 +2088,11 @@ export type ConsoleListAppsQuery = {
};
syncStatus: {
syncScheduledAt?: any;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
recordVersion: number;
lastSyncedAt?: any;
error?: string;
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
};
};
}>;
@@ -2164,11 +2202,11 @@ export type ConsoleListConfigsQuery = {
}>;
};
syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
error?: string;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
syncScheduledAt?: any;
};
};
@@ -2241,11 +2279,11 @@ export type ConsoleListSecretsQuery = {
}>;
};
syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
error?: string;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
syncScheduledAt?: any;
};
};
@@ -2348,11 +2386,7 @@ export type ConsoleListVpnDevicesQuery = {
name: string;
namespace?: string;
};
- spec?: {
- accountName: string;
- clusterName: string;
- ports?: Array<{ port?: number; targetPort?: number }>;
- };
+ spec?: { ports?: Array<{ port?: number; targetPort?: number }> };
status?: {
checks?: any;
isReady: boolean;
@@ -2367,11 +2401,11 @@ export type ConsoleListVpnDevicesQuery = {
}>;
};
syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
error?: string;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
syncScheduledAt?: any;
};
};
@@ -2408,11 +2442,7 @@ export type ConsoleGetVpnDeviceQuery = {
name: string;
namespace?: string;
};
- spec?: {
- accountName: string;
- clusterName: string;
- ports?: Array<{ port?: number; targetPort?: number }>;
- };
+ spec?: { ports?: Array<{ port?: number; targetPort?: number }> };
status?: {
checks?: any;
isReady: boolean;
@@ -2427,11 +2457,11 @@ export type ConsoleGetVpnDeviceQuery = {
}>;
};
syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
error?: string;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
syncScheduledAt?: any;
};
wireguardConfig?: { value: string; encoding: string };
@@ -2546,286 +2576,62 @@ export type ConsoleDeleteAccountMembershipMutation = {
accounts_removeAccountMembership: boolean;
};
-export type ConsoleGetTemplateQueryVariables = Exact<{
- category: Scalars['String']['input'];
+export type ConsoleGetManagedResourceQueryVariables = Exact<{
+ project: ProjectId;
+ scope: WorkspaceOrEnvId;
name: Scalars['String']['input'];
}>;
-export type ConsoleGetTemplateQuery = {
- core_getManagedServiceTemplate?: {
- active: boolean;
- apiVersion?: string;
- description: string;
+export type ConsoleGetManagedResourceQuery = {
+ core_getManagedResource?: {
+ accountName: string;
+ apiVersion: string;
+ clusterName: string;
+ creationTime: any;
displayName: string;
- kind?: string;
- logoUrl: string;
- name: string;
- fields: Array<{
- defaultValue?: any;
- inputType: string;
- label: string;
- max?: number;
- min?: number;
- name: string;
- required?: boolean;
- unit?: string;
- }>;
- outputs: Array<{ description: string; label: string; name: string }>;
- resources: Array<{
- apiVersion?: string;
- description: string;
- displayName: string;
- kind?: string;
+ enabled?: boolean;
+ id: string;
+ kind: string;
+ markedForDeletion?: boolean;
+ recordVersion: number;
+ updateTime: any;
+ createdBy: { userEmail: string; userId: string; userName: string };
+ lastUpdatedBy: { userEmail: string; userId: string; userName: string };
+ metadata?: {
+ annotations?: any;
+ creationTimestamp: any;
+ deletionTimestamp?: any;
+ generation: number;
+ labels?: any;
name: string;
- fields: Array<{
- defaultValue?: any;
- inputType: string;
- label: string;
- max?: number;
- min?: number;
- name: string;
- required?: boolean;
- unit?: string;
- }>;
- outputs: Array<{ description: string; label: string; name: string }>;
- }>;
- };
-};
-
-export type ConsoleListTemplatesQueryVariables = Exact<{
- [key: string]: never;
-}>;
-
-export type ConsoleListTemplatesQuery = {
- core_listManagedServiceTemplates?: Array<{
- category: string;
- displayName: string;
- items: Array<{
- description: string;
- active: boolean;
- displayName: string;
- logoUrl: string;
- name: string;
- kind?: string;
- apiVersion?: string;
- fields: Array<{
- defaultValue?: any;
- inputType: string;
- label: string;
- max?: number;
- min?: number;
- name: string;
- required?: boolean;
- unit?: string;
- }>;
- outputs: Array<{ name: string; label: string; description: string }>;
- resources: Array<{
- description: string;
- displayName: string;
- name: string;
- kind?: string;
- apiVersion?: string;
- fields: Array<{
- defaultValue?: any;
- inputType: string;
- label: string;
- max?: number;
- min?: number;
- name: string;
- required?: boolean;
- unit?: string;
- }>;
- outputs: Array<{ description: string; label: string; name: string }>;
- }>;
- }>;
- }>;
-};
-
-export type ConsoleGetManagedServiceQueryVariables = Exact<{
- project: ProjectId;
- scope: WorkspaceOrEnvId;
- name: Scalars['String']['input'];
-}>;
-
-export type ConsoleGetManagedServiceQuery = {
- core_getManagedService?: {
- accountName: string;
- apiVersion: string;
- clusterName: string;
- creationTime: any;
- displayName: string;
- enabled?: boolean;
- id: string;
- kind: string;
- markedForDeletion?: boolean;
- recordVersion: number;
- updateTime: any;
- createdBy: { userEmail: string; userId: string; userName: string };
- lastUpdatedBy: { userEmail: string; userId: string; userName: string };
- metadata?: {
- annotations?: any;
- creationTimestamp: any;
- deletionTimestamp?: any;
- generation: number;
- labels?: any;
- name: string;
- namespace?: string;
- };
- spec: { serviceTemplate: { apiVersion: string; kind: string; spec: any } };
- status?: {
- checks?: any;
- isReady: boolean;
- lastReconcileTime?: any;
- message?: { RawMessage?: any };
- resources?: Array<{
- apiVersion: string;
- kind: string;
+ namespace?: string;
+ };
+ spec: {
+ resourceTemplate: {
+ apiVersion: string;
+ kind: string;
+ spec: any;
+ msvcRef: { name: string; kind: string; apiVersion: string };
+ };
+ };
+ status?: {
+ checks?: any;
+ isReady: boolean;
+ lastReconcileTime?: any;
+ message?: { RawMessage?: any };
+ resources?: Array<{
+ apiVersion: string;
+ kind: string;
name: string;
namespace: string;
}>;
};
syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
+ action: Github__Com___Kloudlite___Api___Pkg___Types__SyncAction;
error?: string;
lastSyncedAt?: any;
recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- syncScheduledAt?: any;
- };
- };
-};
-
-export type ConsoleListManagedServicesQueryVariables = Exact<{
- project: ProjectId;
- scope: WorkspaceOrEnvId;
-}>;
-
-export type ConsoleListManagedServicesQuery = {
- core_listManagedServices?: {
- totalCount: number;
- edges: Array<{
- cursor: string;
- node: {
- accountName: string;
- apiVersion: string;
- clusterName: string;
- creationTime: any;
- displayName: string;
- enabled?: boolean;
- id: string;
- kind: string;
- markedForDeletion?: boolean;
- recordVersion: number;
- updateTime: any;
- createdBy: { userEmail: string; userId: string; userName: string };
- lastUpdatedBy: { userEmail: string; userId: string; userName: string };
- metadata?: {
- annotations?: any;
- creationTimestamp: any;
- deletionTimestamp?: any;
- generation: number;
- labels?: any;
- name: string;
- namespace?: string;
- };
- spec: {
- serviceTemplate: { apiVersion: string; kind: string; spec: any };
- };
- status?: {
- checks?: any;
- isReady: boolean;
- lastReconcileTime?: any;
- message?: { RawMessage?: any };
- resources?: Array<{
- apiVersion: string;
- kind: string;
- name: string;
- namespace: string;
- }>;
- };
- syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- error?: string;
- lastSyncedAt?: any;
- recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
- syncScheduledAt?: any;
- };
- };
- }>;
- pageInfo: {
- endCursor?: string;
- hasNextPage?: boolean;
- hasPreviousPage?: boolean;
- startCursor?: string;
- };
- };
-};
-
-export type ConsoleCreateManagedServiceMutationVariables = Exact<{
- msvc: ManagedServiceIn;
-}>;
-
-export type ConsoleCreateManagedServiceMutation = {
- core_createManagedService?: { id: string };
-};
-
-export type ConsoleGetManagedResourceQueryVariables = Exact<{
- project: ProjectId;
- scope: WorkspaceOrEnvId;
- name: Scalars['String']['input'];
-}>;
-
-export type ConsoleGetManagedResourceQuery = {
- core_getManagedResource?: {
- accountName: string;
- apiVersion: string;
- clusterName: string;
- creationTime: any;
- displayName: string;
- enabled?: boolean;
- id: string;
- kind: string;
- markedForDeletion?: boolean;
- recordVersion: number;
- updateTime: any;
- createdBy: { userEmail: string; userId: string; userName: string };
- lastUpdatedBy: { userEmail: string; userId: string; userName: string };
- metadata?: {
- annotations?: any;
- creationTimestamp: any;
- deletionTimestamp?: any;
- generation: number;
- labels?: any;
- name: string;
- namespace?: string;
- };
- spec: {
- resourceTemplate: {
- apiVersion: string;
- kind: string;
- spec: any;
- msvcRef: { name: string; kind: string; apiVersion: string };
- };
- };
- status?: {
- checks?: any;
- isReady: boolean;
- lastReconcileTime?: any;
- message?: { RawMessage?: any };
- resources?: Array<{
- apiVersion: string;
- kind: string;
- name: string;
- namespace: string;
- }>;
- };
- syncStatus: {
- action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction;
- error?: string;
- lastSyncedAt?: any;
- recordVersion: number;
- state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState;
+ state: Github__Com___Kloudlite___Api___Pkg___Types__SyncState;
syncScheduledAt?: any;
};
};
@@ -3568,6 +3374,339 @@ export type ConsoleGetBuildRunQuery = {
};
};
+export type ConsoleGetClusterMSvQueryVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ name: Scalars['String']['input'];
+}>;
+
+export type ConsoleGetClusterMSvQuery = {
+ infra_getClusterManagedService?: {
+ displayName: string;
+ creationTime: any;
+ clusterName: string;
+ markedForDeletion?: boolean;
+ updateTime: any;
+ createdBy: { userEmail: string; userId: string; userName: string };
+ lastUpdatedBy: { userEmail: string; userId: string; userName: string };
+ metadata?: {
+ annotations?: any;
+ creationTimestamp: any;
+ deletionTimestamp?: any;
+ generation: number;
+ labels?: any;
+ name: string;
+ namespace?: string;
+ };
+ spec?: {
+ namespace: string;
+ msvcSpec: {
+ serviceTemplate: { apiVersion: string; kind: string; spec: any };
+ };
+ };
+ status?: {
+ checks?: any;
+ isReady: boolean;
+ lastReadyGeneration?: number;
+ lastReconcileTime?: any;
+ message?: { RawMessage?: any };
+ resources?: Array<{
+ apiVersion: string;
+ kind: string;
+ name: string;
+ namespace: string;
+ }>;
+ };
+ };
+};
+
+export type ConsoleCreateClusterMSvMutationVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ service: ClusterManagedServiceIn;
+}>;
+
+export type ConsoleCreateClusterMSvMutation = {
+ infra_createClusterManagedService?: { id: string };
+};
+
+export type ConsoleUpdateClusterMSvMutationVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ service: ClusterManagedServiceIn;
+}>;
+
+export type ConsoleUpdateClusterMSvMutation = {
+ infra_updateClusterManagedService?: { id: string };
+};
+
+export type ConsoleListClusterMSvsQueryVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+}>;
+
+export type ConsoleListClusterMSvsQuery = {
+ infra_listClusterManagedServices?: {
+ totalCount: number;
+ edges: Array<{
+ cursor: string;
+ node: {
+ creationTime: any;
+ displayName: string;
+ markedForDeletion?: boolean;
+ updateTime: any;
+ createdBy: { userEmail: string; userId: string; userName: string };
+ lastUpdatedBy: { userEmail: string; userId: string; userName: string };
+ metadata?: { name: string };
+ spec?: {
+ msvcSpec: {
+ serviceTemplate: { apiVersion: string; kind: string; spec: any };
+ };
+ };
+ status?: {
+ checks?: any;
+ isReady: boolean;
+ lastReadyGeneration?: number;
+ lastReconcileTime?: any;
+ message?: { RawMessage?: any };
+ resources?: Array<{
+ apiVersion: string;
+ kind: string;
+ name: string;
+ namespace: string;
+ }>;
+ };
+ };
+ }>;
+ pageInfo: {
+ endCursor?: string;
+ hasNextPage?: boolean;
+ hasPreviousPage?: boolean;
+ startCursor?: string;
+ };
+ };
+};
+
+export type ConsoleDeleteClusterMSvMutationVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ serviceName: Scalars['String']['input'];
+}>;
+
+export type ConsoleDeleteClusterMSvMutation = {
+ infra_deleteClusterManagedService: boolean;
+};
+
+export type ConsoleGetMSvTemplateQueryVariables = Exact<{
+ category: Scalars['String']['input'];
+ name: Scalars['String']['input'];
+}>;
+
+export type ConsoleGetMSvTemplateQuery = {
+ infra_getManagedServiceTemplate?: {
+ active: boolean;
+ apiVersion?: string;
+ description: string;
+ displayName: string;
+ kind?: string;
+ logoUrl: string;
+ name: string;
+ fields: Array<{
+ defaultValue?: any;
+ inputType: string;
+ label: string;
+ max?: number;
+ min?: number;
+ name: string;
+ required?: boolean;
+ unit?: string;
+ displayUnit?: string;
+ multiplier?: number;
+ }>;
+ outputs: Array<{ description: string; label: string; name: string }>;
+ resources: Array<{
+ apiVersion?: string;
+ description: string;
+ displayName: string;
+ kind?: string;
+ name: string;
+ }>;
+ };
+};
+
+export type ConsoleListMSvTemplatesQueryVariables = Exact<{
+ [key: string]: never;
+}>;
+
+export type ConsoleListMSvTemplatesQuery = {
+ infra_listManagedServiceTemplates?: Array<{
+ category: string;
+ displayName: string;
+ items: Array<{
+ active: boolean;
+ apiVersion?: string;
+ description: string;
+ displayName: string;
+ kind?: string;
+ logoUrl: string;
+ name: string;
+ fields: Array<{
+ defaultValue?: any;
+ inputType: string;
+ label: string;
+ max?: number;
+ min?: number;
+ name: string;
+ required?: boolean;
+ unit?: string;
+ displayUnit?: string;
+ multiplier?: number;
+ }>;
+ outputs: Array<{ description: string; label: string; name: string }>;
+ resources: Array<{
+ apiVersion?: string;
+ description: string;
+ displayName: string;
+ kind?: string;
+ name: string;
+ }>;
+ }>;
+ }>;
+};
+
+export type ConsoleGetHelmChartQueryVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ name: Scalars['String']['input'];
+}>;
+
+export type ConsoleGetHelmChartQuery = {
+ infra_getHelmRelease?: {
+ creationTime: any;
+ displayName: string;
+ markedForDeletion?: boolean;
+ updateTime: any;
+ createdBy: { userEmail: string; userId: string; userName: string };
+ lastUpdatedBy: { userEmail: string; userId: string; userName: string };
+ metadata?: {
+ annotations?: any;
+ creationTimestamp: any;
+ deletionTimestamp?: any;
+ generation: number;
+ labels?: any;
+ name: string;
+ namespace?: string;
+ };
+ spec?: {
+ chartName: string;
+ chartVersion: string;
+ postInstall?: string;
+ postUninstall?: string;
+ preInstall?: string;
+ preUninstall?: string;
+ values: any;
+ chartRepo: { name: string; url: string };
+ };
+ status?: {
+ checks?: any;
+ isReady: boolean;
+ lastReadyGeneration?: number;
+ lastReconcileTime?: any;
+ releaseNotes: string;
+ releaseStatus: string;
+ message?: { RawMessage?: any };
+ resources?: Array<{
+ apiVersion: string;
+ kind: string;
+ name: string;
+ namespace: string;
+ }>;
+ };
+ };
+};
+
+export type ConsoleListHelmChartQueryVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+}>;
+
+export type ConsoleListHelmChartQuery = {
+ infra_listHelmReleases?: {
+ totalCount: number;
+ edges: Array<{
+ cursor: string;
+ node: {
+ creationTime: any;
+ displayName: string;
+ markedForDeletion?: boolean;
+ updateTime: any;
+ createdBy: { userEmail: string; userId: string; userName: string };
+ lastUpdatedBy: { userEmail: string; userId: string; userName: string };
+ metadata?: {
+ annotations?: any;
+ creationTimestamp: any;
+ deletionTimestamp?: any;
+ generation: number;
+ labels?: any;
+ name: string;
+ namespace?: string;
+ };
+ spec?: {
+ chartName: string;
+ chartVersion: string;
+ postInstall?: string;
+ postUninstall?: string;
+ preInstall?: string;
+ preUninstall?: string;
+ values: any;
+ chartRepo: { name: string; url: string };
+ };
+ status?: {
+ checks?: any;
+ isReady: boolean;
+ lastReadyGeneration?: number;
+ lastReconcileTime?: any;
+ releaseNotes: string;
+ releaseStatus: string;
+ message?: { RawMessage?: any };
+ resources?: Array<{
+ apiVersion: string;
+ kind: string;
+ name: string;
+ namespace: string;
+ }>;
+ };
+ };
+ }>;
+ pageInfo: {
+ endCursor?: string;
+ hasNextPage?: boolean;
+ hasPreviousPage?: boolean;
+ startCursor?: string;
+ };
+ };
+};
+
+export type ConsoleCreateHelmChartMutationVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ release: HelmReleaseIn;
+}>;
+
+export type ConsoleCreateHelmChartMutation = {
+ infra_createHelmRelease?: { id: string };
+};
+
+export type ConsoleUpdateHelmChartMutationVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ release: HelmReleaseIn;
+}>;
+
+export type ConsoleUpdateHelmChartMutation = {
+ infra_updateHelmRelease?: { id: string };
+};
+
+export type ConsoleDeleteHelmChartMutationVariables = Exact<{
+ clusterName: Scalars['String']['input'];
+ releaseName: Scalars['String']['input'];
+}>;
+
+export type ConsoleDeleteHelmChartMutation = {
+ infra_deleteHelmRelease: boolean;
+};
+
export type AuthCli_GetKubeConfigQueryVariables = Exact<{
name: Scalars['String']['input'];
}>;
From 20384c86e5381b024baed3bbf9cad40a3ce628f9 Mon Sep 17 00:00:00 2001
From: Abdhesh Nayak
Date: Wed, 3 Jan 2024 15:23:31 +0530
Subject: [PATCH 05/10] :construction: Wip
---
.../helpers/execute-query-with-context.ts | 11 ++++---
lib/server/helpers/rpc/index.ts | 3 +-
src/apps/auth/server/gql/cli-queries.ts | 4 +--
src/apps/console/components/commons.tsx | 6 ++--
.../$project+/$scope+/$workspace+/_layout.tsx | 16 ++++------
.../$scope+/$workspace+/apps/route.tsx | 1 +
.../$project+/environments/resources.tsx | 4 ++-
src/apps/console/server/r-utils/common.ts | 32 +++++++++----------
src/apps/console/utils/commons.tsx | 6 ++--
9 files changed, 44 insertions(+), 39 deletions(-)
diff --git a/lib/server/helpers/execute-query-with-context.ts b/lib/server/helpers/execute-query-with-context.ts
index d80719290..c95d26047 100644
--- a/lib/server/helpers/execute-query-with-context.ts
+++ b/lib/server/helpers/execute-query-with-context.ts
@@ -10,7 +10,6 @@ import {
IGqlReturn,
NN,
} from '../../types/common';
-import logger from '../../client/helpers/log';
const parseCookie = (cookieString: string) => {
const [cookie] = cookieString.split(';');
@@ -44,8 +43,9 @@ export const ExecuteQueryWithContext = (
def?: any
): IExecutorResp {
const logId = uuid();
- const apiName = `[#${logId.substring(0, 5)}] ${(q as any)?.definitions[0]?.selectionSet?.selections[0]?.name?.value || ''
- }`;
+ const apiName = `[#${logId.substring(0, 5)}] ${
+ (q as any)?.definitions[0]?.selectionSet?.selections[0]?.name?.value || ''
+ }`;
const res: IExecutorResp = async (variables) => {
const { transformer } = formatter;
@@ -93,8 +93,9 @@ export const ExecuteQueryWithContext = (
throw new Error(
e.reduce((acc, curr) => {
- return `${acc}\n\n1. ${curr.name ? `${curr.name}:` : ''}:${curr.message
- }${curr.stack ? `\n${curr.stack}` : ''}`;
+ return `${acc}\n\n1. ${curr.name ? `${curr.name}:` : ''}:${
+ curr.message
+ }${curr.stack ? `\n${curr.stack}` : ''}`;
}, 'Errors:')
);
}
diff --git a/lib/server/helpers/rpc/index.ts b/lib/server/helpers/rpc/index.ts
index bc2f60933..5063049ee 100644
--- a/lib/server/helpers/rpc/index.ts
+++ b/lib/server/helpers/rpc/index.ts
@@ -1,4 +1,5 @@
import axios from 'axios';
+import logger from '~/root/lib/client/helpers/log';
import { MapType } from '~/root/lib/types/common';
export interface IMiddlewareResponse {
@@ -42,7 +43,7 @@ export const withRPC = (
const response = await method(...(req.body.args || []));
res.json(response);
} catch (err) {
- console.log('here');
+ logger.trace('ErrorIn:', req.body.method, (err as Error).message);
next(err as Error);
}
};
diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts
index 35961ffba..bbd7905e1 100644
--- a/src/apps/auth/server/gql/cli-queries.ts
+++ b/src/apps/auth/server/gql/cli-queries.ts
@@ -125,7 +125,7 @@ export const cliQueries = (executor: IExecutor) => ({
}
`,
{
- transformer: (data: any) => data,
+ transformer: (data: any) => data.core_listApps,
vars: (_: any) => {},
}
),
@@ -158,7 +158,7 @@ export const cliQueries = (executor: IExecutor) => ({
}
`,
{
- transformer: (data: any) => data,
+ transformer: (data: any) => data.core_listSecrets,
vars: (_: any) => {},
}
),
diff --git a/src/apps/console/components/commons.tsx b/src/apps/console/components/commons.tsx
index d8e82b8e9..1241d53d6 100644
--- a/src/apps/console/components/commons.tsx
+++ b/src/apps/console/components/commons.tsx
@@ -5,8 +5,8 @@ import { WorkspacesLogo } from '~/components/branding/workspace-logo';
import useClipboard from '~/root/lib/client/hooks/use-clipboard';
import { generateKey, titleCase } from '~/components/utils';
import {
- Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState as SyncState,
- Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction as SyncAction,
+ Github__Com___Kloudlite___Api___Pkg___Types__SyncState as SyncState,
+ Github__Com___Kloudlite___Api___Pkg___Types__SyncAction as SyncAction,
} from '~/root/src/generated/gql/server';
import Tooltip from '~/components/atoms/tooltip';
import { Link } from '@remix-run/react';
@@ -72,7 +72,7 @@ export const CopyButton = ({
title: ReactNode;
value: string;
}) => {
- const [copyIcon, setCopyIcon] = useState();
+ const [_, setCopyIcon] = useState();
const { copy } = useClipboard({
onSuccess: () => {
setTimeout(() => {
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx
index 2a9b604b7..41110de38 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/_layout.tsx
@@ -32,12 +32,12 @@ import {
ensureClusterSet,
} from '~/console/server/utils/auth-utils';
import logger from '~/root/lib/client/helpers/log';
-import { useAPIClient } from '~/root/lib/client/hooks/api-provider';
import { SubNavDataProvider } from '~/root/lib/client/hooks/use-create-subnav-action';
import useDebounce from '~/root/lib/client/hooks/use-debounce';
import { IRemixCtx } from '~/root/lib/types/common';
import { Truncate, handleError } from '~/root/lib/utils/common';
import { IMSvTemplates } from '~/console/server/gql/queries/managed-templates-queries';
+import { useConsoleApi } from '~/console/server/gql/api-provider';
import { IProjectContext } from '../../_layout';
export interface IWorkspaceContext extends IProjectContext {
@@ -114,7 +114,7 @@ const CurrentBreadcrum = ({ workspace }: { workspace: IWorkspace }) => {
const [workspaces, setWorkspaces] = useState([]);
const [environments, setEnvironments] = useState([]);
- const api = useAPIClient();
+ const api = useConsoleApi();
const [search, setSearch] = useState('');
const [isLoading, setIsLoading] = useState(false);
@@ -123,13 +123,9 @@ const CurrentBreadcrum = ({ workspace }: { workspace: IWorkspace }) => {
async () => {
ensureClusterClientSide(params);
ensureAccountClientSide(params);
- const listApi =
- activeTab === SCOPE.ENVIRONMENT
- ? api.listEnvironments
- : api.listWorkspaces;
try {
setIsLoading(true);
- const { data, errors } = await listApi({
+ const { data, errors } = await api.listEnvironments({
project: getScopeAndProjectQuery({ params }).project,
});
if (errors) {
@@ -137,9 +133,11 @@ const CurrentBreadcrum = ({ workspace }: { workspace: IWorkspace }) => {
}
if (activeTab === SCOPE.ENVIRONMENT) {
- setEnvironments(parseNodes(data));
+ setEnvironments(
+ parseNodes(data).filter((e) => e.spec?.isEnvironment)
+ );
} else {
- setWorkspaces(parseNodes(data));
+ setWorkspaces(parseNodes(data).filter((e) => !e.spec?.isEnvironment));
}
} catch (err) {
handleError(err);
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/apps/route.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/apps/route.tsx
index 1c2b56405..959d31fce 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/apps/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/apps/route.tsx
@@ -30,6 +30,7 @@ export const loader = async (ctx: IRemixCtx) => {
search: getSearch(ctx),
});
if (errors) {
+ console.error(errors);
throw errors[0];
}
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/resources.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/resources.tsx
index 2f1c22cc8..1398181ae 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/resources.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/environments/resources.tsx
@@ -102,7 +102,9 @@ const ListView = ({ items }: { items: BaseType[] }) => {
(resources: IparseNodes | undefined): T[] =>
type IparseName =
| {
- metadata?: {
- name: string;
- };
- }
+ metadata?: {
+ name: string;
+ };
+ }
| undefined
| null;
@@ -87,10 +87,10 @@ export const parseName = (resource: IparseName, ensure = false) => {
type IparseNamespace =
| {
- metadata: {
- namespace: string;
- };
- }
+ metadata: {
+ namespace: string;
+ };
+ }
| undefined
| null;
@@ -99,10 +99,10 @@ export const parseNamespace = (resource: IparseNamespace) =>
type IparseTargetNs =
| {
- spec?: {
- targetNamespace: string;
- };
- }
+ spec?: {
+ targetNamespace: string;
+ };
+ }
| undefined
| null;
@@ -216,11 +216,11 @@ export interface Status {
export interface SyncStatus {
syncScheduledAt?: any;
- state: SyncStatusState;
+ state: SyncState;
recordVersion: number;
lastSyncedAt?: any;
error?: string;
- action: SyncStatusAction;
+ action: SyncAction;
}
interface IStatusProps {
diff --git a/src/apps/console/utils/commons.tsx b/src/apps/console/utils/commons.tsx
index 03c938c13..0127f8ce5 100644
--- a/src/apps/console/utils/commons.tsx
+++ b/src/apps/console/utils/commons.tsx
@@ -1,6 +1,5 @@
import { AWSlogoFill } from '@jengaicons/react';
import { Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider as CloudProviders } from '~/root/src/generated/gql/server';
-import { json } from 'react-router-dom';
import {
IMSvTemplate,
IMSvTemplates,
@@ -130,6 +129,9 @@ export const renderCloudProvider = ({
export const flatMap = (data: any) => {
const keys = data.split('.');
- const jsonObject = keys.reduceRight((acc, key) => ({ [key]: acc }), null);
+ const jsonObject = keys.reduceRight(
+ (acc: any, key: string) => ({ [key]: acc }),
+ null
+ );
return jsonObject;
};
From 00e237ae835d6b0edd98ed33f0dfa8195451b282 Mon Sep 17 00:00:00 2001
From: Bikash
Date: Wed, 3 Jan 2024 17:02:40 +0530
Subject: [PATCH 06/10] Fixed config-secrets page issue
---
.../$workspace+/config.$config/route.tsx | 32 +-
.../$workspace+/secret.$secret/handle.tsx | 8 +-
.../$workspace+/secret.$secret/resources.tsx | 3 +
.../$workspace+/secret.$secret/route.tsx | 353 +++++++++---------
4 files changed, 202 insertions(+), 194 deletions(-)
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/config.$config/route.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/config.$config/route.tsx
index b83757a56..7457d1f48 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/config.$config/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/config.$config/route.tsx
@@ -75,20 +75,24 @@ const ConfigBody = ({ config }: { config: IConfig }) => {
}, []);
useEffect(() => {
- setModifiedItems(
- Object.entries(originalItems).reduce((acc, [key, value]) => {
- return {
- ...acc,
- [key]: {
- value,
- delete: false,
- edit: false,
- insert: false,
- newvalue: null,
- },
- };
- }, {})
- );
+ try {
+ setModifiedItems(
+ Object.entries(originalItems).reduce((acc, [key, value]) => {
+ return {
+ ...acc,
+ [key]: {
+ value,
+ delete: false,
+ edit: false,
+ insert: false,
+ newvalue: null,
+ },
+ };
+ }, {})
+ );
+ } catch {
+ //
+ }
}, [originalItems]);
const changesCount = () => {
diff --git a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/secret.$secret/handle.tsx b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/secret.$secret/handle.tsx
index 35d434398..ff80afbf5 100644
--- a/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/secret.$secret/handle.tsx
+++ b/src/apps/console/routes/_main+/$account+/$cluster+/$project+/$scope+/$workspace+/secret.$secret/handle.tsx
@@ -50,7 +50,7 @@ export const updateSecret = async ({
}
};
-export const ManageSecretDialog = ({
+const Handle = ({
show,
setShow,
onSubmit,
@@ -92,7 +92,7 @@ export const ManageSecretDialog = ({
}}
>
Add new entry
-