Skip to content

Commit

Permalink
refactor: parsing image data in session launcher for before 24.12
Browse files Browse the repository at this point in the history
  • Loading branch information
agatha197 authored and yomybaby committed Nov 12, 2024
1 parent 983a8a6 commit 482c0ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions react/src/components/BAITable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const BAITable: React.FC<BAITableProps> = ({

return (
<Table
sortDirections={['descend', 'ascend', 'descend']}
showSorterTooltip={false}
className={resizable ? styles.resizableTable : ''}
components={
resizable
Expand Down
7 changes: 5 additions & 2 deletions react/src/components/CustomizedImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
useUpdatableState,
} from '../hooks';
import AliasedImageDoubleTags from './AliasedImageDoubleTags';
import BAITable from './BAITable';
import { ImageTags } from './ImageTags';
import TextHighlighter from './TextHighlighter';
import { CustomizedImageListForgetAndUntagMutation } from './__generated__/CustomizedImageListForgetAndUntagMutation.graphql';
Expand All @@ -26,7 +27,7 @@ import {
SettingOutlined,
} from '@ant-design/icons';
import { useLocalStorageState } from 'ahooks';
import { App, Button, Input, Popconfirm, Table, theme, Typography } from 'antd';
import { App, Button, Input, Popconfirm, theme, Typography } from 'antd';
import { AnyObject } from 'antd/es/_util/type';
import { ColumnsType, ColumnType } from 'antd/es/table';
import graphql from 'babel-plugin-relay/macro';
Expand Down Expand Up @@ -209,6 +210,7 @@ const CustomizedImageList: React.FC<PropsWithChildren> = ({ children }) => {
</Typography.Text>
),
sorter: (a, b) => localeCompare(getImageFullName(a), getImageFullName(b)),
width: token.screenXS,
},
{
title: t('environment.Registry'),
Expand Down Expand Up @@ -433,7 +435,8 @@ const CustomizedImageList: React.FC<PropsWithChildren> = ({ children }) => {
{t('button.Refresh')}
</Button>
</Flex>
<Table
<BAITable
resizable
loading={isPendingSearchTransition}
columns={
columns.filter((column) =>
Expand Down
7 changes: 5 additions & 2 deletions react/src/components/ImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
useSuspendedBackendaiClient,
useUpdatableState,
} from '../hooks';
import BAITable from './BAITable';
import DoubleTag from './DoubleTag';
import ImageInstallModal from './ImageInstallModal';
import { ImageTags } from './ImageTags';
Expand All @@ -31,7 +32,7 @@ import {
VerticalAlignBottomOutlined,
} from '@ant-design/icons';
import { useLocalStorageState } from 'ahooks';
import { App, Button, Input, Table, Tag, theme, Typography } from 'antd';
import { App, Button, Input, Tag, theme, Typography } from 'antd';
import { ColumnsType, ColumnType } from 'antd/es/table';
import graphql from 'babel-plugin-relay/macro';
import _ from 'lodash';
Expand Down Expand Up @@ -152,6 +153,7 @@ const ImageList: React.FC<{ style?: React.CSSProperties }> = ({ style }) => {
</Typography.Text>
),
sorter: (a, b) => localeCompare(getImageFullName(a), getImageFullName(b)),
width: token.screenXS,
},
{
title: t('environment.Registry'),
Expand Down Expand Up @@ -518,7 +520,8 @@ const ImageList: React.FC<{ style?: React.CSSProperties }> = ({ style }) => {
{t('environment.Install')}
</Button>
</Flex>
<Table<EnvironmentImage>
<BAITable
resizable
rowKey="id"
scroll={{ x: 'max-content' }}
pagination={{
Expand Down

0 comments on commit 482c0ac

Please sign in to comment.