ntp: more settings in webui

sntp startup and update delays & dhcp toggle
This commit is contained in:
Maxim Prokhorov
2024-08-08 18:29:52 +03:00
parent 70f214e2be
commit 1ca0dcc76b
3 changed files with 66 additions and 17 deletions

View File

@@ -2,6 +2,11 @@ import { updateVariables } from './settings.mjs';
export function init() {
updateVariables({
ntpServer: "192.168.1.1",
ntpTZ: 'UTC-2',
ntpStartDelay: 10,
ntpDhcp: true,
ntpUpdateIntvl: 1800,
webMode: 0,
useWhite: false,
useCCT: false,

View File

@@ -11,13 +11,16 @@
<fieldset>
<div class="pure-control-group">
<label>NTP Server</label>
<label>Server</label>
<input name="ntpServer" type="text">
<span class="pure-form-message-inline">
IP or hostname
</span>
</div>
<div class="pure-control-group">
<label>Time Zone</label>
<input name="ntpTZ" type="text" list="list:ntpTZ">
<input name="ntpTZ" type="text" list="list:ntpTZ" required >
<span class="pure-form-message-inline">POSIX TZ variable, defaults to <code>UTC0</code> aka "Coordinated Universal Time". For example, basic offset is expressed as either <code>UTC2</code> (meaning "UTC minus 2 hours"), or <code>UTC-2</code> ("UTC plus 2 hours"). For the list of possible values based on IANA Time Zone Database, <a href="https://github.com/xoseperez/espurna/wiki/NTP#tz-variable">see our wiki entry.</a></span>
<span class="pure-form-message-inline">For the technical documentation and more complicated examples, <a href="https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html">see libc tzset(3) manual page</a></span>
<datalist id="list:ntpTZ">
@@ -51,6 +54,30 @@
</datalist>
</div>
<div class="pure-control-group">
<label>Startup delay</label>
<input name="ntpStartDelay" type="number" min="3" required >
<span class="pure-form-message-inline">
s (seconds)
</span>
</div>
<div class="pure-control-group">
<label>Update interval</label>
<input name="ntpUpdateIntvl" type="number" min="15" required >
<span class="pure-form-message-inline">
s (seconds)
</span>
</div>
<div class="pure-control-group">
<label>DHCP override</label>
<input class="checkbox-toggle" type="checkbox" name="ntpDhcp">
<span class="pure-form-message-inline">
<strong>Always</strong> use NTP server provided by DHCP
</span>
</div>
</fieldset>
</div>