ApiKeysAddedModal.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react';
  2. export interface Props {
  3. apiKey: string;
  4. rootPath: string;
  5. }
  6. export const ApiKeysAddedModal = (props: Props) => {
  7. return (
  8. <div className="modal-body">
  9. <div className="modal-header">
  10. <h2 className="modal-header-title">
  11. <i className="fa fa-key" />
  12. <span className="p-l-1">API Key Created</span>
  13. </h2>
  14. <a className="modal-header-close" ng-click="dismiss();">
  15. <i className="fa fa-remove" />
  16. </a>
  17. </div>
  18. <div className="modal-content">
  19. <div className="gf-form-group">
  20. <div className="gf-form">
  21. <span className="gf-form-label">Key</span>
  22. <span className="gf-form-label">{props.apiKey}</span>
  23. </div>
  24. </div>
  25. <div className="grafana-info-box" style={{ border: 0 }}>
  26. You will only be able to view this key here once! It is not stored in this form. So be sure to copy it now.
  27. <br />
  28. <br />
  29. You can authenticate request using the Authorization HTTP header, example:
  30. <br />
  31. <br />
  32. <pre className="small">
  33. curl -H "Authorization: Bearer {props.apiKey}" {props.rootPath}/api/dashboards/home
  34. </pre>
  35. </div>
  36. </div>
  37. </div>
  38. );
  39. };
  40. export default ApiKeysAddedModal;