landing.tsx 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 NoProjectMessage from 'sentry/components/noProjectMessage';
  7. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  8. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  9. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  10. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  11. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  12. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  13. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  14. import {t} from 'sentry/locale';
  15. import useOrganization from 'sentry/utils/useOrganization';
  16. import {
  17. NumberOfPipelinesChart,
  18. PipelineDurationChart,
  19. TotalTokensUsedChart,
  20. } from 'sentry/views/aiMonitoring/aiMonitoringCharts';
  21. import {AIMonitoringOnboarding} from 'sentry/views/aiMonitoring/onboarding';
  22. import {PipelinesTable} from 'sentry/views/aiMonitoring/PipelinesTable';
  23. import {useOnboardingProject} from 'sentry/views/performance/browser/webVitals/utils/useOnboardingProject';
  24. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  25. function NoAccessComponent() {
  26. return (
  27. <Layout.Page withPadding>
  28. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  29. </Layout.Page>
  30. );
  31. }
  32. export default function AiMonitoringPage() {
  33. const organization = useOrganization();
  34. const onboardingProject = useOnboardingProject();
  35. const isOnboarding = !!onboardingProject;
  36. return (
  37. <PageFiltersContainer>
  38. <SentryDocumentTitle title={`AI Monitoring — ${organization.slug}`}>
  39. <Layout.Page>
  40. <Feature
  41. features="ai-analytics"
  42. organization={organization}
  43. renderDisabled={NoAccessComponent}
  44. >
  45. <NoProjectMessage organization={organization}>
  46. <Layout.Header>
  47. <Layout.HeaderContent>
  48. <Breadcrumbs
  49. crumbs={[
  50. {
  51. label: t('Dashboard'),
  52. },
  53. {
  54. label: t('AI Monitoring'),
  55. },
  56. ]}
  57. />
  58. <Layout.Title>
  59. {t('AI Monitoring')}
  60. <PageHeadingQuestionTooltip
  61. title={t('View analytics and information about your AI pipelines')}
  62. docsUrl="https://docs.sentry.io/product/ai-monitoring/"
  63. />
  64. </Layout.Title>
  65. </Layout.HeaderContent>
  66. </Layout.Header>
  67. <Layout.Body>
  68. <Layout.Main fullWidth>
  69. <ModuleLayout.Layout>
  70. <ModuleLayout.Full>
  71. <PageFilterBar condensed>
  72. <ProjectPageFilter />
  73. <EnvironmentPageFilter />
  74. <DatePageFilter />
  75. </PageFilterBar>
  76. </ModuleLayout.Full>
  77. {isOnboarding ? (
  78. <ModuleLayout.Full>
  79. <AIMonitoringOnboarding />
  80. </ModuleLayout.Full>
  81. ) : (
  82. <Fragment>
  83. <ModuleLayout.Third>
  84. <TotalTokensUsedChart />
  85. </ModuleLayout.Third>
  86. <ModuleLayout.Third>
  87. <NumberOfPipelinesChart />
  88. </ModuleLayout.Third>
  89. <ModuleLayout.Third>
  90. <PipelineDurationChart />
  91. </ModuleLayout.Third>
  92. <ModuleLayout.Full>
  93. <PipelinesTable />
  94. </ModuleLayout.Full>
  95. </Fragment>
  96. )}
  97. </ModuleLayout.Layout>
  98. </Layout.Main>
  99. </Layout.Body>
  100. </NoProjectMessage>
  101. </Feature>
  102. </Layout.Page>
  103. </SentryDocumentTitle>
  104. </PageFiltersContainer>
  105. );
  106. }