diff --git a/.dockerignore b/.dockerignore index c5935792a..efc1070d6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -20,3 +20,5 @@ src/generated/plugin/node_modules src/design-system/node_modules src/apps/devdoc/node_modules src/apps/devdoc/.next +src/apps/webinar/.env + diff --git a/.gitignore b/.gitignore index 67166f1f2..d3cfbc503 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ out storybook-dist tsconfig-compile.tsbuildinfo + +.secrets diff --git a/Dockerfile b/Dockerfile index 43000bd3b..8383ae180 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,10 @@ COPY ./pnpm-lock.yaml ./pnpm-lock.yaml # typecheck ARG APP ENV APP=${APP} -COPY ./src/generated/package.json ./src/generated/package.json -COPY ./src/generated/plugin/package.json ./src/generated/plugin/package.json +# COPY ./src/generated/package.json ./src/generated/package.json +# COPY ./src/generated/plugin/package.json ./src/generated/plugin/package.json +COPY ./src/generated/package.json ./src/generated/pnpm-lock.yaml ./src/generated/ +COPY ./src/generated/plugin/package.json ./src/generated/plugin/pnpm-lock.yaml ./src/generated/plugin/ RUN pnpm i -p --frozen-lockfile diff --git a/Dockerfile.webinar b/Dockerfile.webinar index 8a6028d55..130ac7f3b 100644 --- a/Dockerfile.webinar +++ b/Dockerfile.webinar @@ -1,27 +1,33 @@ -FROM node:20.8.1-alpine as base +FROM node:20.8.1-alpine AS base RUN apk add g++ make py3-pip RUN npm i -g pnpm WORKDIR /app COPY ./package.json ./package.json COPY ./pnpm-lock.yaml ./pnpm-lock.yaml -COPY ./src/generated/package.json ./src/generated/package.json -COPY ./src/generated/plugin/package.json ./src/generated/plugin/package.json +RUN mkdir -p ./src/generated/plugin +COPY ./src/generated/package.json ./src/generated/pnpm-lock.yaml ./src/generated/ +COPY ./src/generated/plugin/package.json ./src/generated/plugin/pnpm-lock.yaml ./src/generated/plugin/ -RUN pnpm i +RUN --mount=type=bind,source=package.json,target=package.json \ + --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ + --mount=type=cache,target=/root/.local/share/pnpm/store \ + pnpm i --frozen-lockfile +# lib +COPY ./lib ./lib # design system COPY ./src/design-system/ ./src/design-system/ WORKDIR /app/src/design-system -RUN pnpm i -p +RUN pnpm i --frozen-lockfile RUN pnpm local:release # webinar WORKDIR /app COPY ./src/apps/webinar ./src/apps/webinar WORKDIR /app/src/apps/webinar -RUN pnpm i -p +RUN pnpm i --frozen-lockfile RUN pnpm build FROM node:20.8.1-alpine diff --git a/Taskfile.yaml b/Taskfile.yaml index 53c5529f5..7f1e20127 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -10,7 +10,7 @@ tasks: - | BASE_URL=dev.kloudlite.io COOKIE_DOMAIN=".kloudlite.io" - GATEWAY_URL="http://gateway.kloudlite.svc.cluster.local:3000" + GATEWAY_URL="http://gateway-api.kloudlite.svc.cluster.local:3000" case {{.app}} in "auth") PORT=4000 @@ -106,7 +106,7 @@ tasks: BASE_URL=kloudlite.io URL_SUFFIX="" COOKIE_DOMAIN=".kloudlite.io" - GATEWAY_URL="http://gateway.kloudlite.svc.cluster.local:3000" + GATEWAY_URL="http://gateway-api.kloudlite.svc.cluster.local:3000" case {{.app}} in "auth") diff --git a/lib/configs/base-url.cjs b/lib/configs/base-url.cjs index 3a0e4420a..482eb686d 100644 --- a/lib/configs/base-url.cjs +++ b/lib/configs/base-url.cjs @@ -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 = () => { @@ -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 } + : {}), }; }; @@ -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') { diff --git a/lib/shared-statics/events.json b/lib/shared-statics/events.json new file mode 100644 index 000000000..8fd43a464 --- /dev/null +++ b/lib/shared-statics/events.json @@ -0,0 +1,10 @@ +{ + "code-unbound-new-age-development-environments": { + "name": "Code Unbound: New Age Development Environments", + "dyteMeetingId": "bbbba7f8-3643-41fd-831a-15a321f80966", + "date": "2024-09-21", + "starttime": "12:15", + "endtime": "13:15", + "type": "Online" + } +} \ No newline at end of file diff --git a/package.json b/package.json index e4d3f048d..e205f5a3f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "homepage": "https://kloudlite.github.io", "type": "module", "scripts": { - "postinstall": "cd src/generated && pnpm i", + "postinstall": "cd src/generated && ls -al && pnpm i --frozen-lockfile", "fake": "esbuild fake-data-generator/gen.ts --format=cjs --outfile=public/dist/fake-data-generator.cjs --platform=node && node public/dist/fake-data-generator.cjs", "dev": "remix dev", "serve": "remix-serve ./public/${APP}/server", @@ -91,7 +91,7 @@ "react-qr-code": "^2.0.12", "react-remove-scroll": "^2.5.7", "react-router-dom": "^6.21.1", - "react-toastify": "10.0.5", + "react-toastify": "^9.1.3", "react-tooltip": "^5.27.0", "react-viewport-list": "^7.1.2", "reconnecting-websocket": "^4.4.0", @@ -140,4 +140,4 @@ "typescript": "^5.3.3", "typescript-json-schema": "^0.62.0" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9606d5597..fa29a41a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,8 +210,8 @@ dependencies: specifier: ^6.21.1 version: 6.23.1(react-dom@18.3.1)(react@18.2.0) react-toastify: - specifier: 10.0.5 - version: 10.0.5(react-dom@18.3.1)(react@18.2.0) + specifier: ^9.1.3 + version: 9.1.3(react-dom@18.3.1)(react@18.2.0) react-tooltip: specifier: ^5.27.0 version: 5.27.0(react-dom@18.3.1)(react@18.2.0) @@ -5590,6 +5590,11 @@ packages: engines: {node: '>=0.8'} dev: true + /clsx@1.2.1: + resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} + engines: {node: '>=6'} + dev: false + /clsx@2.1.1: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} @@ -9795,13 +9800,13 @@ packages: tslib: 2.6.2 dev: false - /react-toastify@10.0.5(react-dom@18.3.1)(react@18.2.0): - resolution: {integrity: sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==} + /react-toastify@9.1.3(react-dom@18.3.1)(react@18.2.0): + resolution: {integrity: sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==} peerDependencies: - react: '>=18' - react-dom: '>=18' + react: '>=16' + react-dom: '>=16' dependencies: - clsx: 2.1.1 + clsx: 1.2.1 react: 18.2.0 react-dom: 18.3.1(react@18.2.0) dev: false diff --git a/src/apps/console/page-components/app/general.tsx b/src/apps/console/page-components/app/general.tsx index e95f6f2a2..0957b335c 100644 --- a/src/apps/console/page-components/app/general.tsx +++ b/src/apps/console/page-components/app/general.tsx @@ -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'; @@ -64,12 +63,25 @@ import { handleError } from '~/root/lib/utils/common'; // return ; // }; -const AppSelectItem = ({ label, value }: { label: string; value: string }) => { +const AppSelectItem = ({ + label, + value, + registry, + repository, +}: { + label: string; + value: string; + registry: string; + repository: string; +}) => { return (
{label}
-
{value}
+ {registry !== '' && repository !== '' && ( +
{`${registry}/${repository}`}
+ )} + {/*
{value}
*/}
); @@ -111,6 +123,8 @@ const AppGeneral = ({ mode = 'new' }: { mode: 'edit' | 'new' }) => { ), })); @@ -303,7 +317,7 @@ const AppGeneral = ({ mode = 'new' }: { mode: 'edit' | 'new' }) => { /> )}
- {/* { onChange={handleChange('imageUrl')} error={!!errors.imageUrl} message={errors.imageUrl} - /> */} - { error={!!errors.imageUrl} message={errors.imageUrl} loading={imageLoaded} - /> + createLabel="Select" + /> */}
) => { const [clusterList, setClusterList] = useState([]); + // const klCluster = { + // label: 'Kloudlite cluster', + // value: constants.kloudliteClusterName, + // ready: true, + // render: () => ( + // + // ), + // }; + const getClusters = useCallback(async () => { try { const byokClusters = await api.listByokClusters({}); diff --git a/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-config-mount.tsx b/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-config-mount.tsx index 7bd965ac5..a07392495 100644 --- a/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-config-mount.tsx +++ b/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-config-mount.tsx @@ -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, @@ -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 { @@ -395,7 +395,7 @@ export const ConfigMounts = () => { /> diff --git a/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-detail.tsx b/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-detail.tsx index 602448c8a..e59db67a1 100644 --- a/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-detail.tsx +++ b/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-detail.tsx @@ -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'; @@ -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, @@ -73,7 +73,9 @@ const AppSelectItem = ({
{label}
-
{`${registry}/${repository}`}
+ {registry !== '' && repository !== '' && ( +
{`${registry}/${repository}`}
+ )}
); @@ -102,6 +104,7 @@ const AppDetail = () => { const [imageList, setImageList] = useState([]); const [imageLoaded, setImageLoaded] = useState(false); + // const [imageSearchText, setImageSearchText] = useState(''); const getRegistryImages = useCallback(async () => { ensureAccountClientSide(params); @@ -116,8 +119,8 @@ const AppDetail = () => { ), })); @@ -133,6 +136,16 @@ const AppDetail = () => { getRegistryImages(); }, []); + // useDebounce( + // () => { + // if (imageSearchText) { + // getRegistryImages(); + // } + // }, + // 300, + // [imageSearchText] + // ); + const { values, errors, handleChange, handleSubmit, isLoading, setValues } = useForm({ initialValues: { @@ -319,7 +332,7 @@ const AppDetail = () => { size="sm" /> */} - {/* { onChange={handleChange('imageUrl')} error={!!errors.imageUrl} message={errors.imageUrl} - /> */} + /> -