UpgradePage.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React, { useEffect } from 'react';
  2. import { useTheme2 } from '@grafana/ui';
  3. import Page from 'app/core/components/Page/Page';
  4. import { UpgradeBox, UpgradeContent, UpgradeContentProps } from 'app/core/components/Upgrade/UpgradeBox';
  5. import { connector, Props } from './AccessControlDataSourcePermissions';
  6. export const UpgradePage = ({ navModel, loadDataSource, loadDataSourceMeta, resourceId }: Props) => {
  7. useEffect(() => {
  8. loadDataSource(resourceId as any).then(loadDataSourceMeta);
  9. }, [resourceId, loadDataSource, loadDataSourceMeta]);
  10. return (
  11. <Page navModel={navModel}>
  12. <Page.Contents>
  13. <UpgradeBox featureName={'data source permissions'} featureId={'data-source-permissions'} />
  14. <PermissionsUpgradeContent />
  15. </Page.Contents>
  16. </Page>
  17. );
  18. };
  19. export interface PermissionsUpgradeContentProps {
  20. action?: UpgradeContentProps['action'];
  21. }
  22. export const PermissionsUpgradeContent = ({ action }: PermissionsUpgradeContentProps) => {
  23. const theme = useTheme2();
  24. return (
  25. <UpgradeContent
  26. action={action}
  27. featureName={'data source permissions'}
  28. description={
  29. 'With data source permissions, you can protect sensitive data by limiting access to this data source to specific users, teams, and roles.'
  30. }
  31. listItems={[
  32. 'Protect sensitive data, like security logs, production databases, and personally-identifiable information',
  33. 'Clean up users’ experience by hiding data sources they don’t need to use',
  34. 'Share Grafana access more freely, knowing that users will not unwittingly see sensitive data',
  35. ]}
  36. image={`ds-permissions-${theme.isLight ? 'light' : 'dark'}.png`}
  37. featureUrl={'https://grafana.com/docs/grafana/latest/enterprise/datasource_permissions'}
  38. />
  39. );
  40. };
  41. export default connector(UpgradePage);