Release v2.6.3: support page with SBP/card/crypto donate placeholders and admin settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+49
-1
@@ -650,6 +650,41 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- BLOCK: Support / Donate (admin) -->
|
||||
{% set donate_cfg = settings.get('donate') or {} %}
|
||||
<div class="card" style="margin-top: var(--space-lg);">
|
||||
<h3 class="card-title" style="margin-bottom: var(--space-lg);">{{ icon('heart') }} {{ _('donate_settings_title') }}</h3>
|
||||
<p class="form-hint" style="margin-top: 0; margin-bottom: var(--space-md);">{{ _('donate_settings_hint') }}</p>
|
||||
<div class="form-group">
|
||||
<label class="form-label" style="display:flex; align-items:center; gap:8px; cursor:pointer;">
|
||||
<input type="checkbox" id="donate_enabled" {% if donate_cfg.get('enabled', True) %}checked{% endif %}>
|
||||
{{ _('donate_enabled') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ _('donate_intro') }}</label>
|
||||
<textarea class="form-textarea" id="donate_intro" rows="2" placeholder="{{ _('support_intro') }}">{{ donate_cfg.get('intro') or '' }}</textarea>
|
||||
</div>
|
||||
{% for key, label_key in [('sbp', 'donate_sbp'), ('card', 'donate_card'), ('crypto', 'donate_crypto')] %}
|
||||
{% set method = donate_cfg.get(key) or {} %}
|
||||
<div style="border:1px solid var(--border-color); border-radius:var(--radius-md); padding:var(--space-md); margin-bottom:var(--space-md);">
|
||||
<label class="form-label" style="display:flex; align-items:center; gap:8px; cursor:pointer; margin-bottom:var(--space-sm);">
|
||||
<input type="checkbox" id="donate_{{ key }}_enabled" {% if method.get('enabled', True) %}checked{% endif %}>
|
||||
{{ _(label_key) }}
|
||||
</label>
|
||||
<div class="form-group" style="margin-bottom:var(--space-sm);">
|
||||
<label class="form-label">{{ _('donate_method_title') }}</label>
|
||||
<input type="text" class="form-input" id="donate_{{ key }}_title" value="{{ method.get('title') or '' }}" placeholder="{{ _(label_key) }}">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:0;">
|
||||
<label class="form-label">{{ _('donate_method_details') }}</label>
|
||||
<textarea class="form-textarea" id="donate_{{ key }}_details" rows="3" placeholder="{{ _('donate_details_placeholder') }}">{{ method.get('details') or '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<p class="form-hint">{{ _('donate_preview_hint') }} <a href="/support" target="_blank" rel="noopener">/support</a></p>
|
||||
</div>
|
||||
|
||||
<!-- BLOCK: About & Updates -->
|
||||
<div class="card" style="margin-top: var(--space-lg);">
|
||||
<h3 class="card-title" style="margin-bottom: var(--space-lg);">ℹ️ {{ _('about_title') }}</h3>
|
||||
@@ -1478,11 +1513,24 @@
|
||||
create_xui_panel_id: document.getElementById('guest_create_xui_panel')?.value || '',
|
||||
};
|
||||
|
||||
const donateMethod = (key) => ({
|
||||
enabled: document.getElementById(`donate_${key}_enabled`).checked,
|
||||
title: document.getElementById(`donate_${key}_title`).value.trim(),
|
||||
details: document.getElementById(`donate_${key}_details`).value.trim(),
|
||||
});
|
||||
const donate = {
|
||||
enabled: document.getElementById('donate_enabled').checked,
|
||||
intro: document.getElementById('donate_intro').value.trim(),
|
||||
sbp: donateMethod('sbp'),
|
||||
card: donateMethod('card'),
|
||||
crypto: donateMethod('crypto'),
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/settings/save', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ appearance, sync, captcha, telegram, ssl, guest })
|
||||
body: JSON.stringify({ appearance, sync, captcha, telegram, ssl, guest, donate })
|
||||
});
|
||||
if (!res.ok) throw new Error(_('error'));
|
||||
showToast(_('settings_saved'), 'success');
|
||||
|
||||
Reference in New Issue
Block a user