From 2c13349491795afed4634c428eb87b6912f66df0 Mon Sep 17 00:00:00 2001 From: Piyush Kumar Date: Thu, 20 Jun 2024 15:58:29 +0530 Subject: [PATCH] update package.json --- package.json | 2 +- pnpm-lock.yaml | 2 +- .../handle-console-devices.tsx | 10 +++--- .../$environment+/new-app/app-network.tsx | 4 --- .../environments/environment-resources-v2.tsx | 2 +- .../infra+/clusters/cluster-resources-v2.tsx | 34 ++++++++++++------- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index f07f57f21..027606336 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@radix-ui/react-compose-refs": "^1.0.1", "@radix-ui/react-context": "^1.0.1", "@radix-ui/react-dialog": "1.0.4", - "@radix-ui/react-direction": "^1.0.1", + "@radix-ui/react-direction": "1.0.1", "@radix-ui/react-dismissable-layer": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-focus-guards": "^1.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e16f5df0..275a7d09f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,7 +39,7 @@ dependencies: specifier: 1.0.4 version: 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.2.0) '@radix-ui/react-direction': - specifier: ^1.0.1 + specifier: 1.0.1 version: 1.0.1(@types/react@18.3.3)(react@18.2.0) '@radix-ui/react-dismissable-layer': specifier: ^1.0.5 diff --git a/src/apps/console/page-components/handle-console-devices.tsx b/src/apps/console/page-components/handle-console-devices.tsx index 32cb7ecea..b226c02d9 100644 --- a/src/apps/console/page-components/handle-console-devices.tsx +++ b/src/apps/console/page-components/handle-console-devices.tsx @@ -301,7 +301,7 @@ export const ShowWireguardConfig = ({ deviceName: string; creationMethod: string; }) => { - const [mode, setMode] = useState<'config' | 'qr'>('qr'); + const [mode, setMode] = useState<'config' | 'qr'>('config'); const [data, setData] = useState<{ value: string; @@ -391,14 +391,14 @@ export const ShowWireguardConfig = ({ setMode(v as any); }} items={[ - { - label: 'QR Code', - value: 'qr', - }, { label: 'Config', value: 'config', }, + { + label: 'QR Code', + value: 'qr', + }, ]} /> {modeView()} diff --git a/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-network.tsx b/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-network.tsx index 28eb2093d..207dd460f 100644 --- a/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-network.tsx +++ b/src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-network.tsx @@ -210,10 +210,6 @@ export const ExposedPorts = () => { options={async () => []} onChange={(val, v) => { const r = /^\d+$/; - console.log( - 'here', - v.every((c) => r.test(c)) - ); if (v.every((c) => r.test(c))) { setServices([...v.map((vv) => ({ port: parseInt(vv, 10) }))]); } else { diff --git a/src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx b/src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx index 06f273c6d..d8d60c164 100644 --- a/src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx +++ b/src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx @@ -201,7 +201,7 @@ const ListView = ({ items, onAction }: IResource) => { status: { render: () => i.isArchived ? ( - Deleted + Archived ) : ( ), diff --git a/src/apps/console/routes/_main+/$account+/infra+/clusters/cluster-resources-v2.tsx b/src/apps/console/routes/_main+/$account+/infra+/clusters/cluster-resources-v2.tsx index 9ff0257d3..b7381329b 100644 --- a/src/apps/console/routes/_main+/$account+/infra+/clusters/cluster-resources-v2.tsx +++ b/src/apps/console/routes/_main+/$account+/infra+/clusters/cluster-resources-v2.tsx @@ -48,7 +48,7 @@ import CodeView from '~/console/components/code-view'; import useCustomSwr from '~/root/lib/client/hooks/use-custom-swr'; import { LoadingPlaceHolder } from '~/console/components/loading'; import { Badge } from '~/components/atoms/badge'; -import { Github__Com___Kloudlite___Api___Pkg___Types__SyncState as SyncStatusState } from '~/root/src/generated/gql/server'; +// import { Github__Com___Kloudlite___Api___Pkg___Types__SyncState as SyncStatusState } from '~/root/src/generated/gql/server'; import { ViewClusterLogs } from '~/console/components/cluster-logs-popop'; import { ensureAccountClientSide } from '~/console/server/utils/auth-utils'; import Tooltip from '~/components/atoms/tooltip'; @@ -204,14 +204,24 @@ const ByokButton = ({ item }: { item: CombinedBaseType }) => { }; const GetByokClusterMessage = ({ - syncStatusState, + lastOnlineAt, item, }: { - syncStatusState: SyncStatusState; + lastOnlineAt: string; item: CombinedBaseType; }) => { - switch (syncStatusState) { - case 'UPDATED_AT_AGENT': + if (lastOnlineAt === null) { + return ; + } + + const lastTime = new Date(lastOnlineAt); + const currentTime = new Date(); + + const timeDifference = + (currentTime.getTime() - lastTime.getTime()) / (1000 * 60); + + switch (true) { + case timeDifference <= 2: return ( { - if (lastOnlioneAt === null) { +const GetSyncStatus = ({ lastOnlineAt }: { lastOnlineAt: string }) => { + if (lastOnlineAt === null) { return Offline; } - const lastTime = new Date(lastOnlioneAt); + const lastTime = new Date(lastOnlineAt); const currentTime = new Date(); const timeDifference = @@ -261,7 +271,7 @@ const GetSyncStatus = ({ lastOnlioneAt }: { lastOnlioneAt: string }) => { side="top" content={
- {lastOnlioneAt} ({timeDifference * 60}s ago) + {lastOnlineAt} ({timeDifference * 60}s ago)
} > @@ -277,7 +287,7 @@ const GetSyncStatus = ({ lastOnlioneAt }: { lastOnlioneAt: string }) => { side="top" content={
- {lastOnlioneAt} + {lastOnlineAt}
} > @@ -477,13 +487,13 @@ const ListView = ({ items = [], onEdit, onDelete, onShowLogs }: IResource) => { /> ) : ( ), }, status: { - render: () => , + render: () => , }, updated: { render: () => (