home.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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.pinned.length > 0">Needs a human
  45. (<span stm-text="dashboard.pinned.length">0</span> open)</h3>
  46. <p class="muted" stm-if="dashboard.pinned.length > 0">Open questions, RFCs and
  47. reviews across all tasks, newest first — follow the link to answer on the
  48. task page.</p>
  49. <div class="cards" stm-if="dashboard.pinned.length > 0">
  50. <section class="card" stm-for-blockview-in="dashboard.pinned">
  51. <p><span stm-attribute.class="'badge badge-' + blockview.block_type" stm-text="blockview.block_type">type</span>
  52. <span class="muted" stm-text="blockview.created_display">when</span></p>
  53. <p><strong stm-text="blockview.question">question</strong></p>
  54. <p><a stm-attribute.href="'/tasks/' + blockview.task_id" stm-text="blockview.task_title">task</a></p>
  55. </section>
  56. </div>
  57. <p stm-if="dashboard.pinned.length == 0" class="muted">Nothing needs a human —
  58. no open questions, RFCs or reviews.</p>
  59. <!-- "Waiting on subtasks to be enqueued" (plan 11 task D):
  60. every suspended parent whose draft subtasks hold up the
  61. work, linked straight to where Enqueue lives. -->
  62. <h3 stm-if="dashboard.waiting_drafts.length > 0">Waiting on subtasks to be enqueued
  63. (<span stm-text="dashboard.waiting_drafts.length">0</span>)</h3>
  64. <p class="muted" stm-if="dashboard.waiting_drafts.length > 0">These tasks are parked until their
  65. draft subtasks are enqueued — follow a link and press "Enqueue task".</p>
  66. <div class="cards" stm-if="dashboard.waiting_drafts.length > 0">
  67. <section class="card" stm-for-waiting-in="dashboard.waiting_drafts" stm-key="waiting.task_id">
  68. <h3><a stm-attribute.href="'/tasks/' + waiting.task_id" stm-text="waiting.title">task</a></h3>
  69. <p><span class="badge badge-suspended">parked</span>
  70. <span stm-text="waiting.draft_subtasks">0</span>
  71. <span stm-text="waiting.draft_subtasks == 1 ? 'subtask' : 'subtasks'">subtasks</span>
  72. still in draft:</p>
  73. <ul class="waiting-drafts">
  74. <li stm-for-draft-in="waiting.drafts" stm-key="draft.id">
  75. <a stm-attribute.href="'/tasks/' + draft.id" stm-text="draft.title">draft</a>
  76. <span class="badge badge-draft">draft</span>
  77. </li>
  78. </ul>
  79. <p class="muted">Enqueue them from their pages so this task can finish.</p>
  80. </section>
  81. </div>
  82. <h3 stm-if="dashboard.active_tasks.length > 0">Active tasks</h3>
  83. <table stm-if="dashboard.active_tasks.length > 0">
  84. <thead><tr><th>Task</th><th>Status</th><th>Branch</th><th>Latest progress</th></tr></thead>
  85. <tbody>
  86. <tr stm-for-active-in="dashboard.active_tasks">
  87. <td><a stm-attribute.href="'/tasks/' + active.id" stm-text="active.title">task</a></td>
  88. <td><span stm-attribute.class="'badge badge-' + active.status" stm-text="active.status">status</span></td>
  89. <td stm-text="active.task_branch">branch</td>
  90. <td><strong stm-if="active.latest_progress.length > 0" stm-text="active.latest_progress">progress</strong>
  91. <span class="muted" stm-if="active.latest_progress.length > 0" stm-text="active.progress_display">when</span>
  92. <span class="muted" stm-if="active.latest_progress.length == 0">—</span></td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. <h3>Saddles</h3>
  97. <div class="cards">
  98. <section class="card" stm-for-saddle-in="dashboard.saddles">
  99. <h3 stm-text="saddle.name">name</h3>
  100. <p><span stm-attribute.class="'badge badge-' + saddle.status" stm-text="saddle.status">status</span>
  101. <span class="muted" stm-text="saddle.host">host</span></p>
  102. <p stm-if="saddle.current_task_id > 0">Working on
  103. <a stm-attribute.href="'/tasks/' + saddle.current_task_id" stm-text="saddle.current_task_title">task</a></p>
  104. <p stm-if="saddle.current_task_id == 0" class="muted">No current task</p>
  105. </section>
  106. <section class="card" stm-if="dashboard.saddles.length == 0">
  107. <p class="muted">No saddles registered.</p>
  108. </section>
  109. </div>
  110. <h3>Activity</h3>
  111. <p class="muted">The last <span stm-text="dashboard.activity.length">0</span> events
  112. across all tasks, newest first.</p>
  113. <table>
  114. <thead><tr><th>When</th><th>Task</th><th>Event</th></tr></thead>
  115. <tbody>
  116. <tr stm-for-item-in="dashboard.activity">
  117. <td stm-text="item.when_display">when</td>
  118. <td><a stm-attribute.href="'/tasks/' + item.task_id" stm-text="item.task_title">task</a></td>
  119. <td><span stm-attribute.class="'badge badge-' + item.kind" stm-text="item.kind">kind</span>
  120. <span stm-text="item.text">activity</span></td>
  121. </tr>
  122. <tr stm-if="dashboard.activity.length == 0"><td colspan="3" class="muted">Nothing yet.</td></tr>
  123. </tbody>
  124. </table>
  125. </div>
  126. </section>
  127. </body>
  128. </html>