Skip to content

Commit

Permalink
Merge branch 'update/multi-tanency' into webinar/registration
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtcoder19 committed Sep 17, 2024
2 parents 372bfdd + b7244f6 commit 5d47dcb
Show file tree
Hide file tree
Showing 15 changed files with 211 additions and 68 deletions.
35 changes: 18 additions & 17 deletions lib/configs/base-url.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,26 @@ const getClientEnv = (env) => {
MANAGE_GITLAB_URL,
MANAGE_GITHUB_URL,
GITHUB_APP_NAME,
COOKIE_DOMAIN,
} = env;
return `
${BASE_URL ? `window.BASE_URL = ${`'${BASE_URL}'`}` : ''}
${
NODE_ENV === 'development'
? `window.DEVELOPER = ${`'${DEVELOPER}'`}`
: `window.NODE_ENV = ${`'${NODE_ENV}'`}`
}
${NODE_ENV === 'development'
? `window.DEVELOPER = ${`'${DEVELOPER}'`}`
: `window.NODE_ENV = ${`'${NODE_ENV}'`}`
}
${URL_SUFFIX ? `window.URL_SUFFIX = ${`'${URL_SUFFIX}'`}` : ''}
${REGISTRY_URL ? `window.REGISTRY_URL = ${`'${REGISTRY_URL}'`}` : ''}
${
MANAGE_GITHUB_URL
? `window.MANAGE_GITHUB_URL = ${`'${MANAGE_GITHUB_URL}'`}`
: ''
}
${
MANAGE_GITLAB_URL
? `window.MANAGE_GITLAB_URL = ${`'${MANAGE_GITLAB_URL}'`}`
: ''
}
${MANAGE_GITHUB_URL
? `window.MANAGE_GITHUB_URL = ${`'${MANAGE_GITHUB_URL}'`}`
: ''
}
${MANAGE_GITLAB_URL
? `window.MANAGE_GITLAB_URL = ${`'${MANAGE_GITLAB_URL}'`}`
: ''
}
${GITHUB_APP_NAME ? `window.GITHUB_APP_NAME = ${`'${GITHUB_APP_NAME}'`}` : ''}
`;
${COOKIE_DOMAIN ? `window.COOKIE_DOMAIN = ${`'${COOKIE_DOMAIN}'`}` : ''} `;
};

const getServerEnv = () => {
Expand Down Expand Up @@ -58,6 +56,9 @@ const getServerEnv = () => {
...(process.env.GITHUB_APP_NAME
? { GITHUB_APP_NAME: process.env.GITHUB_APP_NAME }
: {}),
...(process.env.COOKIE_DOMAIN
? { COOKIE_DOMAIN: process.env.COOKIE_DOMAIN }
: {}),
};
};

Expand Down Expand Up @@ -100,7 +101,7 @@ const baseUrls = () => {
return window.REGISTRY_URL;
}
return process.env.REGISTRY_URL;
})() || `registry.${bUrl}`;
})() || `registry.${bUrl} `;

const gitEnvs = (() => {
if (typeof window !== 'undefined') {
Expand Down
29 changes: 22 additions & 7 deletions src/apps/console/page-components/app/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useParams } from '@remix-run/react';
import { useCallback, useEffect, useState } from 'react';
import { Checkbox } from '~/components/atoms/checkbox';
import { TextInput } from '~/components/atoms/input';
import Select from '~/components/atoms/select';
import { BottomNavigation } from '~/console/components/commons';
import { NameIdView } from '~/console/components/name-id-view';
import { useAppState } from '~/console/page-components/app-states';
Expand Down Expand Up @@ -64,12 +63,25 @@ import { handleError } from '~/root/lib/utils/common';
// return <ResourceExtraAction options={options} />;
// };

const AppSelectItem = ({ label, value }: { label: string; value: string }) => {
const AppSelectItem = ({
label,
value,
registry,
repository,
}: {
label: string;
value: string;
registry: string;
repository: string;
}) => {
return (
<div>
<div className="flex flex-col">
<div>{label}</div>
<div className="bodySm text-text-soft">{value}</div>
{registry !== '' && repository !== '' && (
<div className="bodySm text-text-soft">{`${registry}/${repository}`}</div>
)}
{/* <div className="bodySm text-text-soft">{value}</div> */}
</div>
</div>
);
Expand Down Expand Up @@ -111,6 +123,8 @@ const AppGeneral = ({ mode = 'new' }: { mode: 'edit' | 'new' }) => {
<AppSelectItem
label={`${i.imageName}:${i.imageTag}`}
value={`${i.imageName}:${i.imageTag}`}
registry={i.meta.registry || ''}
repository={i.meta.repository || ''}
/>
),
}));
Expand Down Expand Up @@ -303,16 +317,16 @@ const AppGeneral = ({ mode = 'new' }: { mode: 'edit' | 'new' }) => {
/>
)}
<div className="flex flex-col gap-xl">
{/* <TextInput
<TextInput
size="lg"
label="Image name"
placeholder="Enter Image name"
value={values.imageUrl}
onChange={handleChange('imageUrl')}
error={!!errors.imageUrl}
message={errors.imageUrl}
/> */}
<Select
/>
{/* <Select
label="Select Images"
size="lg"
value={values.imageUrl}
Expand All @@ -331,7 +345,8 @@ const AppGeneral = ({ mode = 'new' }: { mode: 'edit' | 'new' }) => {
error={!!errors.imageUrl}
message={errors.imageUrl}
loading={imageLoaded}
/>
createLabel="Select"
/> */}
</div>

<Checkbox
Expand Down
9 changes: 9 additions & 0 deletions src/apps/console/page-components/handle-environment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ const HandleEnvironment = ({ show, setShow }: IDialog<IEnvironment | null>) => {

const [clusterList, setClusterList] = useState<any[]>([]);

// const klCluster = {
// label: 'Kloudlite cluster',
// value: constants.kloudliteClusterName,
// ready: true,
// render: () => (
// <ClusterSelectItem label="Kloudlite cluster" value="kloudlite-cluster" />
// ),
// };

const getClusters = useCallback(async () => {
try {
const byokClusters = await api.listByokClusters({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ import { useEffect, useState } from 'react';
import { Button, IconButton } from '~/components/atoms/button';
import { Chip, ChipGroup } from '~/components/atoms/chips';
import { TextInput } from '~/components/atoms/input';
import Tooltip from '~/components/atoms/tooltip';
import { usePagination } from '~/components/molecule/pagination';
import { cn } from '~/components/utils';
import List from '~/console/components/list';
import NoResultsFound from '~/console/components/no-results-found';
import { IShowDialog } from '~/console/components/types.d';
import { useAppState } from '~/console/page-components/app-states';
import useForm from '~/root/lib/client/hooks/use-form';
import Yup from '~/root/lib/server/helpers/yup';
import { NonNullableString } from '~/root/lib/types/common';
import { listFlex } from '~/console/components/console-list-components';
import {
ArrowRight,
ChevronLeft,
Expand All @@ -21,8 +16,13 @@ import {
X,
XCircleFill,
} from '~/console/components/icons';
import Tooltip from '~/components/atoms/tooltip';
import { listFlex } from '~/console/components/console-list-components';
import List from '~/console/components/list';
import NoResultsFound from '~/console/components/no-results-found';
import { IShowDialog } from '~/console/components/types.d';
import { useAppState } from '~/console/page-components/app-states';
import useForm from '~/root/lib/client/hooks/use-form';
import Yup from '~/root/lib/server/helpers/yup';
import { NonNullableString } from '~/root/lib/types/common';
import AppDialog from './app-dialogs';

interface IConfigMount {
Expand Down Expand Up @@ -395,7 +395,7 @@ export const ConfigMounts = () => {
/>
<Chip
item={{ name: 'mres' }}
label="Integrated resources"
label="Managed resources"
type="CLICKABLE"
/>
</ChipGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NameIdView } from '~/console/components/name-id-view';
import { useAppState } from '~/console/page-components/app-states';
import { FadeIn } from '~/console/page-components/util';
import { parseName, parseNodes } from '~/console/server/r-utils/common';
import useForm, { dummyEvent } from '~/root/lib/client/hooks/use-form';
import useForm from '~/root/lib/client/hooks/use-form';
import Yup from '~/root/lib/server/helpers/yup';
// import { registryHost } from '~/lib/configs/base-url.cjs';
import { useOutletContext, useParams } from '@remix-run/react';
Expand All @@ -13,7 +13,7 @@ import { keyconstants } from '~/console/server/r-utils/key-constants';
// import ExtendedFilledTab from '~/console/components/extended-filled-tab';
import { useCallback, useEffect, useState } from 'react';
import { Button } from '~/components/atoms/button';
import Select from '~/components/atoms/select';
import { TextInput } from '~/components/atoms/input';
import { toast } from '~/components/molecule/toast';
import {
ArrowClockwise,
Expand Down Expand Up @@ -73,7 +73,10 @@ const AppSelectItem = ({
<div>
<div className="flex flex-col">
<div>{label}</div>
<div className="bodySm text-text-soft">{`${registry}/${repository}`}</div>
{registry !== '' && repository !== '' && (
<div className="bodySm text-text-soft">{`${registry}/${repository}`}</div>
)}
{/* <div className="bodySm text-text-soft">{`${registry}/${repository}`}</div> */}
</div>
</div>
);
Expand Down Expand Up @@ -116,8 +119,8 @@ const AppDetail = () => {
<AppSelectItem
label={`${i.imageName}:${i.imageTag}`}
value={`${i.imageName}:${i.imageTag}`}
registry={i.meta.registry}
repository={i.meta.repository}
registry={i.meta.registry || ''}
repository={i.meta.repository || ''}
/>
),
}));
Expand Down Expand Up @@ -319,17 +322,17 @@ const AppDetail = () => {
size="sm"
/> */}

{/* <TextInput
<TextInput
size="lg"
label="Image name"
placeholder="Enter Image name"
value={values.imageUrl}
onChange={handleChange('imageUrl')}
error={!!errors.imageUrl}
message={errors.imageUrl}
/> */}
/>

<Select
{/* <Select
label="Select Images"
size="lg"
value={values.imageUrl}
Expand All @@ -349,7 +352,7 @@ const AppDetail = () => {
message={errors.imageUrl}
loading={imageLoaded}
createLabel="Select"
/>
/> */}

{/* {values.imageMode === 'default' && (
<RepoSelector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ import { useEffect, useState } from 'react';
import { Button, IconButton } from '~/components/atoms/button';
import { Chip, ChipGroup } from '~/components/atoms/chips';
import { TextInput } from '~/components/atoms/input';
import Tooltip from '~/components/atoms/tooltip';
import { usePagination } from '~/components/molecule/pagination';
import { cn } from '~/components/utils';
import List from '~/console/components/list';
import NoResultsFound from '~/console/components/no-results-found';
import { IShowDialog } from '~/console/components/types.d';
import { useAppState } from '~/console/page-components/app-states';
import useForm from '~/root/lib/client/hooks/use-form';
import Yup from '~/root/lib/server/helpers/yup';
import { NonNullableString } from '~/root/lib/types/common';
import { listFlex } from '~/console/components/console-list-components';
import {
ArrowRight,
ChevronLeft,
Expand All @@ -21,8 +16,13 @@ import {
X,
XCircleFill,
} from '~/console/components/icons';
import Tooltip from '~/components/atoms/tooltip';
import { listFlex } from '~/console/components/console-list-components';
import List from '~/console/components/list';
import NoResultsFound from '~/console/components/no-results-found';
import { IShowDialog } from '~/console/components/types.d';
import { useAppState } from '~/console/page-components/app-states';
import useForm from '~/root/lib/client/hooks/use-form';
import Yup from '~/root/lib/server/helpers/yup';
import { NonNullableString } from '~/root/lib/types/common';
import AppDialog from './app-dialogs';

interface IEnvVariable {
Expand Down Expand Up @@ -441,7 +441,7 @@ export const EnvironmentVariables = () => {
/>
<Chip
item={{ name: 'mres' }}
label="Integrated resources"
label="Managed resources"
type="CLICKABLE"
/>
</ChipGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Settings = () => {
{ label: 'User management', value: 'user-management' },
// { label: 'Cloud providers', value: 'cloud-providers' },
{ label: 'Image pull secrets', value: 'image-pull-secrets' },
{ label: 'Image Discovery', value: 'images' },
// { label: 'Image Discovery', value: 'images' },
// { label: 'VPN', value: 'vpn' },
]}
parentPath="/settings"
Expand Down
1 change: 1 addition & 0 deletions src/apps/console/server/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export const constants = {
dockerImageFormatRegex:
/^(([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)+[a-zA-Z]{2,}(:[0-9]+)?\/)?([a-z0-9]+(-[a-z0-9]+)*\/)*[a-z0-9]+([._-][a-z0-9]+)*(:[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}[a-zA-Z0-9])?(@[A-Za-z][A-Za-z0-9]*(?:[._-][A-Za-z0-9]+)?:[A-Fa-f0-9]{32,})?$/,
keyFormatRegex: /^[A-Za-z0-9_]+([./-][A-Za-z0-9_]+)*$/,
kloudliteClusterName: 'kloudlite-enabled-cluster',
};
7 changes: 4 additions & 3 deletions src/apps/webinar/src/app/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Link } from '@remix-run/react';
//@ts-ignore
import { Button } from 'kl-design-system/atoms/button';
//@ts-ignore
import { BrandLogo } from 'kl-design-system/branding/brand-logo';
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';
import Wrapper from './wrapper';

const Header = ({ headerExtra }: { headerExtra?: ReactNode }) => {
Expand All @@ -20,7 +21,7 @@ const Header = ({ headerExtra }: { headerExtra?: ReactNode }) => {
<Button
variant="plain"
content="Contact us"
linkComponent={Link}
// linkComponent={Link}
to="https://kloudlite.io/contact-us"
/>
{headerExtra}
Expand Down
4 changes: 2 additions & 2 deletions src/apps/webinar/src/app/components/join-webinar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const JoinWebinar = ({ userData, meetingStatus }: { userData: UesrData, m
<Button
size="lg"
variant="primary"
content={<span className="bodyLg-medium">Join</span>}
suffix={<ArrowRightLg />}
content={<span className="bodyLg-medium">{meetingStatus === 'ACTIVE' ? 'Join' : 'Meeting is not active'}</span>}
suffix={meetingStatus === 'ACTIVE' ? <ArrowRightLg /> : null}
disabled={meetingStatus !== 'ACTIVE'}
block
onClick={() => {
Expand Down
1 change: 1 addition & 0 deletions src/apps/webinar/src/app/components/wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ts-ignore
import { cn } from 'kl-design-system/utils';
import React, { ReactNode } from 'react';

Expand Down
Binary file modified src/apps/webinar/src/app/favicon.ico
Binary file not shown.
11 changes: 6 additions & 5 deletions src/apps/webinar/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";


const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
title: "Kloudlite Events",
description: "Generated by create next app",
};

Expand All @@ -17,11 +18,11 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
{/* <body className={inter.className}>{children}</body> */}
<body className={inter.className}>
<body className={inter.className}>{children}</body>

{/* <body className={inter.className}>
<main>{children}</main>
</body>
</body> */}

</html>
);
Expand Down
Loading

0 comments on commit 5d47dcb

Please sign in to comment.