update: default interval - plan limit
This commit is contained in:
parent
1a0b6bb0fe
commit
fc96e0d613
|
|
@ -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` };
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue