Skip to content

Commit

Permalink
update package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtCoder19 committed Jun 24, 2024
1 parent 082e917 commit 2c13349
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

10 changes: 5 additions & 5 deletions src/apps/console/page-components/handle-console-devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const ListView = ({ items, onAction }: IResource) => {
status: {
render: () =>
i.isArchived ? (
<Badge type="critical">Deleted</Badge>
<Badge type="neutral">Archived</Badge>
) : (
<SyncStatusV2 item={i} />
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 <ByokButton item={item} />;
}

const lastTime = new Date(lastOnlineAt);
const currentTime = new Date();

const timeDifference =
(currentTime.getTime() - lastTime.getTime()) / (1000 * 60);

switch (true) {
case timeDifference <= 2:
return (
<ListItem
data={
Expand All @@ -226,12 +236,12 @@ const GetByokClusterMessage = ({
}
};

const GetSyncStatus = ({ lastOnlioneAt }: { lastOnlioneAt: string }) => {
if (lastOnlioneAt === null) {
const GetSyncStatus = ({ lastOnlineAt }: { lastOnlineAt: string }) => {
if (lastOnlineAt === null) {
return <Badge type="warning">Offline</Badge>;
}

const lastTime = new Date(lastOnlioneAt);
const lastTime = new Date(lastOnlineAt);
const currentTime = new Date();

const timeDifference =
Expand Down Expand Up @@ -261,7 +271,7 @@ const GetSyncStatus = ({ lastOnlioneAt }: { lastOnlioneAt: string }) => {
side="top"
content={
<div className="flex-1 bodyMd-medium text-text-strong pulsable whitespace-normal">
{lastOnlioneAt} ({timeDifference * 60}s ago)
{lastOnlineAt} ({timeDifference * 60}s ago)
</div>
}
>
Expand All @@ -277,7 +287,7 @@ const GetSyncStatus = ({ lastOnlioneAt }: { lastOnlioneAt: string }) => {
side="top"
content={
<div className="flex-1 bodyMd-medium text-text-strong pulsable whitespace-normal">
{lastOnlioneAt}
{lastOnlineAt}
</div>
}
>
Expand Down Expand Up @@ -477,13 +487,13 @@ const ListView = ({ items = [], onEdit, onDelete, onShowLogs }: IResource) => {
/>
) : (
<GetByokClusterMessage
syncStatusState={i.syncStatus.state}
lastOnlineAt={i.lastOnlineAt}
item={i}
/>
),
},
status: {
render: () => <GetSyncStatus lastOnlioneAt={i.lastOnlineAt} />,
render: () => <GetSyncStatus lastOnlineAt={i.lastOnlineAt} />,
},
updated: {
render: () => (
Expand Down

0 comments on commit 2c13349

Please sign in to comment.