@vincentbanana/banana-gui 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/ui/app.js +14 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincentbanana/banana-gui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Banana 的图形界面:本地服务 + 浏览器。黑白主题,自绘图标,无第三方 UI 依赖",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"electron-builder": "^25.0.0"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@vincentbanana/bananacli": "^0.8.
|
|
75
|
+
"@vincentbanana/bananacli": "^0.8.3"
|
|
76
76
|
},
|
|
77
77
|
"license": "MIT",
|
|
78
78
|
"publishConfig": {
|
package/ui/app.js
CHANGED
|
@@ -794,17 +794,20 @@ function sessionToMarkdown(messages, title) {
|
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
async function downloadSession(format, id) {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
797
|
+
// 始终从服务端读取完整会话:/api/info 为了性能裁掉了图片 base64 和附件全文。
|
|
798
|
+
const targetId = id || state.info?.session?.id;
|
|
799
|
+
if (!targetId) return;
|
|
800
|
+
let session;
|
|
801
|
+
try {
|
|
802
|
+
const result = await post('session', { action: 'load', ref: targetId });
|
|
803
|
+
session = result?.session;
|
|
804
|
+
} catch (error) {
|
|
805
|
+
toast('导出失败:' + (error?.message ?? error));
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
if (!session) {
|
|
809
|
+
toast('导出失败:没找到这个对话');
|
|
810
|
+
return;
|
|
808
811
|
}
|
|
809
812
|
const blob =
|
|
810
813
|
format === 'json'
|