feat(Settings): add ping services scheduler settings for cache refresh interval and enable/disable functionality
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 3m31s

This commit is contained in:
2026-02-22 20:50:46 +07:00
parent 431314b973
commit 1548de7064
2 changed files with 80 additions and 0 deletions
+40
View File
@@ -77,6 +77,8 @@ export default function SettingsPage() {
const [pingServicesServerId, setPingServicesServerId] = useState('');
const [pingServicesGatewayIp, setPingServicesGatewayIp] = useState('');
const [pingServicesCacheSeconds, setPingServicesCacheSeconds] = useState('');
const [pingServicesSchedulerEnabled, setPingServicesSchedulerEnabled] = useState(true);
const [pingServicesSchedulerIntervalMinutes, setPingServicesSchedulerIntervalMinutes] = useState('2');
const [interfaceSpeedTestProtocol, setInterfaceSpeedTestProtocol] = useState('tcp');
const [interfaceSpeedTestDurationSeconds, setInterfaceSpeedTestDurationSeconds] = useState('10');
const [interfaceSpeedTestCacheMinutes, setInterfaceSpeedTestCacheMinutes] = useState('');
@@ -236,6 +238,12 @@ export default function SettingsPage() {
? String(data.pingServicesCacheSeconds)
: ''
);
setPingServicesSchedulerEnabled(data?.pingServicesSchedulerEnabled !== false);
setPingServicesSchedulerIntervalMinutes(
data?.pingServicesSchedulerIntervalMinutes != null
? String(data.pingServicesSchedulerIntervalMinutes)
: '2'
);
setInterfaceSpeedTestProtocol(
String(data?.interfaceSpeedTestProtocol || 'tcp').toLowerCase() ===
'udp'
@@ -356,6 +364,11 @@ export default function SettingsPage() {
0,
parseInt(pingServicesCacheSeconds, 10) || 0
),
pingServicesSchedulerEnabled: Boolean(pingServicesSchedulerEnabled),
pingServicesSchedulerIntervalMinutes: Math.max(
1,
Math.min(1440, parseInt(pingServicesSchedulerIntervalMinutes, 10) || 2)
),
interfaceSpeedTestProtocol:
interfaceSpeedTestProtocol === 'udp' ? 'udp' : 'tcp',
interfaceSpeedTestDurationSeconds: Math.max(
@@ -695,6 +708,33 @@ export default function SettingsPage() {
min={0}
/>
</div>
<div className="mb-3">
<div className="form-check form-switch mb-2">
<input
className="form-check-input"
type="checkbox"
id="pingServicesSchedulerEnabled"
checked={pingServicesSchedulerEnabled}
onChange={(e) => setPingServicesSchedulerEnabled(e.target.checked)}
disabled={saving}
/>
<label className="form-check-label" htmlFor="pingServicesSchedulerEnabled">
Планировщик: обновлять кеш пингов по расписанию
</label>
</div>
<FormField
label="Интервал обновления (мин)"
name="pingServicesSchedulerIntervalMinutes"
type="number"
value={pingServicesSchedulerIntervalMinutes}
onChange={setPingServicesSchedulerIntervalMinutes}
placeholder="2"
helpText="Как часто планировщик обновляет кеш пингов (1–1440 мин). По умолчанию 2 мин."
disabled={saving}
min={1}
max={1440}
/>
</div>
{pingServicesSource === 'router' && (
<div className="row g-2">
<div className="col-md-6">
+40
View File
@@ -27,6 +27,8 @@ export default function SettingsModal({ open, onClose }) {
const [pingServicesServerId, setPingServicesServerId] = useState('');
const [pingServicesGatewayIp, setPingServicesGatewayIp] = useState('');
const [pingServicesCacheSeconds, setPingServicesCacheSeconds] = useState('');
const [pingServicesSchedulerEnabled, setPingServicesSchedulerEnabled] = useState(true);
const [pingServicesSchedulerIntervalMinutes, setPingServicesSchedulerIntervalMinutes] = useState('2');
const [serversList, setServersList] = useState([]);
const [interfaceSpeedTestProtocol, setInterfaceSpeedTestProtocol] = useState('tcp');
const [interfaceSpeedTestDurationSeconds, setInterfaceSpeedTestDurationSeconds] = useState('10');
@@ -69,6 +71,12 @@ export default function SettingsModal({ open, onClose }) {
? String(data.pingServicesCacheSeconds)
: ''
);
setPingServicesSchedulerEnabled(data?.pingServicesSchedulerEnabled !== false);
setPingServicesSchedulerIntervalMinutes(
data?.pingServicesSchedulerIntervalMinutes != null
? String(data.pingServicesSchedulerIntervalMinutes)
: '2'
);
setInterfaceSpeedTestProtocol(
String(data?.interfaceSpeedTestProtocol || 'tcp').toLowerCase() ===
'udp'
@@ -157,6 +165,11 @@ export default function SettingsModal({ open, onClose }) {
0,
parseInt(pingServicesCacheSeconds, 10) || 0
),
pingServicesSchedulerEnabled: Boolean(pingServicesSchedulerEnabled),
pingServicesSchedulerIntervalMinutes: Math.max(
1,
Math.min(1440, parseInt(pingServicesSchedulerIntervalMinutes, 10) || 2)
),
interfaceSpeedTestProtocol:
interfaceSpeedTestProtocol === 'udp' ? 'udp' : 'tcp',
interfaceSpeedTestDurationSeconds: Math.max(
@@ -370,6 +383,33 @@ export default function SettingsModal({ open, onClose }) {
min={0}
/>
</div>
<div className="mb-2">
<div className="form-check form-switch mb-1">
<input
className="form-check-input"
type="checkbox"
id="modalPingServicesSchedulerEnabled"
checked={pingServicesSchedulerEnabled}
onChange={(e) => setPingServicesSchedulerEnabled(e.target.checked)}
disabled={loading || saving}
/>
<label className="form-check-label small" htmlFor="modalPingServicesSchedulerEnabled">
Планировщик: обновлять кеш пингов по расписанию
</label>
</div>
<FormField
label="Интервал обновления (мин)"
name="pingServicesSchedulerIntervalMinutes"
type="number"
value={pingServicesSchedulerIntervalMinutes}
onChange={setPingServicesSchedulerIntervalMinutes}
placeholder="2"
helpText="Как часто обновлять кеш (1–1440 мин). По умолчанию 2."
disabled={loading || saving}
min={1}
max={1440}
/>
</div>
{pingServicesSource === 'router' && (
<div className="row g-2">
<div className="col-md-6">