home.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <pstm-uri>/</pstm-uri>
  5. <pstm-template>main</pstm-template>
  6. <script>
  7. // Live dashboard: the pulse subscription (see the entrypoint)
  8. // re-runs the sealed refresh action whenever task or saddle state
  9. // changes, so progress, blocks and review requests stream in.
  10. if (window.statum) {
  11. (function () {
  12. 'use strict';
  13. statum.addStateListener('pulse', function () {
  14. var dashboard = statum.read('dashboard');
  15. if (dashboard && dashboard.refresh) {
  16. statum.act(dashboard.refresh).catch(function () { });
  17. }
  18. });
  19. })();
  20. }
  21. </script>
  22. </head>
  23. <body>
  24. <section>
  25. <h2>Dashboard</h2>
  26. <p stm-if="dashboard == null">Loading…</p>
  27. <div stm-if="dashboard != null">
  28. <div class="cards">
  29. <section class="card">
  30. <h3>Queue</h3>
  31. <p><strong stm-text="dashboard.ready_count">0</strong> ready to dispatch</p>
  32. <p class="muted"><span stm-text="dashboard.queued_count">0</span> queued ·
  33. <span stm-text="dashboard.active_count">0</span> active ·
  34. <span stm-text="dashboard.blocked_count">0</span> blocked</p>
  35. <p class="muted"><span stm-text="dashboard.done_count">0</span> done ·
  36. <span stm-text="dashboard.failed_count">0</span> failed</p>
  37. </section>
  38. <section class="card">
  39. <h3>Saddles</h3>
  40. <p><strong stm-text="dashboard.idle_saddle_count">0</strong> idle</p>
  41. <p><a href="/saddles">Manage saddles</a> · <a href="/tasks">Task queue</a></p>
  42. </section>
  43. </div>
  44. <h3 stm-if="dashboard.reviews.length > 0">Reviews pending</h3>
  45. <div stm-for-review-in="dashboard.reviews" class="review-banner">
  46. <h3>Review — <a stm-attribute.href="'/tasks/' + review.task_id" stm-text="review.task_title">task</a></h3>
  47. <div class="md" stm-markdown="review.summary">summary</div>
  48. <p><a stm-if="review.diff_url.length > 0" stm-attribute.href="review.diff_url"
  49. target="_blank" rel="noopener">compare changes</a></p>
  50. </div>
  51. <h3 stm-if="dashboard.open_blocks.length > 0">Needs an answer</h3>
  52. <div class="cards" stm-if="dashboard.open_blocks.length > 0">
  53. <section class="card" stm-for-blockview-in="dashboard.open_blocks">
  54. <p><span stm-attribute.class="'badge badge-' + blockview.block_type" stm-text="blockview.block_type">type</span>
  55. <span class="muted" stm-text="blockview.created_display">when</span></p>
  56. <p><strong stm-text="blockview.question">question</strong></p>
  57. <p><a stm-attribute.href="'/tasks/' + blockview.task_id" stm-text="blockview.task_title">task</a></p>
  58. </section>
  59. </div>
  60. <h3 stm-if="dashboard.active_tasks.length > 0">Active tasks</h3>
  61. <table stm-if="dashboard.active_tasks.length > 0">
  62. <thead><tr><th>Task</th><th>Status</th><th>Branch</th><th>Latest progress</th></tr></thead>
  63. <tbody>
  64. <tr stm-for-active-in="dashboard.active_tasks">
  65. <td><a stm-attribute.href="'/tasks/' + active.id" stm-text="active.title">task</a></td>
  66. <td><span stm-attribute.class="'badge badge-' + active.status" stm-text="active.status">status</span></td>
  67. <td stm-text="active.task_branch">branch</td>
  68. <td><strong stm-if="active.latest_progress.length > 0" stm-text="active.latest_progress">progress</strong>
  69. <span class="muted" stm-if="active.latest_progress.length > 0" stm-text="active.progress_display">when</span>
  70. <span class="muted" stm-if="active.latest_progress.length == 0">—</span></td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. <h3>Saddles</h3>
  75. <div class="cards">
  76. <section class="card" stm-for-saddle-in="dashboard.saddles">
  77. <h3 stm-text="saddle.name">name</h3>
  78. <p><span stm-attribute.class="'badge badge-' + saddle.status" stm-text="saddle.status">status</span>
  79. <span class="muted" stm-text="saddle.host">host</span></p>
  80. <p stm-if="saddle.current_task_id > 0">Working on
  81. <a stm-attribute.href="'/tasks/' + saddle.current_task_id" stm-text="saddle.current_task_title">task</a></p>
  82. <p stm-if="saddle.current_task_id == 0" class="muted">No current task</p>
  83. </section>
  84. <section class="card" stm-if="dashboard.saddles.length == 0">
  85. <p class="muted">No saddles registered.</p>
  86. </section>
  87. </div>
  88. <h3>Recent activity</h3>
  89. <table>
  90. <thead><tr><th>When</th><th>Task</th><th>Activity</th></tr></thead>
  91. <tbody>
  92. <tr stm-for-item-in="dashboard.activity">
  93. <td stm-text="item.when_display">when</td>
  94. <td><a stm-attribute.href="'/tasks/' + item.task_id" stm-text="item.task_title">task</a></td>
  95. <td stm-text="item.text">activity</td>
  96. </tr>
  97. <tr stm-if="dashboard.activity.length == 0"><td colspan="3" class="muted">Nothing yet.</td></tr>
  98. </tbody>
  99. </table>
  100. </div>
  101. </section>
  102. </body>
  103. </html>