import { useState } from 'react'; import { useQuery } from 'react-query'; import clsx from 'clsx'; import { Database, Hash, Server, Tag, Tool } from 'react-feather'; import { DialogOverlay } from '@reach/dialog'; import { getStatus, getVersionStatus, } from '@/portainer/services/api/status.service'; import { Button } from '@@/buttons'; import { UpdateNotification } from './UpdateNotifications'; import styles from './Footer.module.css'; import '@reach/dialog/styles.css'; export function Footer() { const [showBuildInfo, setShowBuildInfo] = useState(false); const statusQuery = useStatus(); const versionQuery = useVersionStatus(); if (!statusQuery.data || !versionQuery.data) { return null; } const { Edition, Version } = statusQuery.data; const { ServerVersion, DatabaseVersion, Build } = versionQuery.data; function toggleModal() { setShowBuildInfo(!showBuildInfo); } return ( <>
Portainer {Edition}
Server Version: {ServerVersion} Database Version: {DatabaseVersion}
CI Build Number: {Build.BuildNumber} Image Tag: {Build.ImageTag}
Compilation tools:
Nodejs v{Build.NodejsVersion} Yarn v{Build.YarnVersion} Webpack v{Build.WebpackVersion} Go v{Build.GoVersion}
{process.env.PORTAINER_EDITION === 'CE' && }
© Portainer {Edition} {Version} {process.env.PORTAINER_EDITION === 'CE' && ( Upgrade )}
); } function useStatus() { return useQuery(['status'], () => getStatus()); } function useVersionStatus() { return useQuery(['version'], () => getVersionStatus()); }