index.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import {Fragment} from 'react';
  2. import Feature from 'sentry/components/acl/feature';
  3. import {Alert} from 'sentry/components/alert';
  4. import {Breadcrumbs} from 'sentry/components/breadcrumbs';
  5. import * as Layout from 'sentry/components/layouts/thirds';
  6. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  7. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  8. import {t} from 'sentry/locale';
  9. import useOrganization from 'sentry/utils/useOrganization';
  10. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  11. import {Content} from './content';
  12. function TraceExplorerLandingPage() {
  13. const organization = useOrganization();
  14. return (
  15. <Fragment>
  16. <Layout.Header>
  17. <Layout.HeaderContent>
  18. <Breadcrumbs
  19. crumbs={[
  20. {
  21. label: 'Performance',
  22. to: normalizeUrl(`/organizations/${organization.slug}/performance/`),
  23. preservePageFilters: true,
  24. },
  25. {
  26. label: 'Traces',
  27. },
  28. ]}
  29. />
  30. <Layout.Title>{t('Traces')}</Layout.Title>
  31. </Layout.HeaderContent>
  32. </Layout.Header>
  33. <Layout.Body>
  34. <Content />
  35. </Layout.Body>
  36. </Fragment>
  37. );
  38. }
  39. function NoAccess() {
  40. return (
  41. <Layout.Page withPadding>
  42. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  43. </Layout.Page>
  44. );
  45. }
  46. const DEFAULT_STATS_PERIOD = '24h';
  47. export default function TracesPage() {
  48. const organization = useOrganization();
  49. return (
  50. <SentryDocumentTitle title={t('Traces')} orgSlug={organization.slug}>
  51. <PageFiltersContainer
  52. defaultSelection={{
  53. datetime: {start: null, end: null, utc: null, period: DEFAULT_STATS_PERIOD},
  54. }}
  55. >
  56. <Layout.Page>
  57. <Feature
  58. features={['performance-trace-explorer']}
  59. organization={organization}
  60. renderDisabled={NoAccess}
  61. >
  62. <TraceExplorerLandingPage />
  63. </Feature>
  64. </Layout.Page>
  65. </PageFiltersContainer>
  66. </SentryDocumentTitle>
  67. );
  68. }