|
|
@@ -1,429 +0,0 @@
|
|
|
-<!DOCTYPE html>
|
|
|
-<html lang="en">
|
|
|
-<head>
|
|
|
- <title>OCB Management Panel</title>
|
|
|
- <link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
|
|
|
- <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
|
-</head>
|
|
|
- <script src="/static/mgmtpanel.js"></script>
|
|
|
-
|
|
|
- <div class="navbar">
|
|
|
- <div class="tab">
|
|
|
- <button class="tablinks" onclick="window.open('{{ url_for('web_panels.mgmtqueue') }}', '_blank')">Rewards Queue Management</button>
|
|
|
- <button class="tablinks" data-tab="managerewards" onclick="openTab(event, 'managerewards')">Rewards</button>
|
|
|
- <button class="tablinks" data-tab="categories" onclick="openTab(event, 'categories')">Categories</button>
|
|
|
- <button class="tablinks" data-tab="accounts" onclick="openTab(event, 'accounts')">Manage Accounts</button>
|
|
|
- <button class="tablinks" data-tab="announcements" onclick="openTab(event, 'announcements')">Announcements</button>
|
|
|
- <button class="tablinks" data-tab="settings" onclick="openTab(event, 'settings')">Settings</button>
|
|
|
- {% if kofi_integration %}
|
|
|
- <button class="tablinks" data-tab="kofi-settings" onclick="openTab(event, 'kofi-settings')">Kofi Settings</button>
|
|
|
- {% endif %}
|
|
|
- </div>
|
|
|
- <img src="/static/img/ownchatbotwide.png">
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id='managerewards' class="tabcontent">
|
|
|
- <h3>Manage Rewards</h3>
|
|
|
- <body>
|
|
|
- <div>
|
|
|
- <h4>Reward Types:</h4>
|
|
|
- <ul>
|
|
|
-
|
|
|
- <li><u>Redeems</u> are standard stream point redeems. They get added to the queue for the streamer to fulfill.</li>
|
|
|
- <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>
|
|
|
- <ul>
|
|
|
- <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>
|
|
|
- </ul>
|
|
|
- <li><u>Votes</u> are just that, votes. Your viewers can vote on them.</li>
|
|
|
- <li><u>Goals</u> are rewards that everyone in chat can contribute to. The streamer fulfills the reward when the goal is reached.</li>
|
|
|
- <li>Add rewards to categories to enable and disable groups of rewards.</li>
|
|
|
- <li>Rewards with no categories are inactive.</li>
|
|
|
- </ul>
|
|
|
-
|
|
|
- </div>
|
|
|
- <table>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <a href="{{ url_for('web_panels.add', reward_type='redeem') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Redeem</button></a><br>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a href="{{ url_for('web_panels.add', reward_type='special') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Special</button></a><br>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a href="{{ url_for('web_panels.add', reward_type='vote') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Vote</button></a><br>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a href="{{ url_for('web_panels.add', reward_type='goal') }}"><button class="button button2" onclick="openTab(event, 'managerewards')">Create a Goal</button></a><br>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- <br>
|
|
|
- {% if rewards %}
|
|
|
- Rewards in <span style="color: red !important;">red</span> are inactive. To activate a reward, add it to an active category.
|
|
|
- <table>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th style="width:15%">Name</th>
|
|
|
- <th>Target</th>
|
|
|
- <th>Price</th>
|
|
|
- <th>Info</th>
|
|
|
- <th>Cool down</th>
|
|
|
- <th>Category</th>
|
|
|
- <th style="width:15%">Actions</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- {% for reward, reward_info in rewards.items() %}
|
|
|
- {% if reward in active_rewards %}
|
|
|
- <tr>
|
|
|
- {% else %}
|
|
|
- <tr style="color: red;">
|
|
|
- {% endif %}
|
|
|
- <td>{{ prefix }}{{ reward }}</td>
|
|
|
- {% if reward_info["type"] == "goal" %}
|
|
|
- <td>{{ reward_info["target"] }}</td>
|
|
|
- {% else %}
|
|
|
- <td>N/A</td>
|
|
|
- {% endif %}
|
|
|
- {% if reward_info["type"] == "goal" %}
|
|
|
- <td>N/A</td>
|
|
|
- {% else %}
|
|
|
- <td>{{ reward_info["price"] }}</td>
|
|
|
- {% endif %}
|
|
|
- <td>{{ reward_info["info"] }}</td>
|
|
|
- {% if reward_info["cooldown"] > 0 %}
|
|
|
- {% set minutes_label = 'minute' if reward_info["cooldown"] == 1 else 'minutes' %}
|
|
|
- <td>{{ reward_info["cooldown"] }} {{ minutes_label }}</td>
|
|
|
- {% else %}
|
|
|
- <td>None</td>
|
|
|
- {% endif %}
|
|
|
- <td>{{ reward_info["categories"] | join(', ') }}</td>
|
|
|
- <td>
|
|
|
- <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> 
|
|
|
- <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> 
|
|
|
- {% if reward_info["type"] == "goal" or reward_info["type"] == "vote" %}
|
|
|
- <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>
|
|
|
- {% endif %}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- {% endfor %}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- {% endif %}
|
|
|
- </body>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id='accounts' class="tabcontent">
|
|
|
-
|
|
|
- <body>
|
|
|
- <h3>Manage Viewer Accounts</h3>
|
|
|
- {% if users %}
|
|
|
- <table>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>User</th>
|
|
|
- <th>Points balance</th>
|
|
|
- <th>Email</th>
|
|
|
- <th>Authed</th>
|
|
|
- <th></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- {% for user in users %}
|
|
|
- <tr>
|
|
|
- <td> {{ user[1] }} </td>
|
|
|
- {% set points_label = 'point' if user[2] == 1 else 'points' %}
|
|
|
-
|
|
|
- <td>{{ user[2] }} {{ points_label }}</td>
|
|
|
- {% if user[4] %}
|
|
|
- <td>{{ user[4] }}</td>
|
|
|
- {% else %}
|
|
|
- <td>none</td>
|
|
|
- {% endif %}
|
|
|
- {% if user[3] %}
|
|
|
- <td>Yes</td>
|
|
|
- {% else %}
|
|
|
- <td>No</td>
|
|
|
- {% endif %}
|
|
|
- <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>
|
|
|
- </tr>
|
|
|
- {% endfor %}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- {% endif %}
|
|
|
- </body>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id='categories' class="tabcontent">
|
|
|
- <body>
|
|
|
- <h3>Manage Categories</h3>
|
|
|
- <div>
|
|
|
- <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>
|
|
|
- <table>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th style="width: 50%;"><h3>Active Categories</h3></th>
|
|
|
- <th style="width: 50%;"><h3>Inactive Categories</h3></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- {% for cat in active_categories %}
|
|
|
- {{ cat }} - <a href="/mgmt/deactivate/{{ cat }}"><span style="color: green;">Deactivate</span></a> <a href="/mgmt/delcat/{{ cat }}/active"><span style="color: red;">Delete</span></a><br>
|
|
|
- {% endfor %}
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- {% for cat in inactive_categories %}
|
|
|
- {{ cat }} - <a href="/mgmt/activate/{{ cat }}"><span style="color: green;">Activate</span></a> <a href="/mgmt/delcat/{{ cat }}/inactive"><span style="color: red;">Delete</span></a><br>
|
|
|
- {% endfor %}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- </body>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id='announcements' class="tabcontent">
|
|
|
- <body>
|
|
|
- <form method="POST" action="/mgmt/announcements">
|
|
|
- <table>
|
|
|
- <h3>Manage Announcements</h3>
|
|
|
- <table>
|
|
|
- <thead>
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- <th style="width: 20%;"></th>
|
|
|
- <th style="width: 50%;"></th>
|
|
|
- <th></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tr>
|
|
|
- <td> <label for="announce_enable">Enable:</label> </td>
|
|
|
- {% if settings_info[9] %}
|
|
|
- <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[9] }}" checked> </td>
|
|
|
- {% else %}
|
|
|
- <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[9] }}"> </td>
|
|
|
- {% endif %}
|
|
|
- <td>Enable periodic announcements</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="announce_interval">Interval:</label> </td>
|
|
|
- <td> <input type="number" name="announce_interval" value="{{ settings_info[10] }}" size="2" required> minutes</td>
|
|
|
- <td>How long between each announcement?</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="announcements">Announcements:</label> </td>
|
|
|
- <td>
|
|
|
- <textarea name="announcements" rows="5" cols="50">{{ announcements | join('\n') }}</textarea>
|
|
|
- </td>
|
|
|
- <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>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- <br><button class="button button2" type="submit">Save Changes</button><br>
|
|
|
- </form>
|
|
|
- <br><br>
|
|
|
- </body>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id='settings' class="tabcontent">
|
|
|
- <body style="text-align: left;">
|
|
|
- <form method="POST" action="/mgmt/settings">
|
|
|
- <table>
|
|
|
- <h3>OwnchatBot Settings</h3>
|
|
|
- <thead>
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- <th style="width: 20%;"></th>
|
|
|
- <th></th>
|
|
|
- <th style="width: 50%;"></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tr>
|
|
|
- <td> <label for="points_interval">Points Interval:</label> </td>
|
|
|
- <td> <input type="number" name="points_interval" value="{{ settings_info[1] }}" size="5" required> minutes</td>
|
|
|
- <td>How often do you want to award your viewers points?</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="points_award">Points Award:</label> </td>
|
|
|
- <td> <input type="number" name="points_award" value="{{ settings_info[2] }}" size="5" required> points</td>
|
|
|
- <td>How many points do you want to award them?</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="follow_points">Follow Points:</label> </td>
|
|
|
- <td> <input type="number" name="follow_points" value="{{ settings_info[11] }}" size="5" required> points</td>
|
|
|
- <td>How many points do you want to award viewers for following your stream?</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="gunicorn_logging">Gunicorn Logging:</label> </td>
|
|
|
- {% if settings_info[3] %}
|
|
|
- <td> <input type="checkbox" name="gunicorn_logging" value="{{ settings_info[3] }}" checked> </td>
|
|
|
- {% else %}
|
|
|
- <td> <input type="checkbox" name="gunicorn_logging" value="{{ settings_info[3] }}"> </td>
|
|
|
- {% endif %}
|
|
|
- <td>Enable Gunicorn logging integration.</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="prefix">Chat Command Prefix:</label> </td>
|
|
|
- <td> <input type="text" name="prefix" maxlength="1" size="1" value="{{ settings_info[4] }}" required> </td>
|
|
|
- <td>Character that preceeds chat commands, so OwnchatBot knows what to look for.<br>Example: "{{ settings_info[4] }}points"</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <h3>Owncast Integration</h3>
|
|
|
- <table>
|
|
|
- <thead>
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- <th style="width: 20%;"></th>
|
|
|
- <th></th>
|
|
|
- <th style="width: 50%;"></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tr>
|
|
|
- <td> <label for="access_id">Access Token Name:</label> </td>
|
|
|
- <td style="padding: 5px;"> <input type="text" name="access_id" value="{{ settings_info[0] }}" size="40"> </td>
|
|
|
- <td>Create in Owncast Admin panel. Integrations -> Access Tokens (check all three boxes)</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="access_token">Access Token:</label> </td>
|
|
|
- <td style="padding: 5px;"> <input type="text" name="access_token" value="{{ settings_info[5] }}" size="40"> </td>
|
|
|
- <td>The token you created above.</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="owncast_url">Your Owncast URL:</label> </td>
|
|
|
- <td> <input type="text" name="owncast_url" value="{{ settings_info[6] }}" size="40"> </td>
|
|
|
- <td>The external URL of your Owncast instance, with "http://" or "https://".</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <h3>Kofi Integration</h3>
|
|
|
- <table>
|
|
|
- <thead>
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- <th style="width: 20%;"></th>
|
|
|
- <th></th>
|
|
|
- <th style="width: 50%;"></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tr>
|
|
|
- <td> <label for="kofi_integration">Enable:</label> </td>
|
|
|
- {% if settings_info[8] %}
|
|
|
- <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[8] }}" checked> </td>
|
|
|
- <td>Enable Ko-fi integration.</td>
|
|
|
- {% else %}
|
|
|
- <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[8] }}"> </td>
|
|
|
- <td>Enable Ko-fi integration. ("Kofi Settings" button will appear in the navigation bar when enabled.)</td>
|
|
|
- {% endif %}
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="kofi_token">Verification Token:</label> </td>
|
|
|
- <td style="padding: 5px;"> <input type="text" name="kofi_token" value="{{ settings_info[7] }}" size="40"> </td>
|
|
|
- <td>Get from Kofi -> More -> API -> Webhooks -> Advanced -> Verification Token.</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <br><button class="button button2" type="submit">Save Changes</button><br>
|
|
|
- </form>
|
|
|
- <br><br>
|
|
|
- </body>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id='kofi-settings' class="tabcontent">
|
|
|
- <body style="text-align: left;">
|
|
|
- <form method="POST" action="/mgmt/ksettings">
|
|
|
- <table>
|
|
|
- <h3>Kofi Settings</h3>
|
|
|
-
|
|
|
- <h4> Donations </h4>
|
|
|
- <thead>
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- <th style="width: 20%;"></th>
|
|
|
- <th></th>
|
|
|
- <th style="width: 50%;"></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tr>
|
|
|
- <td> <label for="enable_donations">Enable points for donations:</label> </td>
|
|
|
- {% if kofi_settings['donations'] %}
|
|
|
- <td> <input type="checkbox" name="enable_donations" value="{{ kofi_settings['donations'] }}" checked> </td>
|
|
|
- {% else %}
|
|
|
- <td> <input type="checkbox" name="enable_donations" value="{{ kofi_settings['donations'] }}"> </td>
|
|
|
- {% endif %}
|
|
|
- <td>Enable awarding points for donations</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="set_donation_points">Points per dollar:</label> </td>
|
|
|
- <td> <input type="number" name="set_donation_points" value="{{ kofi_settings['donation_points'] }}" size="5" required> points</td>
|
|
|
- <td>How many points should viewers recieve, for every dollar they donate?</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="kofi_url">Kofi Page:</label> </td>
|
|
|
- <td style="padding: 5px;"> <input type="text" name="kofi_url" value="{{ kofi_settings['kofi_url'] }}" size="30"> </td>
|
|
|
- <td>What is your Kofi page URL?</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <table>
|
|
|
- <h4> Subscriptions </h4>
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td> <label for="enable_subs">Enable points for subscriptions:</label> </td>
|
|
|
- {% if kofi_settings['subs'] %}
|
|
|
- <td> <input type="checkbox" name="enable_subs" value="{{ kofi_settings['subs'] }}" checked> </td>
|
|
|
- {% else %}
|
|
|
- <td> <input type="checkbox" name="enable_subs" value="{{ kofi_settings['subs'] }}"> </td>
|
|
|
- {% endif %}
|
|
|
- <td>Enable awarding points for monthly subscriptions</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td> <label for="sub_points">Points per month:</label> </td>
|
|
|
- <td> <input type="number" name="sub_points" value="{{ kofi_settings['sub_points'] }}" size="6" required> points</td>
|
|
|
- <td>How many points should subscribers recieve every month?</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <table>
|
|
|
- <h4> Logo </h4>
|
|
|
- <tbody>
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- Which logo would you like to use?
|
|
|
- </tr>
|
|
|
- {% for kofi_logo in kofi_logos %}
|
|
|
- {% if loop.index0 % 8 == 0 %}
|
|
|
- <tr style="border-bottom: none;">
|
|
|
- {% endif %}
|
|
|
- <td>
|
|
|
- <label for="kofi_logo"><img src="/static/img/kofi/{{ kofi_logo }}"></label>
|
|
|
- {% if kofi_logo == kofi_settings['kofi_logo'] %}
|
|
|
- <input type="radio" name="kofi_logo" value="{{ kofi_logo }}" checked>
|
|
|
- {% else %}
|
|
|
- <input type="radio" name="kofi_logo" value="{{ kofi_logo }}">
|
|
|
- {% endif %}
|
|
|
- </td>
|
|
|
- {% if loop.index0 % 8 == 7 or loop.last %}
|
|
|
- </tr> <!-- Close the row after 8 items or at the end -->
|
|
|
- {% endif %}
|
|
|
- {% endfor %}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- <br><button class="button button2" type="submit">Save Changes</button><br>
|
|
|
- </form>
|
|
|
- <br><br>
|
|
|
- <i>Kofi subscription tier support coming soon.</i>
|
|
|
- </body>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
-</html>
|