index.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <html>
  2. <header>
  3. <script src="/api/plugin/settings/SpamBlock/jquery.js"></script>
  4. <script>
  5. $(function () {
  6. $("#submit").click(function () {
  7. let data = {};
  8. let value = $('#form').serializeArray();
  9. $.each(value, function (index, item) {
  10. data[item.name] = item.value;
  11. });
  12. let jsonData = JSON.stringify(data);
  13. console.log(jsonData);
  14. $.post("/api/plugin/settings/SpamBlock/save", jsonData, function (data) {
  15. alert(data)
  16. })
  17. })
  18. })
  19. </script>
  20. </header>
  21. <body>
  22. <div>
  23. <form id="form" action="/api/plugin/settings/SpamBlock/save" method="post">
  24. <div>
  25. <label for="url"> 模型API接口地址: </label>
  26. <input id="url" style="width: 600px;" name="url" value="%s"
  27. placeholder="http://localhost:8501/v1/models/emotion_model:predict">
  28. </div>
  29. <div>
  30. <label for="timeout"> 超时时间: </label>
  31. <input id="timeout" style="width: 600px;" name="timeout" value="%d" placeholder="单位毫秒">
  32. </div>
  33. <div>
  34. <label for="threshold"> 识别阈值: </label>
  35. <input id="threshold" name="threshold" type="number" value="%f" style="width: 600px;"
  36. step=".01" max="100" min="0" placeholder="识别阈值,值越低过滤越严格,越容易误判">
  37. </div>
  38. <input id="submit" type="button" value="Submit"/>
  39. </form>
  40. </div>
  41. </body>
  42. </html>