This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new d4db882bc2 [INLONG-10524][Dashboard] Modify the time column (#10525)
d4db882bc2 is described below
commit d4db882bc2ecc943abd897356a6167ee6b8e4a94
Author: kamianlaida <[email protected]>
AuthorDate: Fri Jun 28 14:45:50 2024 +0800
[INLONG-10524][Dashboard] Modify the time column (#10525)
---
.../plugins/consumes/common/ConsumeDefaultInfo.ts | 15 ----
.../src/plugins/groups/common/GroupDefaultInfo.ts | 1 +
.../src/plugins/sync/common/SyncDefaultInfo.ts | 3 +
.../src/ui/pages/AgentModule/config.tsx | 17 +++--
.../src/ui/pages/AgentPackage/config.tsx | 17 +++--
.../src/ui/pages/ClusterTags/ClusterList.tsx | 13 ++++
inlong-dashboard/src/ui/pages/Clusters/index.tsx | 83 +++++++++++++---------
.../src/ui/pages/ConsumeDashboard/config.tsx | 23 ++++++
.../src/ui/pages/ConsumeDashboard/index.tsx | 1 +
.../src/ui/pages/GroupDashboard/config.tsx | 25 +++++++
inlong-dashboard/src/ui/pages/Nodes/index.tsx | 30 ++++++--
.../src/ui/pages/SynchronizeDashboard/config.tsx | 26 ++++++-
.../src/ui/pages/TenantManagement/config.tsx | 17 +++--
.../src/ui/pages/UserManagement/config.tsx | 17 +++--
14 files changed, 214 insertions(+), 74 deletions(-)
diff --git a/inlong-dashboard/src/plugins/consumes/common/ConsumeDefaultInfo.ts
b/inlong-dashboard/src/plugins/consumes/common/ConsumeDefaultInfo.ts
index ec8d474dd8..11904e44b1 100644
--- a/inlong-dashboard/src/plugins/consumes/common/ConsumeDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/consumes/common/ConsumeDefaultInfo.ts
@@ -176,21 +176,6 @@ export class ConsumeDefaultInfo implements
DataWithBackend, RenderRow, RenderLis
@I18n('pages.ConsumeDashboard.config.RecentConsumeTime')
readonly lastConsumeTime: string;
- @FieldDecorator({
- type: 'select',
- props: {
- allowClear: true,
- dropdownMatchSelectWidth: false,
- options: lastConsumerStatusList,
- },
- visible: false,
- })
- @ColumnDecorator({
- render: text => text && genLastConsumerStatusTag(text),
- })
- @I18n('pages.ConsumeDashboard.config.OperatingStatus')
- readonly lastConsumeStatus: string;
-
@ColumnDecorator()
@I18n('basic.Creator')
readonly creator: string;
diff --git a/inlong-dashboard/src/plugins/groups/common/GroupDefaultInfo.ts
b/inlong-dashboard/src/plugins/groups/common/GroupDefaultInfo.ts
index 65009e3d47..47397b9999 100644
--- a/inlong-dashboard/src/plugins/groups/common/GroupDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/groups/common/GroupDefaultInfo.ts
@@ -95,6 +95,7 @@ export class GroupDefaultInfo implements DataWithBackend,
RenderRow, RenderList
},
})
@ColumnDecorator({
+ width: 300,
render: type => groups.find(c => c.value === type)?.label || type,
})
@I18n('meta.Group.MQType')
diff --git a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
index 9e81013208..90cb34e144 100644
--- a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
@@ -103,6 +103,9 @@ export class SyncDefaultInfo implements DataWithBackend,
RenderRow, RenderList {
initialValue: 'NONE',
hidden: true,
})
+ @ColumnDecorator({
+ width: 300,
+ })
@I18n('meta.Group.MQType')
mqType: string;
diff --git a/inlong-dashboard/src/ui/pages/AgentModule/config.tsx
b/inlong-dashboard/src/ui/pages/AgentModule/config.tsx
index 8f6d90a15e..861721448b 100644
--- a/inlong-dashboard/src/ui/pages/AgentModule/config.tsx
+++ b/inlong-dashboard/src/ui/pages/AgentModule/config.tsx
@@ -35,15 +35,22 @@ export const useColumns = ({ onDelete, openModal }) => {
{
title: i18n.t('basic.Creator'),
dataIndex: 'creator',
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime && timestampFormat(record.createTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Modifier'),
dataIndex: 'modifier',
- },
- {
- title: i18n.t('basic.ModifyTime'),
- dataIndex: 'modifyTime',
- render: text => text && timestampFormat(text),
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime && timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
},
];
return defaultColumns.concat([
diff --git a/inlong-dashboard/src/ui/pages/AgentPackage/config.tsx
b/inlong-dashboard/src/ui/pages/AgentPackage/config.tsx
index 8b680decf1..3d01e479ff 100644
--- a/inlong-dashboard/src/ui/pages/AgentPackage/config.tsx
+++ b/inlong-dashboard/src/ui/pages/AgentPackage/config.tsx
@@ -39,15 +39,22 @@ export const useColumns = ({ onDelete, openModal }) => {
{
title: i18n.t('basic.Creator'),
dataIndex: 'creator',
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime && timestampFormat(record.createTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Modifier'),
dataIndex: 'modifier',
- },
- {
- title: i18n.t('basic.ModifyTime'),
- dataIndex: 'modifyTime',
- render: text => text && timestampFormat(text),
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime && timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
},
];
return defaultColumns.concat([
diff --git a/inlong-dashboard/src/ui/pages/ClusterTags/ClusterList.tsx
b/inlong-dashboard/src/ui/pages/ClusterTags/ClusterList.tsx
index e3d64e60ee..2fe8661d2d 100644
--- a/inlong-dashboard/src/ui/pages/ClusterTags/ClusterList.tsx
+++ b/inlong-dashboard/src/ui/pages/ClusterTags/ClusterList.tsx
@@ -26,6 +26,7 @@ import { useRequest } from '@/ui/hooks';
import { clusters } from '@/plugins/clusters';
import ClusterBindModal from './ClusterBindModal';
import request from '@/core/utils/request';
+import { timestampFormat } from '@/core/utils';
export interface ClusterListProps {
clusterTag: string;
@@ -149,11 +150,23 @@ const Comp: React.FC<ClusterListProps> = ({ clusterTag })
=> {
title: i18n.t('basic.Creator'),
dataIndex: 'creator',
ellipsisMulti: 2,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime &&
timestampFormat(record.createTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Modifier'),
dataIndex: 'modifier',
ellipsisMulti: 2,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
},
];
diff --git a/inlong-dashboard/src/ui/pages/Clusters/index.tsx
b/inlong-dashboard/src/ui/pages/Clusters/index.tsx
index 300e943bf6..d5ffea25ec 100644
--- a/inlong-dashboard/src/ui/pages/Clusters/index.tsx
+++ b/inlong-dashboard/src/ui/pages/Clusters/index.tsx
@@ -131,41 +131,56 @@ const Comp: React.FC = () => {
}, [Entity]);
const columns = useMemo(() => {
- return entityColumns?.concat([
- {
- title: i18n.t('pages.Clusters.LastModifier'),
- dataIndex: 'modifier',
- width: 150,
- render: (text, record: any) => (
- <>
- <div>{text}</div>
- <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
- </>
- ),
- },
- {
- title: i18n.t('basic.Operating'),
- dataIndex: 'action',
- width: 200,
- render: (text, record) => (
- <>
- {(record.type === 'DATAPROXY' || record.type === 'AGENT') && (
- <Link
to={`/clusters/node?type=${record.type}&clusterId=${record.id}`}>
- {i18n.t('pages.Clusters.Node.Name')}
- </Link>
- )}
- {record.type !== 'DATAPROXY' && record.type !== 'AGENT' && (
- <Button type="link" onClick={() => onEdit(record)}>
- {i18n.t('basic.Edit')}
+ return entityColumns
+ ?.map(item => {
+ if (item.dataIndex === 'creator') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime &&
timestampFormat(record.createTime)}</div>
+ </>
+ ),
+ };
+ }
+ return item;
+ })
+ .concat([
+ {
+ title: i18n.t('pages.Clusters.LastModifier'),
+ dataIndex: 'modifier',
+ width: 150,
+ render: (text, record: any) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
+ },
+ {
+ title: i18n.t('basic.Operating'),
+ dataIndex: 'action',
+ width: 200,
+ render: (text, record) => (
+ <>
+ {(record.type === 'DATAPROXY' || record.type === 'AGENT') && (
+ <Link
to={`/clusters/node?type=${record.type}&clusterId=${record.id}`}>
+ {i18n.t('pages.Clusters.Node.Name')}
+ </Link>
+ )}
+ {record.type !== 'DATAPROXY' && record.type !== 'AGENT' && (
+ <Button type="link" onClick={() => onEdit(record)}>
+ {i18n.t('basic.Edit')}
+ </Button>
+ )}
+ <Button type="link" onClick={() => onDelete(record)}>
+ {i18n.t('basic.Delete')}
</Button>
- )}
- <Button type="link" onClick={() => onDelete(record)}>
- {i18n.t('basic.Delete')}
- </Button>
- </>
- ),
- } as any,
- ]);
+ </>
+ ),
+ } as any,
+ ]);
}, [entityColumns, onDelete]);
return (
diff --git a/inlong-dashboard/src/ui/pages/ConsumeDashboard/config.tsx
b/inlong-dashboard/src/ui/pages/ConsumeDashboard/config.tsx
index 8dc97b5d63..d9753af793 100644
--- a/inlong-dashboard/src/ui/pages/ConsumeDashboard/config.tsx
+++ b/inlong-dashboard/src/ui/pages/ConsumeDashboard/config.tsx
@@ -23,6 +23,7 @@ import { Link } from 'react-router-dom';
import i18n from '@/i18n';
import { DashTotal, DashToBeAssigned, DashPending, DashRejected } from
'@/ui/components/Icons';
import { useDefaultMeta, useLoadMeta, ConsumeMetaType } from '@/plugins';
+import { timestampFormat } from '@/core/utils';
export const dashCardList = [
{
@@ -65,6 +66,28 @@ export const useColumns = ({ onDelete }) => {
if (item.dataIndex === 'consumerGroup') {
return { ...item, render: (text, record) => <Link
to={genDetailUrl(record)}>{text}</Link> };
}
+ if (item.dataIndex === 'creator') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime &&
timestampFormat(record.createTime)}</div>
+ </>
+ ),
+ };
+ }
+ if (item.dataIndex === 'modifier') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
+ };
+ }
return item;
})
.concat([
diff --git a/inlong-dashboard/src/ui/pages/ConsumeDashboard/index.tsx
b/inlong-dashboard/src/ui/pages/ConsumeDashboard/index.tsx
index 981bd71279..b03d9d4687 100644
--- a/inlong-dashboard/src/ui/pages/ConsumeDashboard/index.tsx
+++ b/inlong-dashboard/src/ui/pages/ConsumeDashboard/index.tsx
@@ -130,6 +130,7 @@ const Comp: React.FC = () => {
name: 'lastConsumeStatus',
label: i18n.t('pages.ConsumeDashboard.config.OperatingStatus'),
initialValue: defaultValues.lastConsumeStatus,
+ visible: false,
props: {
allowClear: true,
options: lastConsumerStatusList,
diff --git a/inlong-dashboard/src/ui/pages/GroupDashboard/config.tsx
b/inlong-dashboard/src/ui/pages/GroupDashboard/config.tsx
index 200e834404..016e02cebc 100644
--- a/inlong-dashboard/src/ui/pages/GroupDashboard/config.tsx
+++ b/inlong-dashboard/src/ui/pages/GroupDashboard/config.tsx
@@ -23,6 +23,7 @@ import i18n from '@/i18n';
import { DashTotal, DashToBeAssigned, DashPending, DashRejected } from
'@/ui/components/Icons';
import { Button } from 'antd';
import { useDefaultMeta, useLoadMeta, GroupMetaType } from '@/plugins';
+import { timestampFormat } from '@/core/utils';
export const dashCardList = [
{
@@ -67,12 +68,36 @@ export const useColumns = ({ onDelete, openModal,
onRestart, onStop }) => {
if (item.dataIndex === 'inlongGroupId') {
return { ...item, render: (text, record) => <Link
to={genDetailUrl(record)}>{text}</Link> };
}
+ if (item.dataIndex === 'creator') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime &&
timestampFormat(record.createTime)}</div>
+ </>
+ ),
+ };
+ }
+ if (item.dataIndex === 'modifier') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
+ };
+ }
return item;
})
+ .filter(item => item.dataIndex !== 'createTime')
.concat([
{
title: i18n.t('basic.Operating'),
dataIndex: 'action',
+ width: 200,
render: (text, record) => (
<>
<Button type="link">
diff --git a/inlong-dashboard/src/ui/pages/Nodes/index.tsx
b/inlong-dashboard/src/ui/pages/Nodes/index.tsx
index 5bcc02fb6a..21b442cd5e 100644
--- a/inlong-dashboard/src/ui/pages/Nodes/index.tsx
+++ b/inlong-dashboard/src/ui/pages/Nodes/index.tsx
@@ -26,6 +26,7 @@ import { defaultSize } from '@/configs/pagination';
import { dao } from '@/plugins/nodes';
import { useDefaultMeta, useLoadMeta, NodeMetaType } from '@/plugins';
import DetailModal from './DetailModal';
+import { timestampFormat } from '@/core/utils';
const { useListNodeDao, useDeleteNodeDao } = dao;
@@ -115,10 +116,31 @@ const Comp: React.FC = () => {
const columns = useMemo(() => {
return entityColumns
- ?.map(item => ({
- ...item,
- ellipsisMulti: 2,
- }))
+ ?.map(item => {
+ if (item.dataIndex === 'creator') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime &&
timestampFormat(record.createTime)}</div>
+ </>
+ ),
+ };
+ }
+ if (item.dataIndex === 'modifier') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
+ };
+ }
+ return item;
+ })
.concat([
{
title: i18n.t('basic.Operating'),
diff --git a/inlong-dashboard/src/ui/pages/SynchronizeDashboard/config.tsx
b/inlong-dashboard/src/ui/pages/SynchronizeDashboard/config.tsx
index 0b3d7b07b2..de6880d854 100644
--- a/inlong-dashboard/src/ui/pages/SynchronizeDashboard/config.tsx
+++ b/inlong-dashboard/src/ui/pages/SynchronizeDashboard/config.tsx
@@ -23,7 +23,7 @@ import i18n from '@/i18n';
import { DashTotal, DashToBeAssigned, DashPending, DashRejected } from
'@/ui/components/Icons';
import { Button } from 'antd';
import { useDefaultMeta, useLoadMeta, SyncMetaType } from '@/plugins';
-
+import { timestampFormat } from '@/core/utils';
export const dashCardList = [
{
desc: i18n.t('pages.SynchronizeDashboard.config.Total'),
@@ -67,11 +67,35 @@ export const useColumns = ({ onDelete, openModal,
onRestart, onStop }) => {
if (item.dataIndex === 'inlongGroupId') {
return { ...item, render: (text, record) => <Link
to={genDetailUrl(record)}>{text}</Link> };
}
+ if (item.dataIndex === 'creator') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime &&
timestampFormat(record.createTime)}</div>
+ </>
+ ),
+ };
+ }
+ if (item.dataIndex === 'modifier') {
+ return {
+ ...item,
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime &&
timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
+ };
+ }
return item;
})
+ .filter(item => item.dataIndex !== 'createTime')
.concat([
{
title: i18n.t('basic.Operating'),
+ width: 200,
dataIndex: 'action',
render: (text, record) => (
<>
diff --git a/inlong-dashboard/src/ui/pages/TenantManagement/config.tsx
b/inlong-dashboard/src/ui/pages/TenantManagement/config.tsx
index b8fffa8c25..e4827d7100 100644
--- a/inlong-dashboard/src/ui/pages/TenantManagement/config.tsx
+++ b/inlong-dashboard/src/ui/pages/TenantManagement/config.tsx
@@ -50,15 +50,22 @@ export const getColumns = ({ onEdit }) => {
{
title: i18n.t('pages.Tenant.config.Creator'),
dataIndex: 'creator',
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime && timestampFormat(record.createTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Modifier'),
dataIndex: 'modifier',
- },
- {
- title: i18n.t('pages.Tenant.config.CreateTime'),
- dataIndex: 'createTime',
- render: text => text && timestampFormat(text),
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime && timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Operating'),
diff --git a/inlong-dashboard/src/ui/pages/UserManagement/config.tsx
b/inlong-dashboard/src/ui/pages/UserManagement/config.tsx
index 753c8a3286..5e3fa8cf48 100644
--- a/inlong-dashboard/src/ui/pages/UserManagement/config.tsx
+++ b/inlong-dashboard/src/ui/pages/UserManagement/config.tsx
@@ -47,15 +47,22 @@ export const getColumns = ({ onEdit, onDelete }) => {
{
title: i18n.t('pages.UserManagement.config.Creator'),
dataIndex: 'creator',
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.createTime && timestampFormat(record.createTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Modifier'),
dataIndex: 'modifier',
- },
- {
- title: i18n.t('pages.UserManagement.config.CreateTime'),
- dataIndex: 'createTime',
- render: text => text && timestampFormat(text),
+ render: (text, record) => (
+ <>
+ <div>{text}</div>
+ <div>{record.modifyTime && timestampFormat(record.modifyTime)}</div>
+ </>
+ ),
},
{
title: i18n.t('basic.Status'),