Add configurable TIMEZONE for web UI display (UTC storage preserved)

This commit is contained in:
2026-07-17 12:02:58 +07:00
parent 559025d5f7
commit 513b8ede84
12 changed files with 131 additions and 7 deletions
+10
View File
@@ -31,6 +31,15 @@
<label class="form-label">NOTIFICATION_TELEGRAM_CHAT_ID</label>
<input type="text" class="form-control" id="NOTIFICATION_TELEGRAM_CHAT_ID" value="{{ settings.NOTIFICATION_TELEGRAM_CHAT_ID or '' }}">
</div>
<div class="mb-3">
<label class="form-label">Часовой пояс</label>
<select class="form-select" id="TIMEZONE">
{% for tz in timezones %}
<option value="{{ tz }}" {% if settings.TIMEZONE == tz %}selected{% endif %}>{{ tz }}</option>
{% endfor %}
</select>
<div class="form-text">UTC хранится как есть, в веб-интерфейсе время отображается в выбранном поясе.</div>
</div>
<button type="submit" class="btn btn-primary">Сохранить</button>
</form>
<div id="settings-error" class="alert alert-danger mt-3 d-none"></div>
@@ -51,6 +60,7 @@ document.getElementById('settings-form').addEventListener('submit', async (e) =>
NOTIFICATION_WEBHOOK_URL: document.getElementById('NOTIFICATION_WEBHOOK_URL').value,
NOTIFICATION_TELEGRAM_BOT_TOKEN: document.getElementById('NOTIFICATION_TELEGRAM_BOT_TOKEN').value,
NOTIFICATION_TELEGRAM_CHAT_ID: document.getElementById('NOTIFICATION_TELEGRAM_CHAT_ID').value,
TIMEZONE: document.getElementById('TIMEZONE').value,
};
const res = await fetch('/api/settings', {
method: 'POST',