{
},
],
rows: items.map((i) => {
- const { name, id, updateInfo, provider } = parseItem(i);
+ const { name, id, updateInfo } = parseItem(i);
// const isLatest = dayjs(i.updateTime).isAfter(
// dayjs().subtract(3, 'hour')
@@ -473,7 +475,7 @@ const ListView = ({ items = [], onEdit, onDelete, onShowLogs }: IResource) => {
return (
);
@@ -481,7 +483,7 @@ const ListView = ({ items = [], onEdit, onDelete, onShowLogs }: IResource) => {
},
status: {
render: () => (
-
+
),
},
updated: {
diff --git a/src/apps/console/routes/_main+/$account+/infra+/clusters/handle-cluster-resource.tsx b/src/apps/console/routes/_main+/$account+/infra+/clusters/handle-cluster-resource.tsx
new file mode 100644
index 000000000..7fa87be94
--- /dev/null
+++ b/src/apps/console/routes/_main+/$account+/infra+/clusters/handle-cluster-resource.tsx
@@ -0,0 +1,63 @@
+import { useParams } from '@remix-run/react';
+import { Button } from '~/components/atoms/button';
+import Popup from '~/components/molecule/popup';
+import CodeView from '~/console/components/code-view';
+import { ensureAccountClientSide } from '~/console/server/utils/auth-utils';
+
+export const LocalDeviceClusterInstructions = ({
+ show,
+ onClose,
+}: {
+ show: boolean;
+ onClose: () => void;
+}) => {
+ const params = useParams();
+ ensureAccountClientSide(params);
+
+ return (
+
+ Instructions to add your local device
+
+
+
+
+
+
+
+ );
+};
diff --git a/src/apps/console/routes/_main+/$account+/infra+/clusters/route.tsx b/src/apps/console/routes/_main+/$account+/infra+/clusters/route.tsx
index 8173d0674..f783c1a98 100644
--- a/src/apps/console/routes/_main+/$account+/infra+/clusters/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/infra+/clusters/route.tsx
@@ -1,5 +1,5 @@
import { defer } from '@remix-run/node';
-import { Link, useLoaderData } from '@remix-run/react';
+import { useLoaderData } from '@remix-run/react';
import { useState } from 'react';
import { Button } from '~/components/atoms/button.jsx';
import { EmptyClusterImage } from '~/console/components/empty-resource-images';
@@ -15,6 +15,7 @@ import fake from '~/root/fake-data-generator/fake';
import { IRemixCtx } from '~/root/lib/types/common';
import HandleByokCluster from '../byok-cluster/handle-byok-cluster';
import ClusterResourcesV2 from './cluster-resources-v2';
+import { LocalDeviceClusterInstructions } from './handle-cluster-resource';
import Tools from './tools';
export const loader = async (ctx: IRemixCtx) => {
@@ -69,6 +70,7 @@ const ClusterComponent = ({
}) => {
const [clusterType, setClusterType] = useState('All');
const byokClusters = parseNodes(clustersData);
+ const [visible, setVisible] = useState(false);
const getEmptyState = ({
byokClustersCount,
@@ -88,23 +90,33 @@ const ClusterComponent = ({
return {
image: ,
is: true,
- title: 'This is where you’ll attach your compute or local devices.',
+ title: 'This is where you’ll manage your compute.',
content: (
-
- You can attach a new compute and manage the listed compute.
-
- Follow the instructions to attach your{' '}
-
-
- local device
+
+ You can attach any kubernetes cluster.
+
+
+
+ OR
+
+
+
+ Follow the{' '}
+ {
+ setVisible(true);
+ }}
+ className="bodyMd-semibold underline underline-offset-1 text-text-default cursor-pointer"
+ >
+ Instructions{' '}
- {' '}
-
+ to attach your local device.
+
+
setVisible(false) }}
+ />
+
),
- action: ,
};
}
diff --git a/src/apps/console/routes/_main+/$account+/managed-services/backend-services-resources-V2.tsx b/src/apps/console/routes/_main+/$account+/managed-services/backend-services-resources-V2.tsx
index d5c53eda5..a7b710843 100644
--- a/src/apps/console/routes/_main+/$account+/managed-services/backend-services-resources-V2.tsx
+++ b/src/apps/console/routes/_main+/$account+/managed-services/backend-services-resources-V2.tsx
@@ -1,5 +1,5 @@
import { Link, useOutletContext, useParams } from '@remix-run/react';
-import { useEffect, useState } from 'react';
+import { useState } from 'react';
import { Badge } from '~/components/atoms/badge';
import { toast } from '~/components/molecule/toast';
import { generateKey, titleCase } from '~/components/utils';
@@ -17,8 +17,7 @@ import ListGridView from '~/console/components/list-grid-view';
import ListV2 from '~/console/components/listV2';
import ResourceExtraAction from '~/console/components/resource-extra-action';
import { SyncStatusV2 } from '~/console/components/sync-status';
-import { findClusterStatus } from '~/console/hooks/use-cluster-status';
-import { useClusterStatusV2 } from '~/console/hooks/use-cluster-status-v2';
+import { findClusterStatusv3 } from '~/console/hooks/use-cluster-status';
import { useConsoleApi } from '~/console/server/gql/api-provider';
import { IClusterMSvs } from '~/console/server/gql/queries/cluster-managed-services-queries';
import { IMSvTemplates } from '~/console/server/gql/queries/managed-templates-queries';
@@ -32,6 +31,7 @@ import { getManagedTemplate } from '~/console/utils/commons';
import { useReload } from '~/root/lib/client/helpers/reloader';
import { useWatchReload } from '~/root/lib/client/helpers/socket/useWatch';
import { handleError } from '~/root/lib/utils/common';
+import { useClusterStatusV3 } from '~/console/hooks/use-cluster-status-v3';
import { IAccountContext } from '../_layout';
import { IClusterContext } from '../infra+/$cluster+/_layout';
import CloneManagedService from './clone-managed-service';
@@ -163,18 +163,9 @@ const GridView = ({ items, templates, onAction }: IResource) => {
const ListView = ({ items, templates, onAction }: IResource) => {
const { account } = useOutletContext();
- const { clusters } = useClusterStatusV2();
-
- // const [clusterOnlineStatus, setClusterOnlineStatus] = useState<
- // Record
- // >({});
- // useEffect(() => {
- // const states: Record = {};
- // Object.entries(clusters).forEach(([key, value]) => {
- // states[key] = findClusterStatus(value);
- // });
- // setClusterOnlineStatus(states);
- // }, [clusters]);
+ const { clustersMap: clusterStatus } = useClusterStatusV3({
+ clusterNames: items.map((i) => i.clusterName),
+ });
return (
{
},
],
rows: items.map((i) => {
- const isClusterOnline = findClusterStatus(clusters[i.clusterName]);
+ const isClusterOnline = findClusterStatusv3(
+ clusterStatus[i.clusterName]
+ );
const { name, id, logo, updateInfo } = parseItem(i, templates);
return {
columns: {
@@ -240,6 +233,11 @@ const ListView = ({ items, templates, onAction }: IResource) => {
if (i.isArchived) {
return Archived;
}
+
+ if (clusterStatus[i.clusterName] === undefined) {
+ return ;
+ }
+
if (!isClusterOnline) {
return Cluster Offline;
}
@@ -282,11 +280,11 @@ const BackendServicesResourcesV2 = ({
return `account:${parseName(account)}.cluster:${
i.clusterName
}.cluster_managed_service:${parseName(i)}`;
- }),
+ })
);
const [showDeleteDialog, setShowDeleteDialog] = useState(
- null,
+ null
);
const [visible, setVisible] = useState(null);
const api = useConsoleApi();
diff --git a/src/apps/console/routes/_main+/$account+/settings+/images/route.tsx b/src/apps/console/routes/_main+/$account+/settings+/images/route.tsx
index 2677ea8f4..306429ddd 100644
--- a/src/apps/console/routes/_main+/$account+/settings+/images/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/settings+/images/route.tsx
@@ -39,11 +39,11 @@ const Images = () => {
<>
{({ imagesData }) => {
const images = parseNodes(imagesData);
@@ -55,7 +55,7 @@ const Images = () => {
action: images.length > 0 && (
}
onClick={() => {
diff --git a/src/apps/console/routes/_main+/_layout/_layout.tsx b/src/apps/console/routes/_main+/_layout/_layout.tsx
index c2ca178e0..9610b8a58 100644
--- a/src/apps/console/routes/_main+/_layout/_layout.tsx
+++ b/src/apps/console/routes/_main+/_layout/_layout.tsx
@@ -28,7 +28,6 @@ import {
import { LoadingPlaceHolder } from '~/console/components/loading';
import LogoWrapper from '~/console/components/logo-wrapper';
import { ViewModeProvider } from '~/console/components/view-mode';
-import ClusterStatusProvider from '~/console/hooks/use-cluster-status-v2';
import { useConsoleApi } from '~/console/server/gql/api-provider';
import { IAccounts } from '~/console/server/gql/queries/account-queries';
import { ICommsNotifications } from '~/console/server/gql/queries/comms-queries';
@@ -495,21 +494,19 @@ const Console = () => {