@@ -571,8 +613,51 @@ async function onSettingWindowCreated(view: Element) {
+
+
+
+
上报文件进行base64编码
+
不开启时,上报文件将以本地路径形式发送
+
+
+
+
+
+
debug模式
+
开启后上报消息添加raw字段附带原始消息
+
+
+
+
+
+
上报自身消息
+
开启后上报自己发出的消息
+
+
+
+
+
+
日志
+
日志目录:${window.LiteLoader.plugins["LLOneBot"].path.data}
+
+
+
+
+
`
const parser = new DOMParser();
@@ -589,6 +674,25 @@ async function onSettingWindowCreated(view: Element) {
doc.getElementById("addHost").addEventListener("click", () => addHostEle())
+ function switchClick(eleId: string, configKey: string) {
+ doc.getElementById(eleId)?.addEventListener("click", (e) => {
+ const switchEle = e.target as HTMLInputElement
+ if (config[configKey]) {
+ config[configKey] = false
+ switchEle.removeAttribute("is-active")
+ } else {
+ config[configKey] = true
+ switchEle.setAttribute("is-active", "")
+ }
+ window.llonebot.setConfig(config)
+ })
+ }
+
+ switchClick("debug", "debug");
+ switchClick("switchBase64", "enableBase64");
+ switchClick("reportSelfMessage", "reportSelfMessage");
+ switchClick("log", "log");
+
doc.getElementById("save")?.addEventListener("click",
() => {
const portEle: HTMLInputElement = document.getElementById("port") as HTMLInputElement
@@ -603,12 +707,13 @@ async function onSettingWindowCreated(view: Element) {
hosts.push(hostEle.value);
}
}
- window.llonebot.setConfig({
- port: parseInt(port),
- hosts: hosts
- })
+ config.port = parseInt(port);
+ config.hosts = hosts;
+ window.llonebot.setConfig(config);
alert("保存成功");
})
+
+
doc.body.childNodes.forEach(node => {
view.appendChild(node);
});
@@ -616,8 +721,8 @@ async function onSettingWindowCreated(view: Element) {
}
-setTimeout(onLoad, 5000);
+setTimeout(onLoad, 5000)
export {
onSettingWindowCreated
-}
\ No newline at end of file
+}