From be2119a1e629dfa06e787bfd1b36f3d262ac8f31 Mon Sep 17 00:00:00 2001
From: idranme <96647698+idranme@users.noreply.github.com>
Date: Wed, 16 Oct 2024 11:32:27 +0800
Subject: [PATCH 1/2] feat: add save button

---
 src/renderer/index.ts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/renderer/index.ts b/src/renderer/index.ts
index c81d889..ad11311 100644
--- a/src/renderer/index.ts
+++ b/src/renderer/index.ts
@@ -175,6 +175,7 @@ async function onSettingWindowCreated(view: Element) {
           '调用 /get_image、/get_record、/get_file 时,没有 url 时添加 Base64 字段',
           SettingSwitch('enableLocalFile2Url', config.enableLocalFile2Url),
         ),
+        SettingItem('', null, SettingButton('保存', 'config-ob11-save-2', 'primary')),
       ]),
       SettingList([
         SettingItem(
@@ -214,6 +215,7 @@ async function onSettingWindowCreated(view: Element) {
           '单位为秒,可用于获取撤回的消息',
           `<div class="q-input"><input class="q-input__inner" data-config-key="msgCacheExpire" type="number" min="1" value="${config.msgCacheExpire}" placeholder="${config.msgCacheExpire}" /></div>`,
         ),
+        SettingItem('', null, SettingButton('保存', 'config-ob11-save-3', 'primary')),
       ]),
       SettingList([
         SettingItem('GitHub 仓库', `https://github.com/LLOneBot/LLOneBot`, SettingButton('点个星星', 'open-github')),
@@ -392,6 +394,22 @@ async function onSettingWindowCreated(view: Element) {
     alert('保存成功')
   })
 
+  doc.querySelector('#config-ob11-save-2')?.addEventListener('click', () => {
+    config.ob11 = ob11Config
+
+    window.llonebot.setConfig(false, config)
+    showError().then()
+    alert('保存成功')
+  })
+
+  doc.querySelector('#config-ob11-save-3')?.addEventListener('click', () => {
+    config.ob11 = ob11Config
+
+    window.llonebot.setConfig(false, config)
+    showError().then()
+    alert('保存成功')
+  })
+
   doc.body.childNodes.forEach((node) => {
     view.appendChild(node)
   })

From 50e5f89f4fae5ade32edd676594063c5c93ef97a Mon Sep 17 00:00:00 2001
From: idranme <96647698+idranme@users.noreply.github.com>
Date: Wed, 16 Oct 2024 11:43:14 +0800
Subject: [PATCH 2/2] chore: bump versions

---
 manifest.json  | 2 +-
 src/version.ts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/manifest.json b/manifest.json
index b518373..54fd8ba 100644
--- a/manifest.json
+++ b/manifest.json
@@ -4,7 +4,7 @@
   "name": "LLOneBot",
   "slug": "LLOneBot",
   "description": "实现 OneBot 11 和 Satori 协议,用于 QQ 机器人开发",
-  "version": "4.0.10",
+  "version": "4.0.11",
   "icon": "./icon.webp",
   "authors": [
     {
diff --git a/src/version.ts b/src/version.ts
index 3aeb8a8..287e10a 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const version = '4.0.10'
+export const version = '4.0.11'