1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import styled from '@emotion/styled';
- import {Breadcrumbs} from 'sentry/components/breadcrumbs';
- import FloatingFeedbackWidget from 'sentry/components/feedback/widget/floatingFeedbackWidget';
- import * as Layout from 'sentry/components/layouts/thirds';
- import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
- import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
- import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
- import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
- import {t} from 'sentry/locale';
- import {space} from 'sentry/styles/space';
- import {RateUnit} from 'sentry/utils/discover/fields';
- import {PageAlert, PageAlertProvider} from 'sentry/utils/performance/contexts/pageAlert';
- import useOrganization from 'sentry/utils/useOrganization';
- import {normalizeUrl} from 'sentry/utils/withDomainRequired';
- import ResourceView, {
- DEFAULT_RESOURCE_TYPES,
- FilterOptionsContainer,
- } from 'sentry/views/performance/browser/resources/resourceView';
- import {
- BrowserStarfishFields,
- useResourceModuleFilters,
- } from 'sentry/views/performance/browser/resources/utils/useResourceFilters';
- import {DEFAULT_RESOURCE_FILTERS} from 'sentry/views/performance/browser/resources/utils/useResourcesQuery';
- import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
- import {DomainSelector} from 'sentry/views/starfish/views/spans/selectors/domainSelector';
- const {SPAN_OP, SPAN_DOMAIN} = BrowserStarfishFields;
- export const RESOURCE_THROUGHPUT_UNIT = RateUnit.PER_MINUTE;
- function ResourcesLandingPage() {
- const organization = useOrganization();
- const filters = useResourceModuleFilters();
- return (
- <ModulePageProviders
- title={[t('Performance'), t('Resources')].join(' — ')}
- baseURL="/performance/browser/resources"
- features="starfish-browser-resource-module-ui"
- >
- <PageAlertProvider>
- <Layout.Header>
- <Layout.HeaderContent>
- <Breadcrumbs
- crumbs={[
- {
- label: 'Performance',
- to: normalizeUrl(`/organizations/${organization.slug}/performance/`),
- preservePageFilters: true,
- },
- {
- label: 'Resources',
- },
- ]}
- />
- <Layout.Title>{t('Resources')}</Layout.Title>
- </Layout.HeaderContent>
- </Layout.Header>
- <Layout.Body>
- <Layout.Main fullWidth>
- <FloatingFeedbackWidget />
- <PageAlert />
- <FilterOptionsContainer columnCount={2}>
- <PageFilterBar condensed>
- <ProjectPageFilter />
- <EnvironmentPageFilter />
- <DatePageFilter />
- </PageFilterBar>
- <DomainSelector
- emptyOptionLocation="top"
- value={filters[SPAN_DOMAIN] || ''}
- additionalQuery={[
- ...DEFAULT_RESOURCE_FILTERS,
- `${SPAN_OP}:[${DEFAULT_RESOURCE_TYPES.join(',')}]`,
- ]}
- />
- </FilterOptionsContainer>
- <ResourceView />
- </Layout.Main>
- </Layout.Body>
- </PageAlertProvider>
- </ModulePageProviders>
- );
- }
- export const PaddedContainer = styled('div')`
- margin-bottom: ${space(2)};
- `;
- export default ResourcesLandingPage;
|