diff --git a/src/apps/console/components/logger.tsx b/src/apps/console/components/logger.tsx
index b0756937e..f62a8cf0f 100644
--- a/src/apps/console/components/logger.tsx
+++ b/src/apps/console/components/logger.tsx
@@ -14,7 +14,6 @@ import {
useSearch,
} from '~/root/lib/client/helpers/search-filter';
import useClass from '~/root/lib/client/hooks/use-class';
-import logger from '~/root/lib/client/helpers/log';
import { socketUrl } from '~/root/lib/configs/base-url.cjs';
import { generatePlainColor } from './color-generator';
import Pulsable from './pulsable';
@@ -403,13 +402,19 @@ const LogBlock = ({
);
const [showAll, setShowAll] = useState(true);
+
const ref = useRef(null);
+ // const listRef = useRef(null);
useEffect(() => {
+ console.log('data', ref.current);
+
(async () => {
if (follow && ref.current) {
// @ts-ignore
- ref.current.scrollTo(0, ref.current.scrollHeight);
+ ref.current.scrollToIndex({
+ index: data.length - 1,
+ });
}
})();
}, [data, maxLines]);
@@ -470,11 +475,15 @@ const LogBlock = ({
>
-
+
{(log, index) => {
return (
{
};
};
+export const clearAppState = () => {
+ if (typeof window === 'undefined') return;
+ sessionStorage.removeItem('state');
+};
+
export const AppContextProvider = ({
children,
initialAppState,
diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/apps/route.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/apps/route.tsx
index 5016b3f86..a62eb7f54 100644
--- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/apps/route.tsx
+++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/apps/route.tsx
@@ -10,6 +10,8 @@ import { ensureAccountSet } from '~/console/server/utils/auth-utils';
import { getPagination, getSearch } from '~/console/server/utils/common';
import { IRemixCtx } from '~/root/lib/types/common';
import fake from '~/root/fake-data-generator/fake';
+import { clearAppState } from '~/console/page-components/app-states';
+import { useEffect } from 'react';
import AppsResources from './apps-resources';
import Tools from './tools';
@@ -38,12 +40,16 @@ export const loader = async (ctx: IRemixCtx) => {
const Apps = () => {
const { promise } = useLoaderData();
+ useEffect(() => {
+ clearAppState();
+ }, []);
+
return (
{({ appsData }) => {
const apps = parseNodes(appsData);
diff --git a/src/apps/console/routes/_main+/$account+/projects/project-resources.tsx b/src/apps/console/routes/_main+/$account+/projects/project-resources.tsx
index 7ca5dadd6..a57d84a22 100644
--- a/src/apps/console/routes/_main+/$account+/projects/project-resources.tsx
+++ b/src/apps/console/routes/_main+/$account+/projects/project-resources.tsx
@@ -121,6 +121,18 @@ const ListView = ({ items }: { items: BaseType[] }) => {
},
status,
listFlex({ key: `${keyPrefix}flex` }),
+ {
+ key: generateKey(keyPrefix, item.clusterName || ''),
+ className: '',
+ render: () => (
+
+ cluster:{' '}
+
+ {item.clusterName}
+
+
+ ),
+ },
{
key: generateKey(keyPrefix, updateInfo.author),
className: listClass.author,
diff --git a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildruns/buildruns-resources.tsx b/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildruns/buildruns-resources.tsx
index e27b6e731..4b059266b 100644
--- a/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildruns/buildruns-resources.tsx
+++ b/src/apps/console/routes/_main+/$account+/repo+/$repo+/buildruns/buildruns-resources.tsx
@@ -9,7 +9,6 @@ import DeleteDialog from '~/console/components/delete-dialog';
import Grid from '~/console/components/grid';
import List from '~/console/components/list';
import ListGridView from '~/console/components/list-grid-view';
-import ResourceExtraAction from '~/console/components/resource-extra-action';
import { useConsoleApi } from '~/console/server/gql/api-provider';
import {
ExtractNodeType,
@@ -47,34 +46,11 @@ const parseItem = (item: BaseType) => {
};
};
-interface IExtraButton {
- onDelete: () => void;
-}
-const ExtraButton = ({ onDelete }: IExtraButton) => {
- return (
- ,
- // type: 'item',
- // onClick: onDelete,
- // key: 'delete',
- // className: '!text-text-critical',
- // },
- ]
- }
- />
- );
-};
-
interface IResource {
items: BaseType[];
- onDelete: (item: BaseType) => void;
}
-const GridView = ({ items, onDelete }: IResource) => {
+const GridView = ({ items }: IResource) => {
return (
{items.map((item, index) => {
@@ -169,32 +145,30 @@ const ListItem = ({ item }: { item: BaseType }) => {
}
subtitle={
-
- {`#${commitHash.substring(
- commitHash.length - 7,
- commitHash.length
- )}`}
-
- {item.metadata?.annotations['github.com/branch']}{' '}
+
+
+ {`#${commitHash.substring(
+ commitHash.length - 7,
+ commitHash.length
+ )}`}
+
+
+
+ {item.metadata?.annotations['github.com/branch']}{' '}
+
+
+
+ {item.spec?.registry.repo.tags.map((tag) => (
+
+
+ {tag}{' '}
+
+ ))}
+
}
/>
-
-
-
- {item.spec?.registry.repo.tags.map((tag) => (
-
- ))}
-
-
@@ -231,7 +205,7 @@ const ListItem = ({ item }: { item: BaseType }) => {
);
};
-const ListView = ({ items, onDelete }: IResource) => {
+const ListView = ({ items }: IResource) => {
return (
{items.map((item, index) => {
@@ -265,9 +239,9 @@ const BuildRunResources = ({ items = [] }: { items: BaseType[] }) => {
const props: IResource = {
items,
- onDelete: (item) => {
- setShowDeleteDialog(item);
- },
+ // onDelete: (item) => {
+ // setShowDeleteDialog(item);
+ // },
};
const params = useParams();