mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
refactor(docker/services): migrate service tasks to react [EE-4676] (#10328)
This commit is contained in:
parent
70455320be
commit
1fa63f6ab7
24 changed files with 175 additions and 259 deletions
|
@ -0,0 +1,37 @@
|
|||
import { List } from 'lucide-react';
|
||||
|
||||
import { Datatable } from '@@/datatables';
|
||||
import { createPersistedStore } from '@@/datatables/types';
|
||||
import { useTableState } from '@@/datatables/useTableState';
|
||||
import { withMeta } from '@@/datatables/extend-options/withMeta';
|
||||
|
||||
import { useColumns } from './columns';
|
||||
import { DecoratedTask } from './types';
|
||||
|
||||
const storageKey = 'docker-service-tasks';
|
||||
const store = createPersistedStore(storageKey);
|
||||
|
||||
export function TasksDatatable({
|
||||
dataset,
|
||||
isSlotColumnVisible,
|
||||
serviceName,
|
||||
}: {
|
||||
dataset: DecoratedTask[];
|
||||
isSlotColumnVisible: boolean;
|
||||
serviceName: string;
|
||||
}) {
|
||||
const tableState = useTableState(store, storageKey);
|
||||
const columns = useColumns(isSlotColumnVisible);
|
||||
|
||||
return (
|
||||
<Datatable
|
||||
title="Tasks"
|
||||
titleIcon={List}
|
||||
settingsManager={tableState}
|
||||
columns={columns}
|
||||
dataset={dataset}
|
||||
emptyContentLabel="No task available."
|
||||
extendTableOptions={withMeta({ table: 'tasks', serviceName })}
|
||||
/>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue