Smail/backend/hooks/spam_block/static/index.html
smail f60d3b0880
Some checks are pending
Security Checks / security (push) Waiting to run
整理前后端与测试构建目录并完善配置和安全引导
统一 frontend、backend、test、test-log 和 out 目录,更新构建、部署及测试入口;纳入配置管理兼容与首次安全引导修复;排除本机配置、密钥和测试产物。
2026-09-05 19:19:52 +08:00

56 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html>
<header>
<script>
function saveSettings() {
const form = document.getElementById("form");
window.parent.postMessage({
type: "smail-plugin-settings-save",
plugin: "SpamBlock",
payload: {
url: form.url.value,
timeout: form.timeout.value,
threshold: form.threshold.value
}
}, "*");
}
window.addEventListener("message", function (event) {
if (event.source === window.parent && event.data && event.data.type === "smail-plugin-settings-result" && event.data.plugin === "SpamBlock") {
alert(event.data.ok ? "保存成功" : "保存失败");
}
});
</script>
</header>
<body>
<div>
<form id="form" action="#" method="post">
<div>
<label for="url"> 模型API接口地址: </label>
<input id="url" style="width: 600px;" name="url" value="%s"
placeholder="https://model.example.com/v1/predict">
</div>
<div>
<label for="timeout"> 超时时间: </label>
<input id="timeout" style="width: 600px;" name="timeout" value="%d" placeholder="单位毫秒">
</div>
<div>
<label for="threshold"> 识别阈值: </label>
<input id="threshold" name="threshold" type="number" value="%f" style="width: 600px;"
step=".01" max="100" min="0" placeholder="识别阈值,值越低过滤越严格,越容易误判">
</div>
<input id="submit" type="button" value="保存" onclick="saveSettings()"/>
</form>
</div>
</body>
</html>