Re #269 - Show current/correct BASE_URL information (#271)

* Re #269 - Show current/correct BASE_URL information
This commit is contained in:
dgtlmoon
2021-12-04 15:23:23 +01:00
committed by GitHub
parent 61c1d213d0
commit 3956b3fd68
5 changed files with 12 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
{% from '_helpers.jinja' import render_field %}
{% macro render_notifications_field(form) %}
{% macro render_common_settings_form(form, current_base_url) %}
<div class="pure-control-group">
{{ render_field(form.notification_urls, rows=5, placeholder="Examples:
@@ -78,7 +78,7 @@
</table>
<span class="pure-form-message-inline">
URLs generated by changedetection.io (such as <code>{diff_url}</code>) require the <code>BASE_URL</code> environment variable set.<br/>
Your <code>BASE_URL</code> var is currently "{{base_url}}"
Your <code>BASE_URL</code> var is currently "{{current_base_url}}"
</span>
</div>
</div>

View File

@@ -1,7 +1,7 @@
{% extends 'base.html' %}
{% block content %}
{% from '_helpers.jinja' import render_field %}
{% from '_common_fields.jinja' import render_notifications_field %}
{% from '_common_fields.jinja' import render_common_settings_form %}
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='tabs.js')}}" defer></script>
<div class="edit-form monospaced-textarea">
@@ -66,7 +66,7 @@ User-Agent: wonderbra 1.0") }}
<strong>Note: <i>These settings override the global settings.</i></strong>
<fieldset>
<div class="field-group">
{{ render_notifications_field(form) }}
{{ render_common_settings_form(form, current_base_url) }}
</div>
</fieldset>
</div>

View File

@@ -2,7 +2,7 @@
{% block content %}
{% from '_helpers.jinja' import render_field %}
{% from '_common_fields.jinja' import render_notifications_field %}
{% from '_common_fields.jinja' import render_common_settings_form %}
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='settings.js')}}" defer></script>
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='tabs.js')}}" defer></script>
@@ -36,7 +36,7 @@
{{ render_field(form.base_url, placeholder="http://yoursite.com:5000/",
class="m-d") }}
<span class="pure-form-message-inline">
Base URL used for the {base_url} token in notifications, default value is the ENV var 'BASE_URL',
Base URL used for the {base_url} token in notifications, default value is the ENV var 'BASE_URL' (Currently "{{current_base_url}}"),
<a href="https://github.com/dgtlmoon/changedetection.io/wiki/Configurable-BASE_URL-setting">read more here</a>.
</span>
</div>
@@ -51,7 +51,7 @@
<div class="tab-pane-inner" id="notifications">
<fieldset>
<div class="field-group">
{{ render_notifications_field(form) }}
{{ render_common_settings_form(form, current_base_url) }}
</div>
</fieldset>
</div>