123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import {Fragment} from 'react';
- import LoadingError from 'sentry/components/loadingError';
- import LoadingIndicator from 'sentry/components/loadingIndicator';
- import {t} from 'sentry/locale';
- import {useApiQuery} from 'sentry/utils/queryClient';
- type Data = {
- extensions: [key: string, value: string][];
- modules: [key: string, value: string][];
- };
- export default function AdminPackages() {
- const {data, isLoading, isError} = useApiQuery<Data>(['/internal/packages/'], {
- staleTime: 0,
- });
- if (isError) {
- return <LoadingError />;
- }
- if (isLoading) {
- return <LoadingIndicator />;
- }
- return (
- <div>
- <h3>{t('Extensions')}</h3>
- {data?.extensions && data?.extensions.length > 0 ? (
- <dl className="vars">
- {data?.extensions.map(([key, value]) => (
- <Fragment key={key}>
- <dt>{key}</dt>
- <dd>
- <pre className="val">{value}</pre>
- </dd>
- </Fragment>
- ))}
- </dl>
- ) : (
- <p>{t('No extensions registered')}</p>
- )}
- <h3>{t('Modules')}</h3>
- {data?.modules && data?.modules.length > 0 ? (
- <dl className="vars">
- {data?.modules.map(([key, value]) => (
- <Fragment key={key}>
- <dt>{key}</dt>
- <dd>
- <pre className="val">{value}</pre>
- </dd>
- </Fragment>
- ))}
- </dl>
- ) : (
- <p>{t('No modules registered')}</p>
- )}
- </div>
- );
- }
|