From 4dcbb4f1e9ed6d74d28972599a84e9c114af766d Mon Sep 17 00:00:00 2001 From: thzxx Date: Tue, 7 Apr 2026 02:10:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20importSessions=20?= =?UTF-8?q?=E4=B8=AD=20result=20=E5=8F=98=E9=87=8F=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E5=AF=BC=E8=87=B4=E7=BC=96=E8=AF=91=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-release.sh | 28 +++++++++++++++++++++++ package-lock.json | 4 ++-- src/renderer/components/settings-modal.ts | 6 ++--- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100755 build-release.sh diff --git a/build-release.sh b/build-release.sh new file mode 100755 index 0000000..fa10302 --- /dev/null +++ b/build-release.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +PROJECT="/root/.openclaw/workspace/metona-ollama" +cd "$PROJECT" + +echo "===== [1/6] 安装 Wine =====" +dpkg --add-architecture i386 +apt-get update -qq 2>/dev/null || sed -i 's|http://mirrors.cloud.aliyuncs.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list && apt-get update -qq +apt-get install -y -qq wine wine32 2>&1 | tail -3 +echo "Wine 安装完成: $(wine --version 2>/dev/null || echo 'installed')" + +echo "" +echo "===== [2/6] 安装 npm 依赖 =====" +cd "$PROJECT" +npm config set registry https://registry.npmmirror.com +npm install 2>&1 | tail -5 +echo "npm install 完成" + +echo "" +echo "===== [3/6] 构建 Windows 安装包 =====" +ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm run dist 2>&1 | tail -20 +echo "" +echo "构建产物:" +ls -lh "$PROJECT/release/"*.exe 2>/dev/null || echo "未找到 exe 文件" + +echo "" +echo "===== BUILD SCRIPT DONE =====" diff --git a/package-lock.json b/package-lock.json index b91394f..8d58b4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "metona-ollama-desktop", - "version": "3.0.0", + "version": "3.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "metona-ollama-desktop", - "version": "3.0.0", + "version": "3.1.0", "license": "MIT", "devDependencies": { "@types/node": "^20.17.0", diff --git a/src/renderer/components/settings-modal.ts b/src/renderer/components/settings-modal.ts index 4135f42..dd0a775 100644 --- a/src/renderer/components/settings-modal.ts +++ b/src/renderer/components/settings-modal.ts @@ -271,9 +271,9 @@ async function importSessions(filePath: string): Promise { return; } - const result = await db.importSessions(sessions); - showToast(`导入完成:${result.imported} 个会话${result.skipped > 0 ? `,跳过 ${result.skipped} 个` : ''}`, 'success', 4000); - logSuccess(`导入完成: ${result.imported} 个, 跳过 ${result.skipped} 个`); + const importResult = await db.importSessions(sessions); + showToast(`导入完成:${importResult.imported} 个会话${importResult.skipped > 0 ? `,跳过 ${importResult.skipped} 个` : ''}`, 'success', 4000); + logSuccess(`导入完成: ${importResult.imported} 个, 跳过 ${importResult.skipped} 个`); } catch (err) { showToast(`导入失败: ${(err as Error).message}`, 'error'); logError('导入失败', (err as Error).message);