LoggingCheatSheet.tsx 916 B

1234567891011121314151617181920212223242526272829
  1. import React from 'react';
  2. const CHEAT_SHEET_ITEMS = [
  3. {
  4. title: 'Logs From a Job',
  5. expression: '{job="default/prometheus"}',
  6. label: 'Returns all log lines emitted by instances of this job.',
  7. },
  8. {
  9. title: 'Search For Text',
  10. expression: '{app="cassandra"} Maximum memory usage',
  11. label: 'Returns all log lines for the selector and highlights the given text in the results.',
  12. },
  13. ];
  14. export default (props: any) => (
  15. <div>
  16. <h1>Logging Cheat Sheet</h1>
  17. {CHEAT_SHEET_ITEMS.map(item => (
  18. <div className="cheat-sheet-item" key={item.expression}>
  19. <div className="cheat-sheet-item__title">{item.title}</div>
  20. <div className="cheat-sheet-item__expression" onClick={e => props.onClickQuery(item.expression)}>
  21. <code>{item.expression}</code>
  22. </div>
  23. <div className="cheat-sheet-item__label">{item.label}</div>
  24. </div>
  25. ))}
  26. </div>
  27. );