chats.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <pstm-uri>/chats</pstm-uri>
  5. <pstm-template>main</pstm-template>
  6. </head>
  7. <body>
  8. <section>
  9. <h2>Chats</h2>
  10. <p class="text-muted">Your advisor conversations. Ask the advisor on the
  11. <a href="/">dashboard</a> to start a new one - it can read the fleet's
  12. state, ask you questions and suggest tasks or goals, but never runs
  13. commands itself.</p>
  14. <p class="alert alert-warning" stm-if="chats != null && !chats.advisor_configured">The
  15. advisor is not configured - set the model endpoint on the <a href="/models">Admin
  16. → Model</a> page to enable it. Chats you start now
  17. will wait until then.</p>
  18. <p stm-if="chats == null">Loading…</p>
  19. <div stm-if="chats != null">
  20. <div class="table-wrap">
  21. <table stm-if="chats.chats.length >
  22. 0">
  23. <thead><tr><th>Chat</th><th>Status</th><th>Created</th><th>Updated</th><th></th></tr></thead>
  24. <tbody>
  25. <tr stm-for-chat-in="chats.chats" stm-key="chat.id">
  26. <td><a stm-attribute.href="'/chats/' + chat.id"
  27. stm-text="chat.title">title</a></td>
  28. <td><span stm-attribute.class="'badge badge-chat-' + chat.status"
  29. stm-text="chat.status_display">status</span></td>
  30. <td stm-text="chat.created_display">when</td>
  31. <td stm-text="chat.updated_display">when</td>
  32. <td>
  33. <form class="cluster">
  34. <!-- Goal 41 T9: a destructive action should not
  35. be the row's loudest control - ghost it
  36. (the confirm still guards it). -->
  37. <button type="button" class="btn-ghost btn-sm" stm-action="chat.delete"
  38. stm-confirm="Delete this chat? Its messages and suggestions go with it.">Delete</button>
  39. </form>
  40. </td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. <p stm-if="chats.chats.length == 0" class="text-muted">No chats yet - type a
  46. question into the "Ask the advisor" box at the top of the
  47. <a href="/">dashboard</a> to start one.</p>
  48. </div>
  49. </section>
  50. </body>
  51. </html>