Show read-only server reading hours in settings

This commit is contained in:
Codex committed 2026-10-14 22:42:54 +02:00
1 parent de8e7ed988
commit ddd9c62c40
9 files changed
+89 -7

No files matched your search

+16
View File
@@ -85,6 +85,22 @@
h('button', { class: 'btn small', onclick: async () => { await save({ zoom: {} }); zoomText.textContent = zooms(); } }, 'Reset to fit'),
h('div', { class: 'muted small' }, '100% = the page fits the screen. Change it in the reader with Ctrl + mouse wheel, a pinch, or the + / - keys.'))));
const readingHoursBody = h('div', {}, h('p', { class: 'muted' }, 'Loading server reading hours…'));
section('user/reading-hours').append(h('section', { class: 'card' },
h('h2', {}, 'Server reading hours'), readingHoursBody,
h('p', { class: 'muted small' }, 'These hours are set in the server deployment and cannot be changed here. Overnight windows continue into the next day.')));
api('api/reading-schedule').then(schedule => {
readingHoursBody.textContent = '';
if (!schedule.enabled) {
readingHoursBody.append(h('p', {}, 'Reading is available at any time. No schedule is configured.'));
return;
}
readingHoursBody.append(h('p', { class: 'muted' }, `Server timezone: ${schedule.timezone}`),
h('div', { class: 'reading-hours-list' }, READING_DAYS.map((day, index) =>
h('div', { class: 'reading-hours-day' }, h('strong', {}, day),
h('span', {}, readingDayText(schedule, index))))));
}).catch(error => { readingHoursBody.replaceChildren(h('p', { class: 'error', role: 'alert' }, `Could not load reading hours: ${error.message}`)); });
section('user/reading-time').append(h('section', { class: 'card' },
h('h2', {}, 'Clock & Reading Story'),
check('readingClock', 'Track and show the Active Reading Clock',