1
0

mgmt.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>OCB Management Panel</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. <script src="/static/mgmtpanel.js"></script>
  9. <div class="navbar">
  10. <div class="tab">
  11. <button class="tablinks" onclick="window.open('{{ url_for('web_panels.mgmtqueue') }}', '_blank')">Rewards Queue Management</button>
  12. <button class="tablinks" data-tab="managerewards" onclick="openTab(event, 'managerewards')">Rewards</button>
  13. <button class="tablinks" data-tab="categories" onclick="openTab(event, 'categories')">Categories</button>
  14. <button class="tablinks" data-tab="accounts" onclick="openTab(event, 'accounts')">Manage Accounts</button>
  15. <button class="tablinks" data-tab="announcements" onclick="openTab(event, 'announcements')">Announcements</button>
  16. <button class="tablinks" data-tab="todolist" onclick="openTab(event, 'todolist')">To-Do List</button>
  17. <button class="tablinks" data-tab="alerts" onclick="openTab(event, 'alerts')">Alerts</button>
  18. <button class="tablinks" data-tab="settings" onclick="openTab(event, 'settings')">Settings</button>
  19. {% if kofi_integration %}
  20. <button class="tablinks" data-tab="kofi-settings" onclick="openTab(event, 'kofi-settings')">Kofi Settings</button>
  21. {% endif %}
  22. </div>
  23. <img src="/static/img/ownchatbotwide.png">
  24. </div>
  25. <div id='managerewards' class="tabcontent">
  26. <h2>Manage Rewards</h3>
  27. <body>
  28. <div>
  29. <h4>Reward Types:</h4>
  30. <ul>
  31. <li><u>Redeems</u> are standard stream point rewards. They get added to the queue for the streamer to fulfill.</li>
  32. <li><u>Specials</u> are redeems, but they run system commands and scripts. This enables you to integrate a lot of other fun things, such as letting your viewers control lighting, activate devices, trigger webhooks, etc. Specials do not go into the queue, because they happen automagically.</li>
  33. <ul>
  34. <li>Be careful with this one. It does require some more advanced scripting/command line knowledge. Make sure you test your specials before letting viewers use them.</li>
  35. </ul>
  36. <li><u>Votes</u> are just that, votes. Your viewers can vote on them.</li>
  37. <li><u>Goals</u> are rewards that everyone in chat can contribute to. The streamer fulfills the reward when the goal is reached.</li>
  38. <li>Add rewards to categories to enable and disable groups of rewards.</li>
  39. <li>Rewards with no categories are inactive.</li>
  40. </ul>
  41. </div>
  42. <table>
  43. <tr>
  44. <td>
  45. </td>
  46. <td>
  47. </td>
  48. <td>
  49. </td>
  50. <td>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td>
  55. <a href="{{ url_for('web_panels.add', reward_type='redeem') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Redeem</button></a><br>
  56. </td>
  57. <td>
  58. <a href="{{ url_for('web_panels.add', reward_type='special') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Special</button></a><br>
  59. </td>
  60. <td>
  61. <a href="{{ url_for('web_panels.add', reward_type='vote') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Vote</button></a><br>
  62. </td>
  63. <td>
  64. <a href="{{ url_for('web_panels.add', reward_type='goal') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Goal</button></a><br>
  65. </td>
  66. </tr>
  67. </table>
  68. <br>
  69. {% if rewards %}
  70. Rewards in <span style="color: red !important;">red</span> are inactive. To activate a reward, add it to an active category.
  71. <table>
  72. <thead>
  73. <tr>
  74. <th style="width:15%">Name</th>
  75. <th>Price</th>
  76. <th>Info</th>
  77. <th>Cool down</th>
  78. <th>Category</th>
  79. <th style="width:15%">Actions</th>
  80. </tr>
  81. </thead>
  82. <tbody>
  83. {% for reward, reward_info in rewards.items() %}
  84. {% if reward in redeems %}
  85. {% if reward in active_rewards %}
  86. <tr>
  87. {% else %}
  88. <tr style="color: red;">
  89. {% endif %}
  90. <td>{{ prefix }}{{ reward }}</td>
  91. <td>{{ reward_info["price"] }}</td>
  92. <td>{{ reward_info["info"] }}</td>
  93. {% if reward_info["cooldown"] > 0 %}
  94. {% set minutes_label = 'minute' if reward_info["cooldown"] == 1 else 'minutes' %}
  95. <td>{{ reward_info["cooldown"] }} {{ minutes_label }}</td>
  96. {% else %}
  97. <td>None</td>
  98. {% endif %}
  99. <td>{{ reward_info["categories"] | join(', ') }}</td>
  100. <td>
  101. <a href="{{ url_for('web_panels.edit', reward_name=reward) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: green;">Edit</span></button></a>&nbsp
  102. <a href="{{ url_for('web_panels.delete', reward_name=reward) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: red;">Delete</span></button></a>
  103. {% endif %}
  104. </tr>
  105. {% endfor %}
  106. </tbody>
  107. </table>
  108. <h3><u>Goals</u></h3>
  109. <table>
  110. <thead>
  111. <tr>
  112. <th style="width:15%">Name</th>
  113. <th>Target</th>
  114. <th>Info</th>
  115. <th>Category</th>
  116. <th style="width:15%">Actions</th>
  117. </tr>
  118. </thead>
  119. <tbody>
  120. {% for reward, reward_info in rewards.items() %}
  121. {% if reward_info["type"] == "goal" %}
  122. {% if reward in active_rewards %}
  123. <tr>
  124. {% else %}
  125. <tr style="color: red;">
  126. {% endif %}
  127. <td>{{ prefix }}{{ reward }}</td>
  128. <td>{{ reward_info["target"] }}</td>
  129. <td>{{ reward_info["info"] }}</td>
  130. <td>{{ reward_info["categories"] | join(', ') }}</td>
  131. <td>
  132. <a href="{{ url_for('web_panels.edit', reward_name=reward) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: green;">Edit</span></button></a>&nbsp
  133. <a href="{{ url_for('web_panels.delete', reward_name=reward) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: red;">Delete</span></button></a>&nbsp
  134. <a href="{{ url_for('web_panels.reset', reward_name=reward, reward_type=reward_info["type"]) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: orange;">Reset</span></button></a>
  135. {% endif %}
  136. </tr>
  137. {% endfor %}
  138. </tbody>
  139. </table>
  140. <h3><u>Votes</u></h3>
  141. <table>
  142. <thead>
  143. <tr>
  144. <th style="width:15%">Name</th>
  145. <th>Price</th>
  146. <th>Info</th>
  147. <th>Category</th>
  148. <th style="width:15%">Actions</th>
  149. </tr>
  150. </thead>
  151. <tbody>
  152. {% for reward, reward_info in rewards.items() %}
  153. {% if reward_info["type"] == "vote" %}
  154. {% if reward in active_rewards %}
  155. <tr>
  156. {% else %}
  157. <tr style="color: red;">
  158. {% endif %}
  159. <td>{{ prefix }}{{ reward }}</td>
  160. <td>{{ reward_info["price"] }}</td>
  161. <td>{{ reward_info["info"] }}</td>
  162. <td>{{ reward_info["categories"] | join(', ') }}</td>
  163. <td>
  164. <a href="{{ url_for('web_panels.edit', reward_name=reward) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: green;">Edit</span></button></a>&nbsp
  165. <a href="{{ url_for('web_panels.delete', reward_name=reward) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: red;">Delete</span></button></a>&nbsp
  166. <a href="{{ url_for('web_panels.reset', reward_name=reward, reward_type=reward_info["type"]) }}"><button class="button button2" onclick="openTab(event, 'managerewards')"><span style="color: orange;">Reset</span></button></a>
  167. {% endif %}
  168. </tr>
  169. {% endfor %}
  170. </tbody>
  171. </table>
  172. {% endif %}
  173. </body>
  174. </div>
  175. <div id='accounts' class="tabcontent">
  176. <body>
  177. <h3>Manage Viewer Accounts</h3>
  178. {% if users %}
  179. To merge an account with a temporary account: Copy the email address from the temporary account, click "edit" next to the account you want to merge, paste the email address into that account, click "save".<br><br>
  180. <table>
  181. <thead>
  182. <tr>
  183. <th>User</th>
  184. <th>Points balance</th>
  185. <th>Email</th>
  186. <th>Authed</th>
  187. <th></th>
  188. </tr>
  189. </thead>
  190. <tbody>
  191. {% for user in users %}
  192. <tr>
  193. {% if not user[1] %}
  194. <td style="color: green;"> Temporary Account </td>
  195. {% else %}
  196. <td> {{ user[1] }} </td>
  197. {% endif %}
  198. {% set points_label = 'point' if user[2] == 1 else 'points' %}
  199. <td>{{ user[2] }} {{ points_label }}</td>
  200. {% if user[4] %}
  201. {% if not user[1] %}
  202. <td style="color: green;">{{ user[4] }}</td>
  203. {% else %}
  204. <td>{{ user[4] }}</td>
  205. {% endif %}
  206. {% else %}
  207. <td>none</td>
  208. {% endif %}
  209. {% if user[3] %}
  210. <td>Yes</td>
  211. {% else %}
  212. <td>No</td>
  213. {% endif %}
  214. <td> <a href="/mgmt/edit_account/{{ user[0] }}?name={{ user[1] }}&points={{ user[2] }}&email={{ user[4] }}"><button class="button button2" onclick="openTab(event, 'panel')">Edit</button></a> </td>
  215. </tr>
  216. {% endfor %}
  217. </tbody>
  218. </table>
  219. {% endif %}
  220. </body>
  221. </div>
  222. <div id='categories' class="tabcontent">
  223. <body>
  224. <h3>Manage Categories</h3>
  225. <div>
  226. &nbsp;&nbsp;<a href="{{ url_for('web_panels.add', reward_type='category') }}"><button class="button button2" onclick="openTab(event, 'categories')">Create a new category</button></a><br>
  227. <table>
  228. <thead>
  229. <tr>
  230. <th style="width: 50%;"><h3>Active Categories</h3></th>
  231. <th style="width: 50%;"><h3>Inactive Categories</h3></th>
  232. </tr>
  233. </thead>
  234. <tbody>
  235. <tr>
  236. <td>
  237. {% for cat in active_categories %}
  238. &nbsp;&nbsp;{{ cat }} - <a href="/mgmt/deactivate/{{ cat }}"><span style="color: green;">Deactivate</span></a>&nbsp;<a href="/mgmt/delcat/{{ cat }}/active"><span style="color: red;">Delete</span></a><br>
  239. {% endfor %}
  240. </td>
  241. <td>
  242. {% for cat in inactive_categories %}
  243. &nbsp;&nbsp;{{ cat }} - <a href="/mgmt/activate/{{ cat }}"><span style="color: green;">Activate</span></a>&nbsp;<a href="/mgmt/delcat/{{ cat }}/inactive"><span style="color: red;">Delete</span></a><br>
  244. {% endfor %}
  245. </td>
  246. </tr>
  247. </tbody>
  248. </table>
  249. </div>
  250. </body>
  251. </div>
  252. <div id='announcements' class="tabcontent">
  253. <body>
  254. <form method="POST" action="/mgmt/announcements">
  255. <table>
  256. <h3>Manage Announcements</h3>
  257. <table>
  258. <thead>
  259. <tr style="border-bottom: none;">
  260. <th style="width: 20%;"></th>
  261. <th style="width: 50%;"></th>
  262. <th></th>
  263. </tr>
  264. </thead>
  265. <tr>
  266. <td> <label for="announce_enable">Enable:</label> </td>
  267. {% if settings_info[9] %}
  268. <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[9] }}" checked> </td>
  269. {% else %}
  270. <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[9] }}"> </td>
  271. {% endif %}
  272. <td>Enable periodic announcements</td>
  273. </tr>
  274. <tr>
  275. <td> <label for="announce_interval">Interval:</label> </td>
  276. <td> <input type="number" name="announce_interval" value="{{ settings_info[10] }}" size="2" required> minutes</td>
  277. <td>How long between each announcement?</td>
  278. </tr>
  279. <tr>
  280. <td> <label for="announcements">Announcements:</label> </td>
  281. <td>
  282. <textarea name="announcements" rows="5" cols="50">{{ announcements | join('\n') }}</textarea>
  283. </td>
  284. <td>Enter your announcements, one per line. May contain html <a href=https://www.w3schools.com/tags/tag_img.asp>IMG tags</a> to display images.</td>
  285. </tr>
  286. </table>
  287. <br><button class="button button2" type="submit">Save Changes</button><br>
  288. </form>
  289. <br><br>
  290. </body>
  291. </div>
  292. <div id='settings' class="tabcontent">
  293. <body style="text-align: left;">
  294. <form method="POST" action="/mgmt/settings">
  295. <table>
  296. <h3>OwnchatBot Settings</h3>
  297. <thead>
  298. <tr style="border-bottom: none;">
  299. <th style="width: 20%;"></th>
  300. <th></th>
  301. <th style="width: 50%;"></th>
  302. </tr>
  303. </thead>
  304. <tr>
  305. <td> <label for="points_interval">Points Interval:</label> </td>
  306. <td> <input type="number" name="points_interval" value="{{ settings_info[1] }}" size="5" required> minutes</td>
  307. <td>How often do you want to award your viewers points?</td>
  308. </tr>
  309. <tr>
  310. <td> <label for="points_award">Points Award:</label> </td>
  311. <td> <input type="number" name="points_award" value="{{ settings_info[2] }}" size="5" required> points</td>
  312. <td>How many points do you want to award them?</td>
  313. </tr>
  314. <tr>
  315. <td> <label for="gunicorn_logging">Gunicorn Logging:</label> </td>
  316. {% if settings_info[3] %}
  317. <td> <input type="checkbox" name="gunicorn_logging" value="{{ settings_info[3] }}" checked> </td>
  318. {% else %}
  319. <td> <input type="checkbox" name="gunicorn_logging" value="{{ settings_info[3] }}"> </td>
  320. {% endif %}
  321. <td>Enable Gunicorn logging integration.</td>
  322. </tr>
  323. <tr>
  324. <td> <label for="prefix">Chat Command Prefix:</label> </td>
  325. <td> <input type="text" name="prefix" maxlength="1" size="1" value="{{ settings_info[4] }}" required> </td>
  326. <td>Character that preceeds chat commands, so OwnchatBot knows what to look for.<br>Example: "{{ settings_info[4] }}points"</td>
  327. </tr>
  328. </table>
  329. <h3>Owncast Integration</h3>
  330. <table>
  331. <thead>
  332. <tr style="border-bottom: none;">
  333. <th style="width: 20%;"></th>
  334. <th></th>
  335. <th style="width: 50%;"></th>
  336. </tr>
  337. </thead>
  338. <tr>
  339. <td> <label for="access_id">Access Token Name:</label> </td>
  340. <td style="padding: 5px;"> <input type="text" name="access_id" value="{{ settings_info[0] }}" size="40"> </td>
  341. <td>Create in Owncast Admin panel. Integrations -> Access Tokens (check all three boxes)</td>
  342. </tr>
  343. <tr>
  344. <td> <label for="access_token">Access Token:</label> </td>
  345. <td style="padding: 5px;"> <input type="password" name="access_token" value="{{ settings_info[5] }}" size="40"> </td>
  346. <td>The token you created above.</td>
  347. </tr>
  348. <tr>
  349. <td> <label for="owncast_url">Your Owncast URL:</label> </td>
  350. <td> <input type="text" name="owncast_url" value="{{ settings_info[6] }}" size="40"> </td>
  351. <td>The external URL of your Owncast instance, with "http://" or "https://".</td>
  352. </tr>
  353. </table>
  354. <h3>Kofi Integration</h3>
  355. <table>
  356. <thead>
  357. <tr style="border-bottom: none;">
  358. <th style="width: 20%;"></th>
  359. <th></th>
  360. <th style="width: 50%;"></th>
  361. </tr>
  362. </thead>
  363. <tr>
  364. <td> <label for="kofi_integration">Enable:</label> </td>
  365. {% if settings_info[8] %}
  366. <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[8] }}" checked> </td>
  367. <td>Enable Ko-fi integration.</td>
  368. {% else %}
  369. <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[8] }}"> </td>
  370. <td>Enable Ko-fi integration. ("Kofi Settings" button will appear in the navigation bar when enabled.)</td>
  371. {% endif %}
  372. </tr>
  373. <tr>
  374. <td> <label for="kofi_token">Verification Token:</label> </td>
  375. <td style="padding: 5px;"> <input type="password" name="kofi_token" value="{{ settings_info[7] }}" size="40"> </td>
  376. <td>Get from Kofi -> More -> API -> Webhooks -> Advanced -> Verification Token.</td>
  377. </tr>
  378. </table>
  379. <br><button class="button button2" type="submit">Save Changes</button><br>
  380. </form>
  381. <br><br>
  382. </body>
  383. </div>
  384. <div id='kofi-settings' class="tabcontent">
  385. <body style="text-align: left;">
  386. <form method="POST" action="/mgmt/ksettings">
  387. <table>
  388. <h3>Kofi Settings</h3>
  389. <h4> Donations </h4>
  390. <thead>
  391. <tr style="border-bottom: none;">
  392. <th style="width: 20%;"></th>
  393. <th></th>
  394. <th style="width: 50%;"></th>
  395. </tr>
  396. </thead>
  397. <tr>
  398. <td> <label for="enable_donations">Enable points for donations:</label> </td>
  399. {% if kofi_settings['donations'] %}
  400. <td> <input type="checkbox" name="enable_donations" value="{{ kofi_settings['donations'] }}" checked> </td>
  401. {% else %}
  402. <td> <input type="checkbox" name="enable_donations" value="{{ kofi_settings['donations'] }}"> </td>
  403. {% endif %}
  404. <td>Enable awarding points for donations</td>
  405. </tr>
  406. <tr>
  407. <td> <label for="set_donation_points">Points per dollar:</label> </td>
  408. <td> <input type="number" name="set_donation_points" value="{{ kofi_settings['donation_points'] }}" size="5" required> points</td>
  409. <td>How many points should viewers recieve, for every dollar they donate?</td>
  410. </tr>
  411. <tr>
  412. <td> <label for="kofi_url">Kofi Page:</label> </td>
  413. <td style="padding: 5px;"> <input type="text" name="kofi_url" value="{{ kofi_settings['kofi_url'] }}" size="30"> </td>
  414. <td>What is your Kofi page URL?</td>
  415. </tr>
  416. <tr>
  417. <table>
  418. <h4> Subscriptions </h4>
  419. <tbody>
  420. <tr>
  421. <td> <label for="enable_subs">Enable points for subscriptions:</label> </td>
  422. {% if kofi_settings['subs'] %}
  423. <td> <input type="checkbox" name="enable_subs" value="{{ kofi_settings['subs'] }}" checked> </td>
  424. {% else %}
  425. <td> <input type="checkbox" name="enable_subs" value="{{ kofi_settings['subs'] }}"> </td>
  426. {% endif %}
  427. <td>Enable awarding points for monthly subscriptions</td>
  428. </tr>
  429. <tr>
  430. <td> <label for="sub_points">Points per month:</label> </td>
  431. <td> <input type="number" name="sub_points" value="{{ kofi_settings['sub_points'] }}" size="6" required> points</td>
  432. <td>How many points should subscribers recieve every month?</td>
  433. </tr>
  434. </tbody>
  435. </table>
  436. </tr>
  437. </table>
  438. <br><button class="button button2" type="submit">Save Changes</button><br>
  439. </form>
  440. <br><br>
  441. </body>
  442. </div>
  443. <div id='todolist' class="tabcontent">
  444. <script>
  445. function focusInput() { // Function to focus on the input field
  446. document.getElementById('itemInput').focus();
  447. }
  448. </script>
  449. <body onload="focusInput()">
  450. <h1>To-Do List</h1>
  451. <form id="todo-item-form" method="POST" onsubmit="focusInput()" action="/mgmt/addtodoitem">
  452. <input type="text" id="itemInput" name="item" placeholder="Add a new item">
  453. <button id="todo-item-form" class="button button2" type="submit">Add</button>
  454. </form>
  455. <ul>
  456. {% if items %}
  457. {% for item in items %}
  458. {% if item.crossed == 'no' %}
  459. <li style="text-decoration:none;">
  460. {{ item.name }}
  461. <a href="{{ url_for('web_panels.cross', item_id=loop.index0) }}">[Cross Off]</a>&nbsp;<span style="color: red;"><a href="{{ url_for('web_panels.rem_todo_item', item_id=loop.index0) }}">[Remove]</a></span>
  462. </li>
  463. {% else %}
  464. <li> <span style="text-decoration:line-through;">
  465. {{ item.name }}</span>
  466. <a href="{{ url_for('web_panels.uncross', item_id=loop.index0) }}">[Un-Cross]</a>&nbsp;<span style="color: red;"><a href="{{ url_for('web_panels.rem_todo_item', item_id=loop.index0) }}">[Remove]</a></span>
  467. </li>
  468. {% endif %}
  469. {% endfor %}
  470. {% endif %}
  471. </ul>
  472. <form action="/mgmt/clearlist" method="get" style="display: inline;">
  473. <button class="button button2" type="submit" class="button">Clear List</button>
  474. </form>
  475. <br><br>
  476. </div>
  477. <div id='alerts' class="tabcontent">
  478. <body>
  479. <h2>Customize Your Alerts</h2>
  480. <table>
  481. <thead>
  482. <tr style="border-bottom: none;">
  483. <th style="width: 20%;">Type</th>
  484. <th style="width: 20%;">Image</th>
  485. <th></th>
  486. <th style="width: 15%;"></th>
  487. <th style="width: 25%;">Browser Source</th>
  488. </tr>
  489. </thead>
  490. <tr>
  491. <form id="nf_upload" action="/mgmt/alertupload/FOLLOWER_ALERT" method="post" enctype="multipart/form-data">
  492. <td>New Follower:</td>
  493. {% set follower_alert = alerts_dict["FOLLOWER_ALERT"] %}
  494. {% if follower_alert %}
  495. {% if "webm" in follower_alert %}
  496. <td><video height="100" autoplay loop><source src="{{ url_for('web_panels.assets', asset_name=follower_alert) }}" type="video/webm"></video></td>
  497. {% else %}
  498. <td><img src="{{ url_for('web_panels.assets', asset_name=follower_alert) }}"></td>
  499. {% endif %}
  500. {% else %}
  501. <td>Empty</td>
  502. {% endif %}
  503. <td><input type="file" name="FOLLOWER_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
  504. <td><button id="nf_upload" class="button button2" type="submit">Upload</button>
  505. </form>&nbsp
  506. <a href="{{ url_for('web_panels.del_alert', alert_type='FOLLOWER_ALERT') }}"><button class="button button2" onclick="openTab(event, 'alerts')"><span style="color: red;">Clear</span></button></a></td>
  507. <td>/alert/follower</td>
  508. </tr>
  509. <tr>
  510. <form id="nms_upload" action="/mgmt/alertupload/MILESTONE_ALERT" method="post" enctype="multipart/form-data">
  511. <td>Milestone Reached:</td>
  512. {% set milestone_alert = alerts_dict["MILESTONE_ALERT"] %}
  513. {% if milestone_alert %}
  514. {% if "webm" in milestone_alert %}
  515. <td><video height="100" autoplay loop><source src="{{ url_for('web_panels.assets', asset_name=milestone_alert) }}" type="video/webm"></video></td>
  516. {% else %}
  517. <td><img src="{{ url_for('web_panels.assets', asset_name=milestone_alert) }}"></td>
  518. {% endif %}
  519. {% else %}
  520. <td>Empty</td>
  521. {% endif %}
  522. <td><input type="file" name="MILESTONE_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
  523. <td><button id="nms_upload" class="button button2" type="submit">Upload</button></form>&nbsp
  524. <a href="{{ url_for('web_panels.del_alert', alert_type='MILESTONE_ALERT') }}"><button class="button button2" onclick="openTab(event, 'alerts')"><span style="color: red;">Clear</span></button></a></td>
  525. <td>/alert/milestone</td>
  526. </tr>
  527. <tr>
  528. <form id="ng_upload" action="/mgmt/alertupload/GOAL_ALERT" method="post" enctype="multipart/form-data">
  529. <td>Goal Reached:</td>
  530. {% set goal_alert = alerts_dict["GOAL_ALERT"] %}
  531. {% if goal_alert %}
  532. {% if "webm" in goal_alert %}
  533. <td><video height="100" autoplay loop><source src="{{ url_for('web_panels.assets', asset_name=goal_alert) }}" type="video/webm"></video></td>
  534. {% else %}
  535. <td><img src="{{ url_for('web_panels.assets', asset_name=goal_alert) }}"></td>
  536. {% endif %}
  537. {% else %}
  538. <td>Empty</td>
  539. {% endif %}
  540. <td><input type="file" name="GOAL_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
  541. <td><button id="ng_upload" class="button button2" type="submit">Upload</button></form>&nbsp
  542. <a href="{{ url_for('web_panels.del_alert', alert_type='GOAL_ALERT') }}"><button class="button button2" onclick="openTab(event, 'alerts')"><span style="color: red;">Clear</span></button></a></td>
  543. <td>/alert/goal</td>
  544. </tr>
  545. </table>
  546. </body>
  547. </div>
  548. <br><br>
  549. </html>