1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-01 20:05:23 +02:00

feat(docker): migrate files table to react [EE-4663] (#8916)

This commit is contained in:
Chaim Lev-Ari 2023-07-16 10:59:58 +03:00 committed by GitHub
parent 146681e1c7
commit 09f60c3277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 529 additions and 229 deletions

View file

@ -0,0 +1,49 @@
import { ComponentProps } from 'react';
import { FilesTable } from '@/react/docker/components/FilesTable';
import { createPersistedStore } from '@@/datatables/types';
import { useTableState } from '@@/datatables/useTableState';
const tableKey = 'host-browser';
const settingsStore = createPersistedStore(tableKey, 'Name');
interface Props
extends Omit<
ComponentProps<typeof FilesTable>,
'onSearchChange' | 'tableState' | 'title'
> {
relativePath: string;
}
export function AgentVolumeBrowser({
relativePath,
dataset,
isRoot,
onBrowse,
onDelete,
onDownload,
onFileSelectedForUpload,
onGoToParent,
onRename,
isUploadAllowed,
}: Props) {
const tableState = useTableState(settingsStore, tableKey);
return (
<FilesTable
tableState={tableState}
dataset={dataset}
title={`Volume browser - ${relativePath}`}
isRoot={isRoot}
onRename={onRename}
onBrowse={onBrowse}
onDownload={onDownload}
onDelete={onDelete}
isUploadAllowed={isUploadAllowed}
onFileSelectedForUpload={onFileSelectedForUpload}
onGoToParent={onGoToParent}
/>
);
}