mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
3f9a29730f
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.
37 lines
996 B
JavaScript
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" }
|
|
}
|
|
})
|
|
} |