mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
20 lines
568 B
TypeScript
20 lines
568 B
TypeScript
import { useSettings } from '@/react/portainer/settings/queries';
|
|
import { useSystemStatus } from '@/react/portainer/system/useSystemStatus';
|
|
|
|
export function useAgentDetails() {
|
|
const settingsQuery = useSettings();
|
|
|
|
const versionQuery = useSystemStatus({ select: (status) => status.Version });
|
|
|
|
if (!versionQuery.isSuccess || !settingsQuery.isSuccess) {
|
|
return null;
|
|
}
|
|
|
|
const agentVersion = versionQuery.data;
|
|
|
|
return {
|
|
agentVersion,
|
|
agentSecret: settingsQuery.data.AgentSecret,
|
|
useEdgeAsyncMode: settingsQuery.data.Edge.AsyncMode,
|
|
};
|
|
}
|