Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-10504][Dashboard] Added details button to tag management #10587

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions inlong-dashboard/src/ui/pages/ClusterTags/ClusterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { clusters } from '@/plugins/clusters';
import ClusterBindModal from './ClusterBindModal';
import request from '@/core/utils/request';
import { timestampFormat } from '@/core/utils';
import CreateModal from '@/ui/pages/Clusters/CreateModal';

export interface ClusterListProps {
clusterTag: string;
Expand Down Expand Up @@ -106,7 +107,12 @@ const Comp: React.FC<ClusterListProps> = ({ clusterTag }) => {
},
[clusterTag, getList],
);

const [createModal, setCreateModal] = useState<Record<string, unknown>>({
open: false,
});
function onshowCluster(id, type) {
setCreateModal({ open: true, id: id, type: type });
}
const onChange = ({ current: pageNum, pageSize }) => {
setOptions(prev => ({
...prev,
Expand Down Expand Up @@ -142,9 +148,14 @@ const Comp: React.FC<ClusterListProps> = ({ clusterTag }) => {
ellipsisMulti: 2,
},
{
title: i18n.t('pages.Clusters.Description'),
dataIndex: 'description',
title: i18n.t('pages.Clusters.Type'),
dataIndex: 'type',
ellipsisMulti: 2,
render: (text, record) => (
<>
<div>{text.toLowerCase()}</div>
</>
),
},
{
title: i18n.t('basic.Creator'),
Expand Down Expand Up @@ -174,13 +185,20 @@ const Comp: React.FC<ClusterListProps> = ({ clusterTag }) => {
{
title: i18n.t('basic.Operating'),
dataIndex: 'action',
width: 200,
width: 150,
render: (text, record) => (
<>
{/* <Button type="link">{i18n.t('basic.Detail')}</Button> */}
<Button type="link" onClick={() => onDelete(record)}>
{i18n.t('pages.ClusterTags.DelCluster')}
</Button>
<Button
style={{ marginLeft: '20px' }}
type="link"
onClick={() => onshowCluster(record.id, record.type)}
>
{i18n.t('basic.Detail')}
</Button>
</>
),
} as any,
Expand Down Expand Up @@ -219,6 +237,16 @@ const Comp: React.FC<ClusterListProps> = ({ clusterTag }) => {
}}
onCancel={() => setClusterBindModal({ open: false })}
/>
<CreateModal
{...createModal}
defaultType={options.type}
open={createModal.open as boolean}
onOk={async () => {
await getList();
setCreateModal({ open: false });
}}
onCancel={() => setCreateModal({ open: false })}
/>
</>
);
};
Expand Down
Loading