adminLayout.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import type {RouteComponentProps} from 'react-router';
  2. import styled from '@emotion/styled';
  3. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  4. import {t} from 'sentry/locale';
  5. import {BreadcrumbProvider} from 'sentry/views/settings/components/settingsBreadcrumb/context';
  6. import SettingsLayout from 'sentry/views/settings/components/settingsLayout';
  7. import SettingsNavigation from 'sentry/views/settings/components/settingsNavigation';
  8. const renderAdminNavigation = () => (
  9. <SettingsNavigation
  10. stickyTop="0"
  11. navigationObjects={[
  12. {
  13. name: 'System Status',
  14. items: [
  15. {path: '/manage/', index: true, title: 'Overview'},
  16. {path: '/manage/buffer/', title: 'Buffer'},
  17. {path: '/manage/queue/', title: 'Queue'},
  18. {path: '/manage/quotas/', title: 'Quotas'},
  19. {path: '/manage/status/environment/', title: 'Environment'},
  20. {path: '/manage/status/packages/', title: 'Packages'},
  21. {path: '/manage/status/mail/', title: 'Mail'},
  22. {path: '/manage/status/warnings/', title: 'Warnings'},
  23. {path: '/manage/settings/', title: 'Settings'},
  24. ],
  25. },
  26. {
  27. name: 'Manage',
  28. items: [
  29. {path: '/manage/organizations/', title: 'Organizations'},
  30. {path: '/manage/projects/', title: 'Projects'},
  31. {path: '/manage/users/', title: 'Users'},
  32. ],
  33. },
  34. ]}
  35. />
  36. );
  37. type Props = {
  38. children: React.ReactNode;
  39. } & RouteComponentProps<{}, {}>;
  40. function AdminLayout({children, ...props}: Props) {
  41. return (
  42. <SentryDocumentTitle noSuffix title={t('Sentry Admin')}>
  43. <Page>
  44. <BreadcrumbProvider>
  45. <SettingsLayout renderNavigation={renderAdminNavigation} {...props}>
  46. {children}
  47. </SettingsLayout>
  48. </BreadcrumbProvider>
  49. </Page>
  50. </SentryDocumentTitle>
  51. );
  52. }
  53. export default AdminLayout;
  54. const Page = styled('div')`
  55. display: flex;
  56. flex-grow: 1;
  57. `;