2022-05-23 07:57:22 +00:00
|
|
|
import { useState } from 'react';
|
|
|
|
|
|
|
|
import { useSettings } from '@/portainer/settings/queries';
|
|
|
|
import { useGroups } from '@/portainer/environment-groups/queries';
|
2022-06-17 16:18:42 +00:00
|
|
|
|
|
|
|
import { PageHeader } from '@@/PageHeader';
|
|
|
|
import { ViewLoading } from '@@/ViewLoading';
|
2022-05-23 07:57:22 +00:00
|
|
|
|
|
|
|
import { EdgeDevicesDatatableContainer } from './EdgeDevicesDatatable/EdgeDevicesDatatableContainer';
|
|
|
|
|
|
|
|
export function EdgeDevicesView() {
|
|
|
|
const [loadingMessage, setLoadingMessage] = useState('');
|
|
|
|
|
|
|
|
const settingsQuery = useSettings();
|
|
|
|
const groupsQuery = useGroups();
|
|
|
|
|
|
|
|
if (!settingsQuery.data || !groupsQuery.data) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const settings = settingsQuery.data;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<PageHeader
|
|
|
|
title="Edge Devices"
|
|
|
|
reload
|
|
|
|
breadcrumbs={[{ label: 'EdgeDevices' }]}
|
|
|
|
/>
|
|
|
|
|
|
|
|
{loadingMessage ? (
|
|
|
|
<ViewLoading message={loadingMessage} />
|
|
|
|
) : (
|
|
|
|
<EdgeDevicesDatatableContainer
|
|
|
|
setLoadingMessage={setLoadingMessage}
|
|
|
|
isFdoEnabled={
|
|
|
|
settings.EnableEdgeComputeFeatures &&
|
|
|
|
settings.fdoConfiguration.enabled
|
|
|
|
}
|
|
|
|
showWaitingRoomLink={
|
|
|
|
process.env.PORTAINER_EDITION === 'BE' &&
|
|
|
|
settings.EnableEdgeComputeFeatures &&
|
|
|
|
!settings.TrustOnFirstConnect
|
|
|
|
}
|
|
|
|
isOpenAmtEnabled={
|
|
|
|
settings.EnableEdgeComputeFeatures &&
|
|
|
|
settings.openAMTConfiguration.enabled
|
|
|
|
}
|
|
|
|
mpsServer={settings.openAMTConfiguration.mpsServer}
|
|
|
|
groups={groupsQuery.data}
|
|
|
|
storageKey="edgeDevices"
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|