added timezone dropdown selector

This commit is contained in:
2025-10-22 10:42:18 -07:00
parent ece058e9da
commit 2e2211b26e
2 changed files with 51 additions and 20 deletions

View File

@@ -32,7 +32,9 @@
<form id="configForm">
<label>Timezone:
<input type="text" name="TZ">
<select id="tzSelect" name="TZ">
<option value="">Loading...</option>
</select>
</label>
<label>Backup Directory:
<input type="text" name="BACKUP_DIR">
@@ -61,6 +63,19 @@
<p id="status"></p>
<script>
async function loadTimezones() {
const res = await fetch('/cgi-bin/backupbot.cgi?action=get_timezones');
const data = await res.json();
const select = document.getElementById('tzSelect');
select.innerHTML = '';
data.timezones.forEach(tz => {
const opt = document.createElement('option');
opt.value = tz;
opt.textContent = tz;
select.appendChild(opt);
});
}
async function loadConfig() {
const res = await fetch('/cgi-bin/backupbot.cgi?action=get');
const data = await res.json();