1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/test/resources/plugin/test-plugin/library-filestore.js
Nick O'Leary 3f9a29730f
Add partial implementation of adding library sources via editor
This adds lots of commented out code that provides a settings panel
to add new library sources. It is incomplete as it doesn't actually
add/update the library sources on the runtime.

For 1.3, I'm focussing on allowing additional sources get added
via the settings file only. I've done enough work on the editor
side to convince myself more work is needed than I can justify
at this time on what is otherwise not going to be a widely
used feature.
2021-02-18 11:58:23 +00:00

37 lines
996 B
JavaScript

module.exports = function(RED) {
const PLUGIN_TYPE_ID = "node-red-library-filestore";
class FileStorePlugin {
constructor(config) {
this.type = PLUGIN_TYPE_ID;
this.id = config.id;
this.label = config.label;
this.config = config.config;
this.icon = config.icon;
console.log("FileStorePlugin",config)
}
async init() {
console.log("FileStorePlugin.init")
}
async getEntry(type,path) {
console.log("FileStorePlugin.getLibraryEntry",type,path)
return []
}
async saveEntry(type,path,meta,body) {
console.log("FileStorePlugin.saveLibraryEntry",type,path)
}
}
RED.plugins.registerPlugin(PLUGIN_TYPE_ID, {
type: "node-red-library-source",
class: FileStorePlugin,
defaults: {
"path": { value: "" },
// "secret": { type: "password" }
}
})
}