chore: set col order
This commit is contained in:
@@ -11,8 +11,18 @@ export const GPUSTACK_API_BASE_URL = 'v2';
|
|||||||
export const OPENAI_COMPATIBLE = 'v1';
|
export const OPENAI_COMPATIBLE = 'v1';
|
||||||
|
|
||||||
type SortDirection = 'ascend' | 'descend' | null;
|
type SortDirection = 'ascend' | 'descend' | null;
|
||||||
|
|
||||||
export const TABLE_SORT_DIRECTIONS: SortDirection[] = [
|
export const TABLE_SORT_DIRECTIONS: SortDirection[] = [
|
||||||
'ascend',
|
'ascend',
|
||||||
'descend',
|
'descend',
|
||||||
null
|
null
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const tableSorter = (order: number | boolean) => {
|
||||||
|
if (typeof order === 'number') {
|
||||||
|
return {
|
||||||
|
multiple: order
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return order;
|
||||||
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import AutoTooltip from '@/components/auto-tooltip';
|
import AutoTooltip from '@/components/auto-tooltip';
|
||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
import icons from '@/components/icon-font/icons';
|
import icons from '@/components/icon-font/icons';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
@@ -39,9 +40,7 @@ const useModelsColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<AutoTooltip ghost style={{ maxWidth: 400 }}>
|
<AutoTooltip ghost style={{ maxWidth: 400 }}>
|
||||||
{text}
|
{text}
|
||||||
@@ -52,9 +51,7 @@ const useModelsColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'apikeys.form.expiretime' }),
|
title: intl.formatMessage({ id: 'apikeys.form.expiretime' }),
|
||||||
dataIndex: 'expires_at',
|
dataIndex: 'expires_at',
|
||||||
key: 'expires_at',
|
key: 'expires_at',
|
||||||
sorter: {
|
sorter: tableSorter(2),
|
||||||
multiple: 2
|
|
||||||
},
|
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<AutoTooltip ghost>
|
<AutoTooltip ghost>
|
||||||
{text
|
{text
|
||||||
@@ -96,9 +93,7 @@ const useModelsColumns = ({
|
|||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
key: 'created_at',
|
key: 'created_at',
|
||||||
defaultSortOrder: 'descend',
|
defaultSortOrder: 'descend',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import AutoTooltip from '@/components/auto-tooltip';
|
|||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
import { SealColumnProps } from '@/components/seal-table/types';
|
import { SealColumnProps } from '@/components/seal-table/types';
|
||||||
import StatusTag from '@/components/status-tag';
|
import StatusTag from '@/components/status-tag';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
@@ -33,9 +34,7 @@ const useClusterColumns = (
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
span: 3,
|
span: 3,
|
||||||
render: (text: string, record: ClusterListItem) => (
|
render: (text: string, record: ClusterListItem) => (
|
||||||
<AutoTooltip ghost>{text}</AutoTooltip>
|
<AutoTooltip ghost>{text}</AutoTooltip>
|
||||||
@@ -44,9 +43,7 @@ const useClusterColumns = (
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'clusters.table.provider' }),
|
title: intl.formatMessage({ id: 'clusters.table.provider' }),
|
||||||
dataIndex: 'provider',
|
dataIndex: 'provider',
|
||||||
sorter: {
|
sorter: tableSorter(2),
|
||||||
multiple: 2
|
|
||||||
},
|
|
||||||
span: 4,
|
span: 4,
|
||||||
render: (value: string) => (
|
render: (value: string) => (
|
||||||
<AutoTooltip ghost minWidth={20}>
|
<AutoTooltip ghost minWidth={20}>
|
||||||
@@ -93,9 +90,7 @@ const useClusterColumns = (
|
|||||||
title: intl.formatMessage({ id: 'common.table.createTime' }),
|
title: intl.formatMessage({ id: 'common.table.createTime' }),
|
||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
defaultSortOrder: 'descend',
|
defaultSortOrder: 'descend',
|
||||||
sorter: {
|
sorter: tableSorter(5),
|
||||||
multiple: 5
|
|
||||||
},
|
|
||||||
span: 4,
|
span: 4,
|
||||||
render: (value: string) => (
|
render: (value: string) => (
|
||||||
<AutoTooltip ghost minWidth={20}>
|
<AutoTooltip ghost minWidth={20}>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// columns.ts
|
// columns.ts
|
||||||
import AutoTooltip from '@/components/auto-tooltip';
|
import AutoTooltip from '@/components/auto-tooltip';
|
||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { ColumnsType } from 'antd/es/table';
|
import { ColumnsType } from 'antd/es/table';
|
||||||
import type { SortOrder } from 'antd/es/table/interface';
|
import type { SortOrder } from 'antd/es/table/interface';
|
||||||
@@ -23,9 +24,7 @@ const useCredentialColumns = (
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
render: (text: string) => (
|
render: (text: string) => (
|
||||||
<AutoTooltip ghost minWidth={20}>
|
<AutoTooltip ghost minWidth={20}>
|
||||||
{text}
|
{text}
|
||||||
@@ -43,9 +42,7 @@ const useCredentialColumns = (
|
|||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
showSorterTooltip: false,
|
showSorterTooltip: false,
|
||||||
defaultSortOrder: 'descend',
|
defaultSortOrder: 'descend',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import AutoTooltip from '@/components/auto-tooltip';
|
import AutoTooltip from '@/components/auto-tooltip';
|
||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
import { SealColumnProps } from '@/components/seal-table/types';
|
import { SealColumnProps } from '@/components/seal-table/types';
|
||||||
import { OPENAI_COMPATIBLE } from '@/config/settings';
|
import { OPENAI_COMPATIBLE, tableSorter } from '@/config/settings';
|
||||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Tooltip } from 'antd';
|
import { Tooltip } from 'antd';
|
||||||
@@ -53,9 +53,7 @@ const useModelsColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
span: 5,
|
span: 5,
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
||||||
@@ -70,9 +68,7 @@ const useModelsColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'clusters.title' }),
|
title: intl.formatMessage({ id: 'clusters.title' }),
|
||||||
dataIndex: 'cluster_id',
|
dataIndex: 'cluster_id',
|
||||||
key: 'cluster_id',
|
key: 'cluster_id',
|
||||||
sorter: {
|
sorter: tableSorter(2),
|
||||||
multiple: 2
|
|
||||||
},
|
|
||||||
span: 3,
|
span: 3,
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<span className="flex flex-column" style={{ width: '100%' }}>
|
<span className="flex flex-column" style={{ width: '100%' }}>
|
||||||
@@ -87,9 +83,7 @@ const useModelsColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'models.form.source' }),
|
title: intl.formatMessage({ id: 'models.form.source' }),
|
||||||
dataIndex: 'source',
|
dataIndex: 'source',
|
||||||
key: 'source',
|
key: 'source',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
span: 5,
|
span: 5,
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<span className="flex flex-column" style={{ width: '100%' }}>
|
<span className="flex flex-column" style={{ width: '100%' }}>
|
||||||
@@ -114,9 +108,7 @@ const useModelsColumns = ({
|
|||||||
dataIndex: 'ready_replicas',
|
dataIndex: 'ready_replicas',
|
||||||
key: 'ready_replicas',
|
key: 'ready_replicas',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
sorter: {
|
sorter: tableSorter(4),
|
||||||
multiple: 4
|
|
||||||
},
|
|
||||||
span: 4,
|
span: 4,
|
||||||
editable: {
|
editable: {
|
||||||
valueType: 'number',
|
valueType: 'number',
|
||||||
@@ -133,9 +125,7 @@ const useModelsColumns = ({
|
|||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
key: 'created_at',
|
key: 'created_at',
|
||||||
defaultSortOrder: 'descend',
|
defaultSortOrder: 'descend',
|
||||||
sorter: {
|
sorter: tableSorter(5),
|
||||||
multiple: 5
|
|
||||||
},
|
|
||||||
span: 4,
|
span: 4,
|
||||||
render: (text: number) => (
|
render: (text: number) => (
|
||||||
<AutoTooltip ghost>
|
<AutoTooltip ghost>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import AutoTooltip from '@/components/auto-tooltip';
|
|||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
import { TooltipOverlayScroller } from '@/components/overlay-scroller';
|
||||||
import StatusTag from '@/components/status-tag';
|
import StatusTag from '@/components/status-tag';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { modelSourceMap } from '@/pages/llmodels/config';
|
import { modelSourceMap } from '@/pages/llmodels/config';
|
||||||
import { modelFileActions } from '@/pages/llmodels/config/button-actions';
|
import { modelFileActions } from '@/pages/llmodels/config/button-actions';
|
||||||
import { convertFileSize } from '@/utils';
|
import { convertFileSize } from '@/utils';
|
||||||
@@ -265,9 +266,7 @@ const useFilesColumns = (props: {
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'models.form.source' }),
|
title: intl.formatMessage({ id: 'models.form.source' }),
|
||||||
dataIndex: 'source',
|
dataIndex: 'source',
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
@@ -286,9 +285,7 @@ const useFilesColumns = (props: {
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'resources.worker' }),
|
title: intl.formatMessage({ id: 'resources.worker' }),
|
||||||
dataIndex: 'worker_id',
|
dataIndex: 'worker_id',
|
||||||
sorter: {
|
sorter: tableSorter(2),
|
||||||
multiple: 2
|
|
||||||
},
|
|
||||||
width: '18%',
|
width: '18%',
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
@@ -312,9 +309,7 @@ const useFilesColumns = (props: {
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'resources.modelfiles.form.path' }),
|
title: intl.formatMessage({ id: 'resources.modelfiles.form.path' }),
|
||||||
dataIndex: 'resolved_paths',
|
dataIndex: 'resolved_paths',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
width: '20%',
|
width: '20%',
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
@@ -344,9 +339,7 @@ const useFilesColumns = (props: {
|
|||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
defaultSortOrder: 'descend',
|
defaultSortOrder: 'descend',
|
||||||
key: 'created_at',
|
key: 'created_at',
|
||||||
sorter: {
|
sorter: tableSorter(4),
|
||||||
multiple: 4
|
|
||||||
},
|
|
||||||
width: 180,
|
width: 180,
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import AutoTooltip from '@/components/auto-tooltip';
|
import AutoTooltip from '@/components/auto-tooltip';
|
||||||
import ProgressBar from '@/components/progress-bar';
|
import ProgressBar from '@/components/progress-bar';
|
||||||
import InfoColumn from '@/components/simple-table/info-column';
|
import InfoColumn from '@/components/simple-table/info-column';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { convertFileSize } from '@/utils';
|
import { convertFileSize } from '@/utils';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
@@ -50,9 +51,7 @@ const useGPUColumns = (props: {
|
|||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
width: 240,
|
width: 240,
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
render: (text: string, record: GPUDeviceItem) => (
|
render: (text: string, record: GPUDeviceItem) => (
|
||||||
<AutoTooltip ghost maxWidth={240}>
|
<AutoTooltip ghost maxWidth={240}>
|
||||||
{text}
|
{text}
|
||||||
@@ -62,17 +61,13 @@ const useGPUColumns = (props: {
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'resources.table.index' }),
|
title: intl.formatMessage({ id: 'resources.table.index' }),
|
||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
sorter: {
|
sorter: tableSorter(2),
|
||||||
multiple: 2
|
|
||||||
},
|
|
||||||
render: (text: string, record: GPUDeviceItem) => <span>{text}</span>
|
render: (text: string, record: GPUDeviceItem) => <span>{text}</span>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'clusters.title' }),
|
title: intl.formatMessage({ id: 'clusters.title' }),
|
||||||
dataIndex: 'cluster_id',
|
dataIndex: 'cluster_id',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
@@ -85,9 +80,7 @@ const useGPUColumns = (props: {
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'resources.worker' }),
|
title: intl.formatMessage({ id: 'resources.worker' }),
|
||||||
dataIndex: 'worker_name',
|
dataIndex: 'worker_name',
|
||||||
sorter: {
|
sorter: tableSorter(4),
|
||||||
multiple: 4
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
@@ -98,9 +91,7 @@ const useGPUColumns = (props: {
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'resources.table.vender' }),
|
title: intl.formatMessage({ id: 'resources.table.vender' }),
|
||||||
dataIndex: 'vendor',
|
dataIndex: 'vendor',
|
||||||
sorter: {
|
sorter: tableSorter(5)
|
||||||
multiple: 5
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: `${intl.formatMessage({ id: 'resources.table.temperature' })} (°C)`,
|
title: `${intl.formatMessage({ id: 'resources.table.temperature' })} (°C)`,
|
||||||
@@ -113,9 +104,7 @@ const useGPUColumns = (props: {
|
|||||||
title: `${intl.formatMessage({ id: 'resources.table.utilization' })}`,
|
title: `${intl.formatMessage({ id: 'resources.table.utilization' })}`,
|
||||||
dataIndex: 'core.utilization_rate',
|
dataIndex: 'core.utilization_rate',
|
||||||
key: 'core.utilization_rate',
|
key: 'core.utilization_rate',
|
||||||
sorter: {
|
sorter: tableSorter(6),
|
||||||
multiple: 6
|
|
||||||
},
|
|
||||||
render: (text: number, record: GPUDeviceItem) => {
|
render: (text: number, record: GPUDeviceItem) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -134,9 +123,7 @@ const useGPUColumns = (props: {
|
|||||||
title: intl.formatMessage({ id: 'resources.table.vramutilization' }),
|
title: intl.formatMessage({ id: 'resources.table.vramutilization' }),
|
||||||
dataIndex: 'memory.utilization_rate',
|
dataIndex: 'memory.utilization_rate',
|
||||||
key: 'memory.utilization_rate',
|
key: 'memory.utilization_rate',
|
||||||
sorter: {
|
sorter: tableSorter(7),
|
||||||
multiple: 7
|
|
||||||
},
|
|
||||||
render: (text: number, record: GPUDeviceItem, index: number) => {
|
render: (text: number, record: GPUDeviceItem, index: number) => {
|
||||||
return (
|
return (
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import LabelsCell from '@/components/label-cell';
|
|||||||
import ProgressBar from '@/components/progress-bar';
|
import ProgressBar from '@/components/progress-bar';
|
||||||
import InfoColumn from '@/components/simple-table/info-column';
|
import InfoColumn from '@/components/simple-table/info-column';
|
||||||
import StatusTag from '@/components/status-tag';
|
import StatusTag from '@/components/status-tag';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { convertFileSize } from '@/utils';
|
import { convertFileSize } from '@/utils';
|
||||||
import {
|
import {
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
@@ -274,9 +275,7 @@ const useWorkerColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
width: 100,
|
width: 100,
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
render: (text: string) => (
|
render: (text: string) => (
|
||||||
<AutoTooltip ghost maxWidth={240}>
|
<AutoTooltip ghost maxWidth={240}>
|
||||||
{text}
|
{text}
|
||||||
@@ -301,9 +300,7 @@ const useWorkerColumns = ({
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'common.table.status' }),
|
title: intl.formatMessage({ id: 'common.table.status' }),
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
sorter: {
|
sorter: tableSorter(2),
|
||||||
multiple: 2
|
|
||||||
},
|
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<StatusTag
|
<StatusTag
|
||||||
maxTooltipWidth={400}
|
maxTooltipWidth={400}
|
||||||
@@ -319,9 +316,7 @@ const useWorkerColumns = ({
|
|||||||
{
|
{
|
||||||
title: 'IP',
|
title: 'IP',
|
||||||
dataIndex: 'ip',
|
dataIndex: 'ip',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
render: (text: string, record) => (
|
render: (text: string, record) => (
|
||||||
<AutoTooltip ghost maxWidth={240}>
|
<AutoTooltip ghost maxWidth={240}>
|
||||||
{renderIP(text, record)}
|
{renderIP(text, record)}
|
||||||
@@ -331,9 +326,7 @@ const useWorkerColumns = ({
|
|||||||
{
|
{
|
||||||
title: 'CPU',
|
title: 'CPU',
|
||||||
dataIndex: 'status.cpu.utilization_rate',
|
dataIndex: 'status.cpu.utilization_rate',
|
||||||
sorter: {
|
sorter: tableSorter(4),
|
||||||
multiple: 4
|
|
||||||
},
|
|
||||||
render: (text: string, record) =>
|
render: (text: string, record) =>
|
||||||
statusAvailable(record) ? (
|
statusAvailable(record) ? (
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
@@ -346,9 +339,7 @@ const useWorkerColumns = ({
|
|||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'resources.table.memory' }),
|
title: intl.formatMessage({ id: 'resources.table.memory' }),
|
||||||
dataIndex: 'status.memory.utilization_rate',
|
dataIndex: 'status.memory.utilization_rate',
|
||||||
sorter: {
|
sorter: tableSorter(5),
|
||||||
multiple: 5
|
|
||||||
},
|
|
||||||
render: (_, record) =>
|
render: (_, record) =>
|
||||||
statusAvailable(record) ? (
|
statusAvailable(record) ? (
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import AutoTooltip from '@/components/auto-tooltip';
|
|||||||
import DropdownButtons from '@/components/drop-down-buttons';
|
import DropdownButtons from '@/components/drop-down-buttons';
|
||||||
import IconFont from '@/components/icon-font';
|
import IconFont from '@/components/icon-font';
|
||||||
import icons from '@/components/icon-font/icons';
|
import icons from '@/components/icon-font/icons';
|
||||||
|
import { tableSorter } from '@/config/settings';
|
||||||
import { useIntl, useModel } from '@umijs/max';
|
import { useIntl, useModel } from '@umijs/max';
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { Tag } from 'antd';
|
import { Tag } from 'antd';
|
||||||
@@ -71,9 +72,7 @@ const useUsersColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
key: 'username',
|
key: 'username',
|
||||||
sorter: {
|
sorter: tableSorter(1),
|
||||||
multiple: 1
|
|
||||||
},
|
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<AutoTooltip ghost style={{ maxWidth: 400 }}>
|
<AutoTooltip ghost style={{ maxWidth: 400 }}>
|
||||||
{text}
|
{text}
|
||||||
@@ -84,9 +83,7 @@ const useUsersColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'users.table.role' }),
|
title: intl.formatMessage({ id: 'users.table.role' }),
|
||||||
dataIndex: 'is_admin',
|
dataIndex: 'is_admin',
|
||||||
key: 'is_admin',
|
key: 'is_admin',
|
||||||
sorter: {
|
sorter: tableSorter(6),
|
||||||
multiple: 6
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
@@ -125,9 +122,7 @@ const useUsersColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'users.form.source' }),
|
title: intl.formatMessage({ id: 'users.form.source' }),
|
||||||
dataIndex: 'source',
|
dataIndex: 'source',
|
||||||
key: 'source',
|
key: 'source',
|
||||||
sorter: {
|
sorter: tableSorter(3),
|
||||||
multiple: 3
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
@@ -141,9 +136,7 @@ const useUsersColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'users.table.status' }),
|
title: intl.formatMessage({ id: 'users.table.status' }),
|
||||||
dataIndex: 'is_active',
|
dataIndex: 'is_active',
|
||||||
key: 'is_active',
|
key: 'is_active',
|
||||||
sorter: {
|
sorter: tableSorter(4),
|
||||||
multiple: 4
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
@@ -191,9 +184,7 @@ const useUsersColumns = ({
|
|||||||
key: 'created_at',
|
key: 'created_at',
|
||||||
defaultSortOrder: 'descend',
|
defaultSortOrder: 'descend',
|
||||||
showSorterTooltip: false,
|
showSorterTooltip: false,
|
||||||
sorter: {
|
sorter: tableSorter(5),
|
||||||
multiple: 5
|
|
||||||
},
|
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
showTitle: false
|
showTitle: false
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user