Add webhook text length stuff
Some checks failed
Test and build Docker image / docker (push) Failing after 15s
Some checks failed
Test and build Docker image / docker (push) Failing after 15s
This commit is contained in:
parent
d16fa92e4d
commit
85f25263f3
9 changed files with 525 additions and 26 deletions
|
|
@ -52,6 +52,7 @@
|
|||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="badge status-chip bg-secondary">Text limit: {{ webhook_text_length_limit }} chars</span>
|
||||
</div>
|
||||
</div>
|
||||
<section class="mt-4 pt-3 border-top border-secondary-subtle">
|
||||
|
|
@ -102,6 +103,7 @@
|
|||
{% elif delivery_mode == "screenshot" %}
|
||||
<li>Screenshot layout: {{ screenshot_layout }}.</li>
|
||||
{% endif %}
|
||||
<li>Webhook text is truncated to {{ webhook_text_length_limit }} characters.</li>
|
||||
<li>
|
||||
Filters:
|
||||
{% if has_blacklist_filters and has_whitelist_filters %}
|
||||
|
|
@ -284,6 +286,38 @@
|
|||
</form>
|
||||
</section>
|
||||
{% endif %}
|
||||
<section class="mt-4 pt-3 border-top border-secondary-subtle">
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-2">
|
||||
<h3 class="h6 text-uppercase text-muted mb-0">Text Delivery</h3>
|
||||
<span class="badge {{ 'bg-info' if webhook_text_length_limit < max_webhook_text_length_limit else 'bg-secondary' }}">
|
||||
Max {{ webhook_text_length_limit }} characters
|
||||
</span>
|
||||
</div>
|
||||
<p id="textDeliveryHelp" class="text-muted mb-3">
|
||||
Limit message length. Text mode allows values up to 4000 characters. Embeds are capped at 2000 characters.
|
||||
</p>
|
||||
<form action="/set_feed_webhook_text_length_limit"
|
||||
method="post"
|
||||
class="mb-0">
|
||||
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
|
||||
<div class="d-flex flex-wrap align-items-end gap-3">
|
||||
<div>
|
||||
<label class="form-label small text-muted mb-2" for="text_length_limit">Max characters</label>
|
||||
<input id="text_length_limit"
|
||||
class="form-control form-control-sm bg-dark border-dark text-light"
|
||||
type="number"
|
||||
name="text_length_limit"
|
||||
min="1"
|
||||
max="{{ max_webhook_text_length_limit }}"
|
||||
step="1"
|
||||
value="{{ webhook_text_length_limit }}"
|
||||
aria-describedby="textDeliveryHelp"
|
||||
required />
|
||||
</div>
|
||||
<button class="btn btn-outline-light btn-sm" type="submit">Save text limit</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<section class="mt-4 pt-3 border-top border-secondary-subtle">
|
||||
<h3 class="h6 text-uppercase text-muted mb-3">Customization</h3>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Settings | discord-rss-bot
|
||||
{% endblock title %}
|
||||
{% block description %}
|
||||
Adjust default update intervals, delivery modes, and screenshot layout for feeds managed by your bot.
|
||||
Adjust default update intervals, delivery modes, screenshot layout, and webhook text limits for feeds managed by your bot.
|
||||
{% endblock description %}
|
||||
{% block content %}
|
||||
<section>
|
||||
|
|
@ -78,6 +78,28 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form action="/set_global_webhook_text_length_limit"
|
||||
method="post"
|
||||
class="mt-4">
|
||||
<div class="settings-form-row mb-2">
|
||||
<label for="global_text_length_limit" class="form-label mb-1">Default text limit for new feeds</label>
|
||||
<div class="input-group input-group-lg">
|
||||
<input id="global_text_length_limit"
|
||||
type="number"
|
||||
class="form-control settings-input"
|
||||
name="text_length_limit"
|
||||
min="1"
|
||||
max="{{ max_webhook_text_length_limit }}"
|
||||
value="{{ global_webhook_text_length_limit }}"
|
||||
required />
|
||||
<button class="btn btn-primary px-4" type="submit">Save</button>
|
||||
</div>
|
||||
<div class="form-text text-muted mt-2">
|
||||
New feeds inherit this value. Existing feeds keep their current
|
||||
per-feed text limit. Text mode allows values up to 4000 characters. Embeds are capped at 2000 characters.
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<section class="mt-5">
|
||||
<div class="text-light">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue