import Logo from '@/assets/images/gpustack-logo.png'; import { GPUStackVersionAtom, UpdateCheckAtom, userAtom } from '@/atoms/user'; import { getAtomStorage } from '@/atoms/utils'; import externalLinks from '@/constants/external-links'; import { Button } from 'antd'; import React from 'react'; import './index.less'; const VersionInfo: React.FC<{ intl: any }> = ({ intl }) => { const latestVersion = getAtomStorage(UpdateCheckAtom).latest_version; const currentVersion = getAtomStorage(GPUStackVersionAtom)?.version; const isProd = currentVersion?.indexOf('rc') === -1 && currentVersion?.indexOf('0.0.0') === -1; const uiVersion = document.documentElement.getAttribute('data-version'); return (
logo
{isProd && ( {intl.formatMessage({ id: 'common.footer.version' })} )} {isProd ? ( {getAtomStorage(GPUStackVersionAtom)?.version || getAtomStorage(GPUStackVersionAtom)?.git_commit} ) : ( {' '} {intl.formatMessage({ id: 'common.footer.version.server' })} {currentVersion.indexOf('0.0.0') > -1 ? getAtomStorage(GPUStackVersionAtom)?.git_commit : getAtomStorage(GPUStackVersionAtom)?.version} UI {uiVersion} )}
{getAtomStorage(userAtom)?.is_admin && isProd && (
{latestVersion && latestVersion !== currentVersion && latestVersion.indexOf('0.0.0') === -1 ? intl.formatMessage( { id: 'users.version.update' }, { version: latestVersion } ) : intl.formatMessage( { id: 'users.version.islatest' }, { version: currentVersion } )}
)}
); }; export const modalConfig = { icon: null, centered: false, maskClosable: true, footer: null, style: { top: '30%' }, width: 400 }; export default VersionInfo;