You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
5.3 KiB

  1. {% load hc_extras %}
  2. <div id="show-usage-modal" class="modal">
  3. <div class="modal-dialog">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <button type="button" class="close" data-dismiss="modal">&times;</button>
  7. <h4 id="usage-examples-title">
  8. {% if check.name %}"{{ check.name }}"{% endif %}
  9. Usage Examples
  10. </h4>
  11. <ul class="nav nav-pills" role="tablist">
  12. <li class="active">
  13. <a href="#crontab" data-toggle="tab">Crontab</a>
  14. </li>
  15. <li>
  16. <a href="#bash" data-toggle="tab">Bash</a>
  17. </li>
  18. <li>
  19. <a href="#python" data-toggle="tab">Python</a>
  20. </li>
  21. <li>
  22. <a href="#ruby" data-toggle="tab">Ruby</a>
  23. </li>
  24. <li class="hidden-xs">
  25. <a href="#node" data-toggle="tab">Node.js</a>
  26. </li>
  27. <li class="hidden-xs">
  28. <a href="#go" data-toggle="tab">Go</a>
  29. </li>
  30. <li class="hidden-xs">
  31. <a href="#php" data-toggle="tab">PHP</a>
  32. </li>
  33. <li class="hidden-xs">
  34. <a href="#cs" data-toggle="tab">C#</a>
  35. </li>
  36. <li class="hidden-xs">
  37. <a href="#browser" data-toggle="tab">Browser</a>
  38. </li>
  39. <li class="hidden-xs">
  40. <a href="#powershell" data-toggle="tab">PowerShell</a>
  41. </li>
  42. <li class="hidden-xs">
  43. <a href="#email" data-toggle="tab">Email</a>
  44. </li>
  45. </ul>
  46. </div>
  47. <div class="modal-body">
  48. <div class="tab-content">
  49. {% with ping_url=check.url %}
  50. <div role="tabpanel" class="tab-pane active" id="crontab">
  51. {% with check|guess_schedule as schedule %}
  52. <div class="highlight">
  53. <pre><span class="c1"># A sample crontab entry. Note the curl call appended after the command.</span>{% if not schedule %}
  54. <span class="c1"># FIXME: replace "* * * * *" below with the correct cron expression!</span>{% endif %}
  55. <span class="c1"># FIXME: replace "/your/command.sh" below with the correct command!</span>
  56. {{ schedule|default:"* * * * *" }} /your/command.sh && curl -fsS -m 10 --retry 5 -o /dev/null {{ ping_url }}</pre>
  57. </div>
  58. <div class="highlight">
  59. <pre><span class="c1"># Here's the part you need to append, provided here separately for easy copy/pasting:</span>
  60. && curl -fsS -m 10 --retry 5 -o /dev/null {{ ping_url }}</pre>
  61. </div>
  62. {% endwith %}
  63. </div>
  64. <div role="tabpanel" class="tab-pane" id="bash">
  65. {% include "front/snippets/bash_curl.html" %}
  66. {% include "front/snippets/bash_wget.html" %}
  67. </div>
  68. <div role="tabpanel" class="tab-pane" id="python">
  69. {% include "front/snippets/python_urllib2.html" %}
  70. {% include "front/snippets/python_requests.html" %}
  71. </div>
  72. <div role="tabpanel" class="tab-pane" id="ruby">
  73. {% include "front/snippets/ruby.html" %}
  74. </div>
  75. <div role="tabpanel" class="tab-pane" id="node">
  76. {% include "front/snippets/node.html" %}
  77. </div>
  78. <div role="tabpanel" class="tab-pane" id="go">
  79. {% include "front/snippets/go.html" %}
  80. </div>
  81. <div role="tabpanel" class="tab-pane" id="php">
  82. {% include "front/snippets/php.html" %}
  83. </div>
  84. <div role="tabpanel" class="tab-pane" id="cs">
  85. {% include "front/snippets/cs.html" %}
  86. </div>
  87. <div class="tab-pane" id="browser">
  88. {% include "front/snippets/browser.html" %}
  89. </div>
  90. <div class="tab-pane" id="powershell">
  91. {% include "front/snippets/powershell.html" %}
  92. {% include "front/snippets/powershell_inline.html" %}
  93. </div>
  94. <div class="tab-pane" id="email">
  95. <p>
  96. As an alternative to HTTP/HTTPS requests,
  97. you can "ping" this check by sending an
  98. email message to
  99. <code class="em">{{ check.email }}</code>
  100. </p>
  101. </div>
  102. {% endwith %}
  103. </div>
  104. </div>
  105. <div class="modal-footer">
  106. <button type="button" class="btn btn-default" data-dismiss="modal">Got It!</button>
  107. </div>
  108. </div>
  109. </div>
  110. </div>