portainer/app/react/kubernetes/datatables/DefaultDatatableSettings.tsx

40 lines
940 B
TypeScript

import { TableSettingsMenuAutoRefresh } from '@@/datatables/TableSettingsMenuAutoRefresh';
import {
BasicTableSettings,
RefreshableTableSettings,
} from '@@/datatables/types';
import {
SystemResourcesSettings,
SystemResourcesTableSettings,
} from './SystemResourcesSettings';
export interface TableSettings
extends BasicTableSettings,
RefreshableTableSettings,
SystemResourcesTableSettings {}
export function DefaultDatatableSettings({
settings,
}: {
settings: TableSettings;
}) {
return (
<>
<SystemResourcesSettings
value={settings.showSystemResources}
onChange={(value) => settings.setShowSystemResources(value)}
/>
<TableSettingsMenuAutoRefresh
value={settings.autoRefreshRate}
onChange={handleRefreshRateChange}
/>
</>
);
function handleRefreshRateChange(autoRefreshRate: number) {
settings.setAutoRefreshRate(autoRefreshRate);
}
}