config.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # This config has two actions which are applied to all "container" entities
  2. # found in the entity file.
  3. #
  4. # Docs: http://localhost/docs.olivetin.app/docs/entities.html
  5. actions:
  6. - title: Start {{ container.Names }}
  7. icon: box
  8. shell: docker start {{ container.Names }}
  9. entity: container
  10. triggers:
  11. - Update container entity file
  12. - title: Stop {{ container.Names }}
  13. icon: box
  14. shell: docker stop {{ container.Names }}
  15. entity: container
  16. triggers:
  17. - Update container entity file
  18. # This is a hidden action, that is run on startup, and every 5 minutes, and
  19. # when the above start/stop commands are run (see the `triggers` property).
  20. - title: Update container entity file
  21. shell: 'docker ps -a --format json > /etc/OliveTin/entities/containers.json'
  22. hidden: true
  23. execOnStartup: true
  24. execOnCron: '*/5 * * * *'
  25. # Docs: http://docs.olivetin.app/entities.html
  26. entities:
  27. - file: /etc/OliveTin/entities/containers.json
  28. name: container
  29. # The only way to properly use entities, are to use them with a `fieldset` on
  30. # a dashboard.
  31. dashboards:
  32. # This is the second dashboard.
  33. - title: My Containers
  34. contents:
  35. - title: 'Container {{ container.Names }} ({{ container.Image }})'
  36. entity: container
  37. type: fieldset
  38. contents:
  39. - type: display
  40. title: |
  41. {{ container.RunningFor }} <br /><br /><strong>{{ container.State }}</strong>
  42. - title: 'Start {{ container.Names }}'
  43. - title: 'Stop {{ container.Names }}'