Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/7496

Vanessa1f98334c60b5
diff --git a/app/electron/main.js b/app/electron/main.js
index e424d43dec..c06e9798b3 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -673,11 +673,6 @@ app.whenReady().then(() => {
}
});
});
- ipcMain.on("siyuan-closetab", (event, data) => {
- BrowserWindow.getAllWindows().forEach(item => {
- item.webContents.send("siyuan-closetab", data);
- });
- });
ipcMain.on("siyuan-export-pdf", (event, data) => {
BrowserWindow.fromId(data.id).webContents.send("siyuan-export-pdf", data);
});
@@ -851,6 +846,11 @@ app.whenReady().then(() => {
item.webContents.send("siyuan-lock-screen");
});
});
+ ipcMain.on("siyuan-closetab", (event, data) => {
+ BrowserWindow.getAllWindows().forEach(item => {
+ item.webContents.send("siyuan-closetab", data);
+ });
+ });
if (firstOpen) {
const firstOpenWindow = new BrowserWindow({
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index 9e1094b8bb..d95cd9cce7 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -79,19 +79,17 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
name,
type: "notebook"
}));
- }
- window.siyuan.menus.menu.append(new MenuItem({
- label: window.siyuan.languages.config,
- icon: "iconSettings",
- click: () => {
- fetchPost("/api/notebook/getNotebookConf", {
- notebook: notebookId
- }, (data) => {
- onGetnotebookconf(data.data);
- });
- }
- }).element);
- if (!window.siyuan.config.readonly) {
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: window.siyuan.languages.config,
+ icon: "iconSettings",
+ click: () => {
+ fetchPost("/api/notebook/getNotebookConf", {
+ notebook: notebookId
+ }, (data) => {
+ onGetnotebookconf(data.data);
+ });
+ }
+ }).element);
sortMenu("notebook", parseInt(liElement.parentElement.getAttribute("data-sortmode")), (sort) => {
fetchPost("/api/notebook/setNotebookConf", {
notebook: notebookId,
@@ -116,6 +114,15 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
return true;
});
}
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: window.siyuan.languages.riffCard,
+ iconHTML: '<svg class="b3-menu__icon" style="color: var(--b3-theme-secondary)"><use xlink:href="#iconRiffCard"></use></svg>',
+ click: () => {
+ fetchPost("/api/riff/getNotebookRiffDueCards", {notebook: notebookId}, (response) => {
+ openCardByData(response.data, `<span data-id="${notebookId}" class="fn__flex-center">${escapeHtml(name)}</span>`);
+ });
+ }
+ }).element);
/// #if !MOBILE
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.search,
@@ -125,13 +132,15 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
openSearch(window.siyuan.config.keymap.general.search.custom, undefined, notebookId);
}
}).element);
- window.siyuan.menus.menu.append(new MenuItem({
- label: window.siyuan.languages.replace,
- accelerator: window.siyuan.config.keymap.general.replace.custom,
- click() {
- openSearch(window.siyuan.config.keymap.general.replace.custom, undefined, notebookId);
- }
- }).element);
+ if (!window.siyuan.config.readonly) {
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: window.siyuan.languages.replace,
+ accelerator: window.siyuan.config.keymap.general.replace.custom,
+ click() {
+ openSearch(window.siyuan.config.keymap.general.replace.custom, undefined, notebookId);
+ }
+ }).element);
+ }
/// #endif
if (!window.siyuan.config.readonly) {
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);