Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:rotating_light:

Vanessaae7660f9ef29
diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts
index b5c77f9c18..7485d02f8e 100644
--- a/app/src/config/bazaar.ts
+++ b/app/src/config/bazaar.ts
@@ -246,7 +246,7 @@ export const bazaar = {
hasSetting = item.__proto__.hasOwnProperty("openSetting");
return true;
}
- })
+ });
}
html += `<div data-obj='${JSON.stringify(dataObj)}' class="b3-card${item.current ? " b3-card--current" : ""}">
<div class="b3-card__img"><img src="${item.iconURL}" onerror="this.src='${item.previewURLThumb}'"/></div>
@@ -606,10 +606,10 @@ export const bazaar = {
} else if (type === "setting") {
app.plugins.find((item: Plugin) => {
if (item.name === dataObj.name) {
- item.openSetting()
- return true
+ item.openSetting();
+ return true;
}
- })
+ });
event.preventDefault();
event.stopPropagation();
break;
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index ade4a9a158..2f26ff9aa2 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -20,6 +20,7 @@ export class Plugin {
}
public onload() {
+ // 加载
}
public addTopBar(options: {
@@ -49,11 +50,12 @@ export class Plugin {
}
public openSetting() {
+ // 打开设置
}
public loadData(storageName: string) {
if (!this.data) {
- this.data = {}
+ this.data = {};
}
if (typeof this.data[storageName] === "undefined") {
this.data[storageName] = "";
@@ -73,11 +75,11 @@ export class Plugin {
public saveData(storageName: string, data: any) {
return new Promise((resolve) => {
const pathString = `/data/storage/petal/${this.name}/${storageName}`;
- const file = new File([new Blob([data])], pathString.split('/').pop());
+ const file = new File([new Blob([data])], pathString.split("/").pop());
const formData = new FormData();
- formData.append('path', pathString);
- formData.append('file', file);
- formData.append('isDir', "false");
+ formData.append("path", pathString);
+ formData.append("file", file);
+ formData.append("isDir", "false");
fetchPost("/api/file/putFile", formData, (response) => {
this.data[storageName] = data;
resolve(response);