basic support for custom widgets

This commit is contained in:
zadam
2020-03-16 21:16:09 +01:00
parent 8ae78a9e23
commit 173030e02e
14 changed files with 99 additions and 22 deletions

View File

@@ -29,8 +29,8 @@ async function run(req) {
return { executionResult: result };
}
async function getStartupBundles() {
const notes = await attributeService.getNotesWithLabel("run", "frontendStartup");
async function getBundlesWithLabel(label, value) {
const notes = await attributeService.getNotesWithLabel(label, value);
const bundles = [];
@@ -45,6 +45,14 @@ async function getStartupBundles() {
return bundles;
}
async function getStartupBundles() {
return await getBundlesWithLabel("run", "frontendStartup");
}
async function getWidgetBundles() {
return await getBundlesWithLabel("widget");
}
async function getRelationBundles(req) {
const noteId = req.params.noteId;
const note = await repository.getNote(noteId);
@@ -84,6 +92,7 @@ module.exports = {
exec,
run,
getStartupBundles,
getWidgetBundles,
getRelationBundles,
getBundle
};