index.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import {useEffect} from 'react';
  2. import ApiForm from 'sentry/components/forms/apiForm';
  3. import FieldWrapper from 'sentry/components/forms/fieldGroup/fieldWrapper';
  4. import RadioField from 'sentry/components/forms/fields/radioField';
  5. import ExternalLink from 'sentry/components/links/externalLink';
  6. import NarrowLayout from 'sentry/components/narrowLayout';
  7. import {t, tct} from 'sentry/locale';
  8. type Props = {
  9. onSubmitSuccess?: () => void;
  10. };
  11. function BeaconConsent({onSubmitSuccess}: Props) {
  12. useEffect(() => {
  13. document.body.classList.add('auth');
  14. return () => document.body.classList.remove('auth');
  15. }, []);
  16. return (
  17. <NarrowLayout>
  18. <ApiForm
  19. apiMethod="PUT"
  20. apiEndpoint="/internal/options/"
  21. onSubmitSuccess={onSubmitSuccess}
  22. submitLabel={t('Continue')}
  23. >
  24. <FieldWrapper stacked={false} hasControlState={false}>
  25. {t(
  26. 'We have made some updates to our self-hosted beacon broadcast system, and just need to get a quick answer from you.'
  27. )}
  28. </FieldWrapper>
  29. <RadioField
  30. name="beacon.record_cpu_ram_usage"
  31. defaultValue={() => 'true'}
  32. choices={[
  33. [
  34. 'true',
  35. t(
  36. 'Yes, I would love to help Sentry developers improve the experience of self-hosted by sending CPU/RAM usage'
  37. ),
  38. ],
  39. ['false', t("No, I'd prefer to keep CPU/RAM usage private")],
  40. ]}
  41. label={t('CPU/RAM Usage')}
  42. required
  43. help={tct(
  44. `Recording CPU/RAM usage will greatly help our development team understand how self-hosted sentry
  45. is typically being used, and to keep track of improvements that we hope to bring you in the future.`,
  46. {link: <ExternalLink href="https://sentry.io/privacy/" />}
  47. )}
  48. inline={false}
  49. />
  50. </ApiForm>
  51. </NarrowLayout>
  52. );
  53. }
  54. export default BeaconConsent;