Skip to content

Commit

Permalink
Merge pull request #109 from kloudlite/release-v1.0.3
Browse files Browse the repository at this point in the history
Release v1.0.3
  • Loading branch information
abdheshnayak authored Mar 1, 2024
2 parents 2475336 + e42e05d commit 8c44eb8
Show file tree
Hide file tree
Showing 71 changed files with 1,608 additions and 1,113 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
app:
- auth
- console
- website
#- website
include:
- app: auth
dockerFile: Dockerfile
- app: console
dockerFile: Dockerfile
- app: website
dockerFile: Dockerfile.devdoc
#- app: website
#dockerFile: Dockerfile.devdoc

runs-on: ubuntu-latest
name: Deploy to Docker Image
Expand Down
7 changes: 7 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ tasks:
"vision")
URL_SUFFIX="-vision"
;;
"nxtcoder17")
URL_SUFFIX="-mohit"
;;
"piyush")
URL_SUFFIX="-piyush"
;;
*)
Expand Down
7 changes: 7 additions & 0 deletions fake-data-generator/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const types: string[] = [
'ConsoleListManagedResourceQuery',
'ConsoleListHelmChartQuery',
'ConsoleListConsoleVpnDevices',
'ConsoleListProjectMSvsQuery',
'ConsoleListMSvTemplatesQuery',
'ConsoleListRoutersQuery',
'ConsoleListManagedResourcesQuery',
'ConsoleListDigestQuery',
'ConsoleListBuildsQuery',
'ConsoleListBuildRunsQuery',
];

