import { useState } from 'react'; import { Database, GitCommit, Hash, Server, Tag, Variable, Wrench, } from 'lucide-react'; import clsx from 'clsx'; import { useSystemStatus } from '@/react/portainer/system/useSystemStatus'; import { useSystemVersion } from '@/react/portainer/system/useSystemVersion'; import { useIsEdgeAdmin } from '@/react/hooks/useUser'; import { Modal } from '@@/modals'; import { Button } from '@@/buttons'; import styles from './Footer.module.css'; export function BuildInfoModalButton() { const [isBuildInfoVisible, setIsBuildInfoVisible] = useState(false); const statusQuery = useSystemStatus(); if (!statusQuery.data) { return null; } const { Version } = statusQuery.data; return ( <> {isBuildInfoVisible && ( setIsBuildInfoVisible(false)} /> )} ); } function BuildInfoModal({ closeModal }: { closeModal: () => void }) { const { isAdmin } = useIsEdgeAdmin({ noEnvScope: true }); const versionQuery = useSystemVersion(); const statusQuery = useSystemStatus(); if (!statusQuery.data || !versionQuery.data) { return null; } const { Edition } = statusQuery.data; const { ServerVersion, DatabaseVersion, Build } = versionQuery.data; return (
Server Version: {ServerVersion} Database Version: {DatabaseVersion}
CI Build Number: {Build.BuildNumber} Image Tag: {Build.ImageTag}
Git Commit: {Build.GitCommit}
Compilation tools:
Nodejs v{Build.NodejsVersion} Yarn v{Build.YarnVersion} Webpack v{Build.WebpackVersion} Go v{Build.GoVersion}
{isAdmin && Build.Env && (
Environment Variables
{Build.Env.map((envVar) => (
{envVar}
))}
)}
); }