import {Fragment} from 'react'; import styled from '@emotion/styled'; import moment from 'moment'; import Button from 'app/components/button'; import {IconQuestion} from 'app/icons'; import {t, tct} from 'app/locale'; import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; import AsyncView from 'app/views/asyncView'; type Data = { environment: { config: string; start_date: string; }; config: [key: string, value: string][]; pythonVersion: string; }; type State = AsyncView['state'] & {data: Data}; export default class AdminEnvironment extends AsyncView<{}, State> { getEndpoints(): ReturnType { return [['data', '/internal/environment/']]; } renderBody() { const {data} = this.state; const {environment, config, pythonVersion} = data; const {version} = ConfigStore.getConfig(); return (

{t('Environment')}

{environment ? (
{t('Server Version')} {version.upgradeAvailable && (
) : (

{t('Environment not found (are you using the builtin Sentry webserver?).')}

)}

{tct('Configuration [configPath]', { configPath: environment.config && {environment.config}, })}

{config.map(([key, value]) => (
{key}
{value}
))}
); } } const VersionLabel = styled('dt')` display: inline-grid; grid-auto-flow: column; grid-gap: ${space(1)}; align-items: center; `;