mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
fix(apps): persist table settings [r8s-120] (#10)
Co-authored-by: testA113 <aliharriss1995@gmail.com>
This commit is contained in:
parent
fd0bc652a9
commit
c88382ec1f
8 changed files with 13 additions and 86 deletions
|
@ -1,4 +1,4 @@
|
|||
import { useEffect, useMemo } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { BoxIcon } from 'lucide-react';
|
||||
import { groupBy, partition } from 'lodash';
|
||||
|
||||
|
@ -36,8 +36,6 @@ export function ApplicationsDatatable({
|
|||
namespace = '',
|
||||
namespaces,
|
||||
onNamespaceChange,
|
||||
showSystem,
|
||||
onShowSystemChange,
|
||||
hideStacks,
|
||||
}: {
|
||||
onRefresh: () => void;
|
||||
|
@ -45,8 +43,6 @@ export function ApplicationsDatatable({
|
|||
namespace?: string;
|
||||
namespaces: Array<Namespace>;
|
||||
onNamespaceChange(namespace: string): void;
|
||||
showSystem?: boolean;
|
||||
onShowSystemChange(showSystem: boolean): void;
|
||||
hideStacks: boolean;
|
||||
}) {
|
||||
const envId = useEnvironmentId();
|
||||
|
@ -61,20 +57,13 @@ export function ApplicationsDatatable({
|
|||
undefined,
|
||||
false
|
||||
);
|
||||
|
||||
const { setShowSystemResources } = tableState;
|
||||
|
||||
useEffect(() => {
|
||||
setShowSystemResources(showSystem || false);
|
||||
}, [showSystem, setShowSystemResources]);
|
||||
|
||||
const applicationsQuery = useApplications(envId, {
|
||||
refetchInterval: tableState.autoRefreshRate * 1000,
|
||||
namespace,
|
||||
withDependencies: true,
|
||||
});
|
||||
const applications = useApplicationsRowData(applicationsQuery.data);
|
||||
const filteredApplications = showSystem
|
||||
const filteredApplications = tableState.showSystemResources
|
||||
? applications
|
||||
: applications.filter(
|
||||
(application) =>
|
||||
|
@ -127,10 +116,7 @@ export function ApplicationsDatatable({
|
|||
}
|
||||
renderTableSettings={() => (
|
||||
<TableSettingsMenu>
|
||||
<DefaultDatatableSettings
|
||||
settings={tableState}
|
||||
onShowSystemChange={onShowSystemChange}
|
||||
/>
|
||||
<DefaultDatatableSettings settings={tableState} />
|
||||
</TableSettingsMenu>
|
||||
)}
|
||||
description={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue