Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9002

Vanessa798a2970f9c8
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index 17e6f88a1d..08ddc8264f 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -10,6 +10,7 @@ import {getDockByType, setPanelFocus} from "../layout/util";
import {hasClosestByAttribute} from "../protyle/util/hasClosest";
import {BlockPanel} from "../block/Panel";
import {Setting} from "./Setting";
+import {getAllModels} from "../layout/getAll";
export class Plugin {
private app: App;
@@ -180,6 +181,20 @@ export class Plugin {
});
}
+ public getOpenedTab() {
+ const tabs: { [key: string]: Custom[] } = {}
+ const modelKeys = Object.keys(this.models)
+ modelKeys.forEach(item => {
+ tabs[item.replace(this.name, "")] = []
+ })
+ getAllModels().custom.find(item => {
+ if (modelKeys.includes(item.type)) {
+ tabs[item.type.replace(this.name, "")].push(item);
+ }
+ })
+ return tabs;
+ }
+
public addTab(options: {
type: string,
destroy?: () => void,