2022-04-19 18:43:36 +00:00
|
|
|
import { useRouter } from '@uirouter/react';
|
|
|
|
|
2022-10-23 06:53:25 +00:00
|
|
|
import { useEnvironmentList } from '@/react/portainer/environments/queries/useEnvironmentList';
|
|
|
|
import { EdgeTypes } from '@/react/portainer/environments/types';
|
2022-04-19 18:43:36 +00:00
|
|
|
|
2022-06-22 17:11:46 +00:00
|
|
|
import { InformationPanel } from '@@/InformationPanel';
|
|
|
|
import { TextTip } from '@@/Tip/TextTip';
|
2022-06-17 16:18:42 +00:00
|
|
|
import { TableSettingsProvider } from '@@/datatables/useTableSettings';
|
|
|
|
import { PageHeader } from '@@/PageHeader';
|
|
|
|
|
2022-04-19 18:43:36 +00:00
|
|
|
import { DataTable } from './Datatable/Datatable';
|
|
|
|
import { TableSettings } from './Datatable/types';
|
|
|
|
|
|
|
|
export function WaitingRoomView() {
|
|
|
|
const storageKey = 'edge-devices-waiting-room';
|
|
|
|
const router = useRouter();
|
|
|
|
const { environments, isLoading, totalCount } = useEnvironmentList({
|
2022-07-19 16:00:45 +00:00
|
|
|
edgeDevice: true,
|
|
|
|
edgeDeviceUntrusted: true,
|
2022-09-22 20:05:10 +00:00
|
|
|
excludeSnapshots: true,
|
2022-07-19 16:00:45 +00:00
|
|
|
types: EdgeTypes,
|
2022-04-19 18:43:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
if (process.env.PORTAINER_EDITION !== 'BE') {
|
|
|
|
router.stateService.go('edge.devices');
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<PageHeader
|
|
|
|
title="Waiting Room"
|
|
|
|
breadcrumbs={[
|
|
|
|
{ label: 'Edge Devices', link: 'edge.devices' },
|
|
|
|
{ label: 'Waiting Room' },
|
|
|
|
]}
|
|
|
|
/>
|
2022-06-22 17:11:46 +00:00
|
|
|
|
|
|
|
<InformationPanel>
|
|
|
|
<TextTip color="blue">
|
|
|
|
Only environments generated from the AEEC script will appear here,
|
|
|
|
manually added environments and edge devices will bypass the waiting
|
|
|
|
room.
|
|
|
|
</TextTip>
|
|
|
|
</InformationPanel>
|
|
|
|
|
2022-04-19 18:43:36 +00:00
|
|
|
<TableSettingsProvider<TableSettings>
|
|
|
|
defaults={{ pageSize: 10, sortBy: { desc: false, id: 'name' } }}
|
|
|
|
storageKey={storageKey}
|
|
|
|
>
|
|
|
|
<DataTable
|
|
|
|
devices={environments}
|
|
|
|
totalCount={totalCount}
|
|
|
|
isLoading={isLoading}
|
|
|
|
storageKey={storageKey}
|
|
|
|
/>
|
|
|
|
</TableSettingsProvider>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|