Skip to content

Commit

Permalink
Set min and max value of retrievalRate with cut-off
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0crstntr committed Feb 27, 2024
1 parent 99969d6 commit cdce157
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
15 changes: 14 additions & 1 deletion admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
disableIPInput();
onChange();
});
$("#retrievalRate").on("change", () => {
limitRetrievalRate($("#retrievalRate").val());
onChange();
});
disableIPInput();
onChange(false);
if (M) M.updateTextFields();
Expand Down Expand Up @@ -70,6 +74,15 @@
obj.connectViaIP = $("#connectViaIP").prop("checked");
callback(obj);
}

function limitRetrievalRate(rate) {
if (rate < 2) {
return $("#retrievalRate").val(2);
} else if (rate > 3600) {
return $("#retrievalRate").val(3600);
}
}

</script>

<style>
Expand Down Expand Up @@ -126,7 +139,7 @@ <h6 class="title" style="background-color: #174475; font-size: 1.2rem; border-ra
<div class="row" style="padding: 4px">
<div class="input-field col s12 m6 l3">
<label for="retrievalRate" class="translate">retrieval_rate_txt</label>
<input type="number" class="value" id="retrievalRate" min="2" max="500" step="1" placeholder="10" />
<input type="number" class="value" id="retrievalRate" min="2" max="3600" step="1" placeholder="10" />
</div>
<div class="input-field col s12 m6 l3">
<select id="retrievalType" class="value">
Expand Down
12 changes: 11 additions & 1 deletion build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cdce157

Please sign in to comment.