4
0

4-displays.adoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. [#displays]
  2. = Displays
  3. Displays are a way of displaying text, values, variables and similar on a dashboard.
  4. They are rendered as just a simple box, that shown alongside actions. You can add arbitary HTML to a display, which makes it useful for showing links, etc.
  5. image::dashboard-display.png[]
  6. [source,yaml]
  7. .`config.yaml`
  8. ----
  9. dashboards:
  10. # This the second dashboard.
  11. - title: My Containers
  12. contents:
  13. # This is a fieldset, which is a way of dashboard items together actions together.
  14. - title: Container {{ container.Names }}
  15. entity: container
  16. type: fieldset
  17. contents:
  18. # This is a display
  19. - type: display
  20. title: |
  21. {{ container.Names }} <br /><br /><strong>{{ container.State }}</strong>
  22. # These are the actions that we want on the dashboard.
  23. - title: 'Start {{ container.Names }}'
  24. - title: 'Stop {{ container.Names }}'
  25. ----
  26. == CSS Classes
  27. You can also add CSS classes to the display, which can be useful for styling.
  28. [source,yaml]
  29. ----
  30. dashboards:
  31. - title: My Containers
  32. contents:
  33. - title: 'Container {{ container.Names.0 }} ({{ container.Image }})'
  34. entity: container
  35. type: fieldset
  36. contents:
  37. - type: display
  38. cssClass: '{{ container.State }}'
  39. title: |
  40. {{ container.Status }} <br /><br /><strong>{{ container.State }}</strong>
  41. - title: 'Start {{ container.Names.0 }}'
  42. - title: 'Stop {{ container.Names.0 }}'
  43. - title: 'Remove {{ container.Names.0 }}'
  44. ----
  45. You can then use the following CSS to style the display;
  46. [source,css]
  47. ----
  48. div.display.running {
  49. color: green;
  50. }
  51. ----