0.0.4 • Published 10 months ago
@flowfuse/node-red-dashboard-2-migration v0.0.4
Node-RED Dashboard 2.0 Migration Script
This module provides a script with which you can pass in a Dashboard 1.0 flow, and in return, you will receive a Dashboard 2.0 flow.
Please note that this script does not cover everything, see below for a list of currently supported nodes that can be migrated. The script will be improved over time, and we're open to pull requests to enhance it's functionality.
Supported Nodes
Nodes
ui_text- converted to Dashboard 2.0'sui-textui_form- converted to Dashboard 2.0'sui-formui_button- converted to Dashboard 2.0'sui-buttonui_dropdown- converted to Dashboard 2.0'sui-dropdownui_switch- converted to Dashboard 2.0'sui-switch.tooltipis not supported.decoupleis not supported.animateis not supported
ui_slider- converted to Dashboard 2.0'sui-sliderui_text_input- converted to Dashboard 2.0'sui-text-input.tooltipis not supported
ui_numeric- converted to Dashboard 2.0'sui-numeric-input
Config Nodes
ui_tab- converted to Dashboard 2.0'sui-pageui_group- converted to Dashboard 2.0'sui-group
Added
ui-base- Not included in a Dashboard 1.0flow.jsonexport, so we create a standard default in it's place.ui-theme- Not included in a Dashboard 1.0flow.jsonexport, so we create a standard default in it's place.
Not Yet Supported:
ui_date_picker- linkui_colour_picker- linkui_gauge- linkui_chart- linkui_audio- linkui_toast- linkui_control- linkui_template- link
Usage
Terminal
To run this module from the terminal, you can run:
cd path/to/your/node-red-dashboard-2-migration
node migrate path/to/your/flow.jsonThe script will then print to the terminal a valid flow.json which you can copy and paste into your Node-RED editor, via Node-RED's import functionality.
JavaScript
To run this module from within a js environment, you can run:
const d1flow = require('./path/to/your/flow.json')
const MigrateDashboard = require('node-red-dashboard-2-migration')
const d2flow = MigrateDashboard.migrate(d1flow)