userqueue.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>OwnchatBot</title>
  5. <link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
  6. <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
  7. </head>
  8. <div class="navbar">
  9. <div class="tab">
  10. <button tabindex="0" class="tablinks" data-tab="ocbinfo" onclick="setActiveTabAndNavigate('ocbinfo', '{{ url_for('web_panels.user_panel', instance=instance, username=username) }}')">OwnchatBot Info</button>
  11. <button tabindex="1" class="tablinks" data-tab="rewards" onclick="setActiveTabAndNavigate('rewards', '{{ url_for('web_panels.user_panel', instance=instance, username=username) }}')">Points and Rewards</button>
  12. <button tabindex="2" style="background-color: #003399; color: white;" class="tablinks" data-tab="queue" onclick="window.location.href='{{ url_for('web_panels.user_queue', activeTab='queue') }}'">Rewards Queue</button>
  13. </div>
  14. <img alt="Ownchat Bot logo, whimsical robot" src="/static/img/ownchatbotwide.png">
  15. </div>
  16. <div id="queue" class="queuecontent">
  17. <body>
  18. <i>This page auto-refreshes every 30 seconds.</i>
  19. <h3>Queue</h3>
  20. {% if queue %}
  21. <table>
  22. <thead>
  23. <tr>
  24. <th>Time</th>
  25. <th>Name</th>
  26. <th>Description</th>
  27. <th>User</th>
  28. <th></th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {% for row in queue %}
  33. <tr>
  34. <td>{{ row[1].replace(tzinfo=utc_timezone).astimezone().strftime("%H:%M") }}</td>
  35. {% if row[4] %}
  36. <td><s>{{ prefix }}{{ row[2] }}</s></td>
  37. {% else %}
  38. <td>{{ prefix }}{{ row[2] }}</td>
  39. {% endif %}
  40. <td>{{ all_rewards[row[2]]["info"] }}</td>
  41. {% if row[6] %}
  42. <td>{{ row[6] }}</td>
  43. {% else %}
  44. <td></td>
  45. {% endif %}
  46. </tr>
  47. {% endfor %}
  48. </tbody>
  49. </table>
  50. {% else %}
  51. &nbsp;&nbsp;<span style="color: yellow;">The queue is currently empty</span>
  52. {% endif %}
  53. </body>
  54. <br><br>
  55. </div>
  56. <script>
  57. window.onload = function() {
  58. var activeTab = 'queue';
  59. localStorage.setItem('activeTab', activeTab);
  60. }
  61. function setActiveTabAndNavigate(tabName, url) {
  62. localStorage.setItem('activeTab', tabName);
  63. window.location.href = url;
  64. }
  65. function refreshPage() {
  66. window.location.reload();
  67. }
  68. setTimeout(refreshPage, 30 * 1000);
  69. </script>
  70. </html>