Split RSS bots into their own category

New RSS_TYPES category with a /rss-bots page, sidebar entry, homepage tile, and an
explanation that RSS bots post a feed to a channel — share the channel link, not
the user. Remove rss from the Bots page (types table + create dropdown); the RSS
Bots page has a '+ New RSS Bot' button that only creates rss bots, with feed URL +
per hour/day/week fields shown directly (no bot-type select).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jon
2026-06-05 23:43:45 +01:00
parent 87029f6d2a
commit 895cc6ddfa
5 changed files with 53 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% import "_macros.html" as ui %}
{% block title %}{{ 'Business Groups' if tab == 'businesses' else tab | title }} — SimpleX Manager{% endblock %}
{% block title %}{{ 'Business Groups' if tab == 'businesses' else ('RSS Bots' if tab == 'rss-bots' else tab | title) }} — SimpleX Manager{% endblock %}
{% block head %}
<style>
@@ -29,8 +29,8 @@
{% endblock %}
{% block content %}
{% set new_label = 'User' if tab == 'users' else ('Business Group' if tab == 'businesses' else 'Bot') %}
{% set page_title = 'Business Groups' if tab == 'businesses' else tab | title %}
{% set new_label = 'User' if tab == 'users' else ('Business Group' if tab == 'businesses' else ('RSS Bot' if tab == 'rss-bots' else 'Bot')) %}
{% set page_title = 'Business Groups' if tab == 'businesses' else ('RSS Bots' if tab == 'rss-bots' else tab | title) %}
<div class="flex-between" style="margin-bottom: 24px;">
<h1 style="margin:0;">{{ page_title }}</h1>
<button class="btn btn-primary" onclick="openCreate()">
@@ -49,13 +49,23 @@
</div>
{% endif %}
{% if tab == 'rss-bots' %}
<div class="card bot-types-card" style="margin-bottom:24px;">
<h2 style="font-size:15px;margin-bottom:8px;">RSS Bots</h2>
<p class="muted" style="font-size:13px;">
RSS bots read from an RSS/Atom feed and post new items to a channel. To receive a feed,
share the bot's <strong>channel</strong> link with subscribers — open the bot and copy its
<strong>channel</strong> link, <strong>not</strong> the user address.
</p>
</div>
{% endif %}
{% if tab == 'bots' %}
<div class="card bot-types-card" style="margin-bottom:24px;">
<h2 style="font-size:15px;margin-bottom:12px;">Available bot types</h2>
<table>
<tr><td><span class="tag">echo</span></td><td class="muted">Repeats every message back to the sender — handy for testing a connection end to end.</td></tr>
<tr><td><span class="tag">llm</span></td><td class="muted">Chat with a local or remote LLM (OpenAI-compatible, e.g. Ollama). Give it context, it replies to your messages.</td></tr>
<tr><td><span class="tag">rss</span></td><td class="muted">Watches an RSS/Atom feed and broadcasts new posts to a channel it creates. Subscribers join the channel to receive them.</td></tr>
<tr><td><span class="tag">crypto</span></td><td class="muted">Streams selected crypto prices (CoinGecko) to a channel on an interval. Pick coins &amp; currencies below.</td></tr>
<tr><td><span class="tag">broadcast</span></td><td class="muted">Relays messages from authorized publishers out to all of the bot's contacts.</td></tr>
<tr><td><span class="tag">support</span></td><td class="muted">Business inbox — auto-replies with a welcome message and collects incoming inquiries.</td></tr>
@@ -108,6 +118,9 @@
{% elif tab == 'businesses' %}
<strong>No business groups yet</strong>
<p>Create a business group; each customer who connects gets their own group chat.</p>
{% elif tab == 'rss-bots' %}
<strong>No RSS bots yet</strong>
<p>Create an RSS bot to post a feed to a channel.</p>
{% else %}
<strong>No bots yet</strong>
<p>Bots can echo messages, broadcast to subscribers, or run automated tasks.</p>
@@ -140,6 +153,20 @@
<input type="text" name="welcome_message" placeholder="Thanks for reaching out! How can we help?">
</div>
{% endif %}
{% if tab == 'rss-bots' %}
<div class="field">
<label>Feed URL</label>
<input type="text" name="feed_url" placeholder="https://example.com/feed.xml">
</div>
<div class="field">
<label>How often to check the feed</label>
<div class="chk-grid">
<label class="chk"><input type="radio" name="rss_poll" value="3600" checked> Per hour</label>
<label class="chk"><input type="radio" name="rss_poll" value="86400"> Per day</label>
<label class="chk"><input type="radio" name="rss_poll" value="604800"> Per week</label>
</div>
</div>
{% endif %}
{% if tab == 'bots' %}
<div class="field">
<label>Bot Type</label>
@@ -228,27 +255,6 @@
<input type="text" name="prohibited_message" placeholder="Only publishers can broadcast. Your message is deleted.">
</div>
</div>
<div id="rss-fields" style="display:none;">
<div style="border-top:1px solid var(--border);margin:4px 0 14px;padding-top:14px;">
<p class="muted" style="margin-bottom:12px;">
The bot watches this feed and broadcasts new posts to a channel it creates.
Share the channel link (from the bot's profile) with subscribers — new posts
appear there automatically.
</p>
</div>
<div class="field">
<label>Feed URL</label>
<input type="text" name="feed_url" placeholder="https://example.com/feed.xml">
</div>
<div class="field">
<label>How often to check the feed</label>
<div class="chk-grid">
<label class="chk"><input type="radio" name="rss_poll" value="3600" checked> Per hour</label>
<label class="chk"><input type="radio" name="rss_poll" value="86400"> Per day</label>
<label class="chk"><input type="radio" name="rss_poll" value="604800"> Per week</label>
</div>
</div>
</div>
<div id="crypto-fields" style="display:none;">
<div style="border-top:1px solid var(--border);margin:4px 0 14px;padding-top:14px;">
<p class="muted" style="margin-bottom:12px;">
@@ -355,7 +361,6 @@ function onTypeChange() {
document.getElementById('deadmans-fields').style.display = (val === 'deadmans') ? 'block' : 'none';
document.getElementById('directory-fields').style.display = (val === 'directory') ? 'block' : 'none';
document.getElementById('broadcast-fields').style.display = (val === 'broadcast') ? 'block' : 'none';
document.getElementById('rss-fields').style.display = (val === 'rss') ? 'block' : 'none';
document.getElementById('crypto-fields').style.display = (val === 'crypto') ? 'block' : 'none';
}
{% endif %}