mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
fix(stacks): show stack containers [EE-2359] (#6375)
Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
This commit is contained in:
parent
085762a1f4
commit
584a46d9d4
8 changed files with 52 additions and 65 deletions
|
@ -50,9 +50,10 @@ import { useColumns } from './columns';
|
|||
export interface ContainerTableProps {
|
||||
isAddActionVisible: boolean;
|
||||
dataset: DockerContainer[];
|
||||
onRefresh(): Promise<void>;
|
||||
onRefresh?(): Promise<void>;
|
||||
isHostColumnVisible: boolean;
|
||||
autoFocusSearch: boolean;
|
||||
tableKey?: string;
|
||||
}
|
||||
|
||||
export function ContainersDatatable({
|
||||
|
@ -150,7 +151,7 @@ export function ContainersDatatable({
|
|||
<TableSettingsMenu
|
||||
quickActions={<QuickActionsSettings actions={actions} />}
|
||||
>
|
||||
<ContainersDatatableSettings />
|
||||
<ContainersDatatableSettings isRefreshVisible={!!onRefresh} />
|
||||
</TableSettingsMenu>
|
||||
</TableTitleActions>
|
||||
</TableTitle>
|
||||
|
|
|
@ -13,7 +13,11 @@ interface Props extends ContainerTableProps {
|
|||
endpoint: Environment;
|
||||
}
|
||||
|
||||
export function ContainersDatatableContainer({ endpoint, ...props }: Props) {
|
||||
export function ContainersDatatableContainer({
|
||||
endpoint,
|
||||
tableKey = 'containers',
|
||||
...props
|
||||
}: Props) {
|
||||
const defaultSettings = {
|
||||
autoRefreshRate: 0,
|
||||
truncateContainerName: 32,
|
||||
|
@ -25,8 +29,8 @@ export function ContainersDatatableContainer({ endpoint, ...props }: Props) {
|
|||
|
||||
return (
|
||||
<EnvironmentProvider environment={endpoint}>
|
||||
<TableSettingsProvider defaults={defaultSettings} storageKey="containers">
|
||||
<SearchBarProvider>
|
||||
<TableSettingsProvider defaults={defaultSettings} storageKey={tableKey}>
|
||||
<SearchBarProvider storageKey={tableKey}>
|
||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||
<ContainersDatatable {...props} />
|
||||
</SearchBarProvider>
|
||||
|
@ -40,13 +44,10 @@ export const ContainersDatatableAngular = react2angular(
|
|||
[
|
||||
'endpoint',
|
||||
'isAddActionVisible',
|
||||
'containerService',
|
||||
'httpRequestHelper',
|
||||
'notifications',
|
||||
'modalService',
|
||||
'dataset',
|
||||
'onRefresh',
|
||||
'isHostColumnVisible',
|
||||
'autoFocusSearch',
|
||||
'tableKey',
|
||||
]
|
||||
);
|
||||
|
|
|
@ -3,10 +3,13 @@ import { useTableSettings } from '@/portainer/components/datatables/components/u
|
|||
import { Checkbox } from '@/portainer/components/form-components/Checkbox';
|
||||
import type { ContainersTableSettings } from '@/docker/containers/types';
|
||||
|
||||
export function ContainersDatatableSettings() {
|
||||
const { settings, setTableSettings } = useTableSettings<
|
||||
ContainersTableSettings
|
||||
>();
|
||||
interface Props {
|
||||
isRefreshVisible: boolean;
|
||||
}
|
||||
|
||||
export function ContainersDatatableSettings({ isRefreshVisible }: Props) {
|
||||
const { settings, setTableSettings } =
|
||||
useTableSettings<ContainersTableSettings>();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -22,10 +25,12 @@ export function ContainersDatatableSettings() {
|
|||
}
|
||||
/>
|
||||
|
||||
<TableSettingsMenuAutoRefresh
|
||||
value={settings.autoRefreshRate}
|
||||
onChange={handleRefreshRateChange}
|
||||
/>
|
||||
{isRefreshVisible && (
|
||||
<TableSettingsMenuAutoRefresh
|
||||
value={settings.autoRefreshRate}
|
||||
onChange={handleRefreshRateChange}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue