update: default interval - plan limit

This commit is contained in:
nate 2026-03-22 06:23:46 +04:00
parent 1a0b6bb0fe
commit fc96e0d613
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ export const monitors = new Elysia({ prefix: "/monitors" })
}
// Enforce minimum interval for plan
const interval = body.interval_s ?? 30;
const interval = body.interval_s ?? limits.minIntervalS;
if (interval < limits.minIntervalS) {
set.status = 400;
return { error: `Minimum interval for ${plan} plan is ${limits.minIntervalS}s` };

View File

@ -69,7 +69,7 @@
<select id="<%= prefix %>interval" name="interval_s"
class="w-full <%= bg %> border <%= border %> rounded-lg px-4 py-2.5 text-gray-100 focus:outline-none focus:border-blue-500">
<% intervals.forEach(function([val, label]) { %>
<option value="<%= val %>" <%= String(monitor.interval_s || '30') === val ? 'selected' : '' %>><%= label %></option>
<option value="<%= val %>" <%= String(monitor.interval_s || minInterval) === val ? 'selected' : '' %>><%= label %></option>
<% }) %>
</select>
</div>