async function fake(files: string[], types: string[] = []) {
Expand Down
9 changes: 5 additions & 4 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ query consoleGetCluster($name: String!) {
aws {
k3sMasters {
iamInstanceProfileRole
imageId
imageSSHUsername
instanceType
nodes
nvidiaGpuEnabled
Expand Down Expand Up @@ -590,8 +588,6 @@ query consoleGetNodePool($clusterName: String!, $poolName: String!) {
nodes
}
iamInstanceProfileRole
imageId
imageSSHUsername
nvidiaGpuEnabled
poolType
rootVolumeSize
Expand Down Expand Up @@ -777,6 +773,11 @@ query consoleGetEnvironment($projectName: String!, $name: String!) {
projectName
spec {
projectName
routing {
mode
privateIngressClass
publicIngressClass
}
targetNamespace
}
status {
Expand Down
2 changes: 1 addition & 1 deletion lib/client/helpers/socket/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface ISocketResp<T = any> {
}

type IData = {
event?: string;
event?: 'subscribe' | 'unsubscribe';
id: string;
};

Expand Down
36 changes: 36 additions & 0 deletions lib/client/helpers/socket/useWatch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useEffect } from 'react';
import { ISocketResp, useSubscribe } from './context';
import { useReload } from '../reloader';

export const useSocketWatch = (
onUpdate: (v: ISocketResp<any>[]) => void,
topic: string
) => {
const { responses, subscribed } = useSubscribe(
{
for: 'resource-update',
data: {
id: topic,
respath: topic,
},
},
[]
);

useEffect(() => {
if (subscribed) {
onUpdate(responses);
}
}, [responses]);
};

export const useWatchReload = (topic: string) => {
const reloadPage = useReload();
useSocketWatch((rd) => {
console.log(rd);
if (rd.find((v) => v.id === topic)) {
console.log('reloading due to watch event', rd);
reloadPage();
}
}, topic);
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@codemirror/legacy-modes": "^6.3.3",
"@jengaicons/react": "^1.3.0",
"@mdx-js/react": "^2.3.0",
"@oshq/react-select": "^1.3.3",
"@oshq/react-select": "^1.4.1",
"@radix-ui/primitive": "^1.0.1",
"@radix-ui/react-alert-dialog": "1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions src/apps/console/components/commons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ import {
} from '~/root/src/generated/gql/server';
import Tooltip from '~/components/atoms/tooltip';
import { Link } from '@remix-run/react';
import { Button, IButton } from '~/components/atoms/button';
import { ListItem } from './console-list-components';
import {
parseUpdateOrCreatedBy,
parseUpdateOrCreatedOn,
} from '../server/r-utils/common';
import {
ArrowLeft,
ArrowRight,
Pencil,
GitBranchFill,
GitlabLogoFill,
GithubLogoFill,
} from './icons';
import { IGIT_PROVIDERS } from '../hooks/use-git';

export const BlackProdLogo = ({ size = 16 }) => {
return <ProdLogo color="currentColor" size={size} />;
Expand Down Expand Up @@ -232,3 +242,107 @@ export const SubHeaderTitle = ({
</div>
);
};

type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;

export const BottomNavigation = ({
primaryButton,
secondaryButton,
}: {
primaryButton?: Optional<IButton, 'content'>;
secondaryButton?: Optional<IButton, 'content'>;
}) => {
return (
<div className="flex flex-row gap-3xl items-center">
{secondaryButton && (
<Button
prefix={<ArrowLeft />}
variant="outline"
content="Back"
size="lg"
{...{ ...secondaryButton }}
/>
)}
{primaryButton && (
<Button
suffix={<ArrowRight />}
variant="primary"
content="Next"
size="lg"
{...primaryButton}
/>
)}
</div>
);
};

interface IReviewComponent {
title: string;
children: ReactNode;
onEdit: () => void;
canEdit?: boolean;
}
export const ReviewComponent = ({
title = '',
children,
onEdit,
canEdit = true,
}: IReviewComponent) => {
return (
<div className="flex flex-col gap-2xl pb-3xl">
<div className="flex flex-row items-center">
<span className="text-text-soft bodyMd flex-1">{title}</span>
{canEdit && (
<button
type="button"
aria-label="edit"
className="text-icon-soft"
onClick={onEdit}
>
<Pencil size={16} />
</button>
)}
</div>
{children}
</div>
);
};

export const GitDetail = ({
provider,
repository,
branch,
onEdit,
}: {
provider: IGIT_PROVIDERS;
repository: string;
branch: string;
onEdit?: (step?: number) => void;
}) => {
const gitIconSize = 16;
return (
<ReviewComponent title="Source details" onEdit={() => onEdit?.(1)}>
<div className="flex flex-col p-xl gap-lg rounded border border-border-default flex-1 overflow-hidden">
<div className="flex flex-col gap-md">
<div className="bodyMd-medium text-text-default">Source</div>
<div className="flex flex-row items-center gap-3xl bodySm">
<div className="flex flex-row items-center gap-xl">
{provider === 'github' ? (
<GithubLogoFill size={gitIconSize} />
) : (
<GitlabLogoFill size={gitIconSize} />
)}
<span>
{repository.replace('https://', '').replace('.git', '')}
</span>
</div>
<div className="flex flex-row items-center gap-xl">
<GitBranchFill size={gitIconSize} />
<span>{branch}</span>
</div>
</div>
</div>
</div>
</ReviewComponent>
);
};
13 changes: 2 additions & 11 deletions src/apps/console/components/git.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import { useAppend, useMapper } from '~/components/utils';
import { ReactNode, useEffect, useState } from 'react';
import { AnimatePresence, motion } from 'framer-motion';
import { Button } from '~/components/atoms/button';
import { useReload } from '~/root/lib/client/helpers/reloader';
import { useLocation } from '@remix-run/react';
import { ILoginUrls, ILogins } from '../server/gql/queries/git-queries';
import Pulsable from './pulsable';
import useGit, { IGIT_PROVIDERS } from '../hooks/use-git';
Expand Down Expand Up @@ -320,7 +318,7 @@ const Git = ({
size="lg"
valueRender={valueRender}
options={async () => accountsModified}
value={{ label: org, value: org }}
value={org}
onChange={(res) => {
switch (res.value) {
case extraAddOption:
Expand Down Expand Up @@ -434,14 +432,7 @@ const Git = ({
<Select
label="Select branch"
size="lg"
value={
branch && !showProviderOverlay
? {
label: branch,
value: branch,
}
: undefined
}
value={branch && !showProviderOverlay ? branch : undefined}
disabled={!repo || showProviderOverlay}
placeholder="Select a branch"
options={async () => [
Expand Down
21 changes: 21 additions & 0 deletions src/apps/console/components/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {
ArrowLeftFill,
ArrowRightFill,
Plus,
Trash,
PencilLine,
GithubLogoFill,
GitBranchFill,
GitlabLogoFill,
} from '@jengaicons/react';

export {
ArrowLeftFill as ArrowLeft,
ArrowRightFill as ArrowRight,
Plus,
Trash,
PencilLine as Pencil,
GithubLogoFill,
GitlabLogoFill,
GitBranchFill,
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArrowLeft } from '@jengaicons/react';
import { Link } from '@remix-run/react';
import { ReactNode } from 'react';
import { Button } from '~/components/atoms/button';
import { ArrowLeft } from '~/console/components/icons';

type ITitleSection = {
title: ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/apps/console/components/sync-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const SyncStatus = ({ item }: { item: IStatusMeta }) => {
return null;
};

export type IStatus = 'deleting' | 'notready' | 'syncing' | 'none';
export type IStatus = 'deleting' | 'notready' | 'syncing' | 'ready';
type IResourceType = 'nodepool';

export const parseStatus = ({
Expand All @@ -173,7 +173,7 @@ export const parseStatus = ({
item: IStatusMeta;
type?: IResourceType;
}) => {
let status: IStatus = 'none';
let status: IStatus = 'ready';

if (item.markedForDeletion) {
status = 'deleting';
Expand Down
Loading

0 comments on commit 8c44eb8

Please sign in to comment.