shortcut improvements

This commit is contained in:
zadam
2022-11-30 16:57:51 +01:00
parent e759b4846a
commit 0985314fb7
10 changed files with 183 additions and 628 deletions

View File

@@ -48,7 +48,9 @@ const NOTE_TYPE_ICONS = {
"note-map": "bx bx-map-alt",
"mermaid": "bx bx-selection",
"canvas": "bx bx-pen",
"web-view": "bx bx-globe-alt"
"web-view": "bx bx-globe-alt",
"shortcut": "bx bx-link",
"doc": "bx bxs-file-doc"
};
/**
@@ -818,10 +820,10 @@ class NoteShort {
if (env === "frontend") {
const bundleService = (await import("../services/bundle.js")).default;
await bundleService.getAndExecuteBundle(this.noteId);
return await bundleService.getAndExecuteBundle(this.noteId);
}
else if (env === "backend") {
await server.post('script/run/' + this.noteId);
return await server.post('script/run/' + this.noteId);
}
else {
throw new Error(`Unrecognized env type ${env} for note ${this.noteId}`);
@@ -851,6 +853,10 @@ class NoteShort {
isContentAvailable() {
return !this.isProtected || protectedSessionHolder.isProtectedSessionAvailable()
}
isLaunchBarConfig() {
return this.type === 'shortcut' || this.noteId.startsWith("lb_");
}
}
export default NoteShort;