diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 4225d8cbb..dc117d7a4 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -43,10 +43,11 @@ export default { text: 'Widgets', collapsed: false, items: [ - { - text: 'ui-button', - link: '/nodes/widgets/ui-button' - } + { text: 'ui-button', link: '/nodes/widgets/ui-button' }, + { text: 'ui-dropdown', link: '/nodes/widgets/ui-dropdown' }, + { text: 'ui-slider', link: '/nodes/widgets/ui-slider' }, + { text: 'ui-text-input', link: '/nodes/widgets/ui-text-input' }, + { text: 'ui-markdown', link: '/nodes/widgets/ui-markdown' }, ] } ] diff --git a/docs/assets/images/install-palette.png b/docs/assets/images/install-palette.png new file mode 100644 index 000000000..047b2037a Binary files /dev/null and b/docs/assets/images/install-palette.png differ diff --git a/docs/assets/images/node-examples/ui-button.png b/docs/assets/images/node-examples/ui-button.png new file mode 100644 index 000000000..18f854bd0 Binary files /dev/null and b/docs/assets/images/node-examples/ui-button.png differ diff --git a/docs/assets/images/node-examples/ui-dropdown.png b/docs/assets/images/node-examples/ui-dropdown.png new file mode 100644 index 000000000..b3b5b0046 Binary files /dev/null and b/docs/assets/images/node-examples/ui-dropdown.png differ diff --git a/docs/assets/images/node-examples/ui-markdown.png b/docs/assets/images/node-examples/ui-markdown.png new file mode 100644 index 000000000..a04f63015 Binary files /dev/null and b/docs/assets/images/node-examples/ui-markdown.png differ diff --git a/docs/assets/images/node-examples/ui-slider.png b/docs/assets/images/node-examples/ui-slider.png new file mode 100644 index 000000000..54e8e9b31 Binary files /dev/null and b/docs/assets/images/node-examples/ui-slider.png differ diff --git a/docs/assets/images/node-examples/ui-text-input.png b/docs/assets/images/node-examples/ui-text-input.png new file mode 100644 index 000000000..71cb0dfb4 Binary files /dev/null and b/docs/assets/images/node-examples/ui-text-input.png differ diff --git a/docs/contributing/guides/layouts.md b/docs/contributing/guides/layouts.md index f10cb2c35..583102328 100644 --- a/docs/contributing/guides/layouts.md +++ b/docs/contributing/guides/layouts.md @@ -19,7 +19,7 @@ This list of layouts will grow in time, and for now, just includes a _very_ basi This is a simple flexbox layout, with a single row of widgets, and our only functional layout currently. It will automatically move widgets to the next row if they don't fit within a given screen width. The height of each row is determined by the tallest widget in that row. -![Flex Layout](../../assets/images/layout-eg-flex.png) +![Flex Layout](../../assets/images/layout-eg-flex.png){data-zoomable} *An example UI rendered using the "Flex" Layout Manager* Currently, each widget is rendered directly inside a `v-card` (from Vuetify), however, plans for widgets to be grouped, as per Dashboard 1.0 are on the horizon, as well as controlling widget width and height. diff --git a/docs/getting-started.md b/docs/getting-started.md index 4de4dae19..c538719ec 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -2,10 +2,22 @@ ## Installation -Currently this project is in a pre-release state, and is not yet available on the [Node-RED flows library](https://flows.nodered.org/). -If you would like to run this set of nodes locally, and specifically to help contribute to the development efforts, you can read the Contributing documentation. +FlowForge's Node-RED Dashbaord 2.0 is available in the Node-RED Palette Manager. To install it: -## How it Works +- Open the menu in the top-right of Node-RED +- Click "Manage Palette" +- Switch to the "Install" tab +- Search `node-red-dashboard` +- Install the `@flowforge/node-red-dashboard` package (not `node-red-dashboard`) -If you'd like to learn more about the project, and how it works, you can read the various Guides available in the left navigation, under the "Contributing" section. \ No newline at end of file +![Install via "Manage Palette"](../../assets/images/install-palette.png){data-zoomable} +*Screenshot showing the nodes available in the Node-RED Palette Manager* + +The nodes will then be available in your editor for you to get started. + +If you want to use `npm` to install your nodes, you can instead [follow these instructions](https://nodered.org/docs/user-guide/runtime/adding-nodes) + +## Contributing + +If you would like to run this set of nodes locally, and specifically to help contribute to the development efforts, you can read the [Contributing](./contributing/index.md) documentation. \ No newline at end of file diff --git a/docs/nodes/config/ui-theme.md b/docs/nodes/config/ui-theme.md index 5761e0d06..266e5c181 100644 --- a/docs/nodes/config/ui-theme.md +++ b/docs/nodes/config/ui-theme.md @@ -20,10 +20,10 @@ Each page can be assigned a theme, which will be used to render the page. The th ## Example -Example Config of ui-theme in Node-RED: +Example Config of `ui-theme` in Node-RED: -Example config for a Theme +Example config for a Theme Resulting Dashboard with the theme applied: -![Resulting Dashboard with applied theme](/images/theme-example.png "Resulting Dashboard with applied theme") +![Resulting Dashboard with applied theme](/images/theme-example.png "Resulting Dashboard with applied theme"){data-zoomable} diff --git a/docs/nodes/widgets/ui-button.md b/docs/nodes/widgets/ui-button.md index 0dbf86e03..cd921c621 100644 --- a/docs/nodes/widgets/ui-button.md +++ b/docs/nodes/widgets/ui-button.md @@ -1,11 +1,12 @@ --- props: - Page: Defines with page of the UI Dashboard this widget will render on + Group: Defines which group of the UI Dashboard this widget will render in. + Size: Controls the width of the button with respect to the parent group. Maximum value is the width of the group. Label: The text shown within the button. controls: enabled: example: true | false - description: Lorum Ipsum + description: Allow control over whether or not the button is clickable. --- + +# dropdown `ui-dropdown` + +Adds a dropdown to your dashboard that will emit values in Node-RED under `msg.payload` anytime it's value is changed. + +## Properties + + + +## Example + +![Example of a dropdown](../../assets/images/node-examples/ui-dropdown.png "Example of a dropdown"){data-zoomable} +*Example of a rendered dropdown in a Dashboard.* diff --git a/docs/nodes/widgets/ui-markdown.md b/docs/nodes/widgets/ui-markdown.md index 825017189..3c8393f1e 100644 --- a/docs/nodes/widgets/ui-markdown.md +++ b/docs/nodes/widgets/ui-markdown.md @@ -1,9 +1,7 @@ -https://flowforge.com/handbook/development/markdown-how-to/#markdown-how-to - --- props: - Page: Defines with page of the UI Dashboard this widget will render on - Contents: The markdown to be passed to the UI and rendered + Group: Defines which group of the UI Dashboard this widget will render in. + Content: The markdown to be passed to the UI and rendered --- + +# Slider `ui-slider` + +Adds a slider to your dashboard that will emit values in Node-RED under `msg.payload` anytime it's value is changed. + +## Properties + + + +## Example + +![Example of a slider](../../assets/images/node-examples/ui-slider.png "Example of a slider"){data-zoomable} +*Example of a rendered slider in a Dashboard.* diff --git a/docs/nodes/widgets/ui-text-input.md b/docs/nodes/widgets/ui-text-input.md new file mode 100644 index 000000000..7896f0cd5 --- /dev/null +++ b/docs/nodes/widgets/ui-text-input.md @@ -0,0 +1,24 @@ +--- +props: + Group: Defines which group of the UI Dashboard this widget will render in. + Size: Controls the width of the button with respect to the parent group. Maximum value is the width of the group. + Label: The text shown within the button. + Mode: The type of HTML input to display. Options - text | password | email | number | tel | color | date | time | week | month | datetime-local + Passthrough: If this node receives a msg in Node-RED, should it be passed through to the output as if a new value was inserted to the input? +--- + + + +# Button `ui-text-input` + +Adds a single text input row to your dashboard, with a configurable "type" (text, password, etc). + +## Properties + + + +## Example + +![Example of a Button](../../assets/images/node-examples/ui-text-input.png "Example of a Button"){data-zoomable} +*Example of a rendered button in a Dashboard.* diff --git a/nodes/widgets/ui_text_input.html b/nodes/widgets/ui_text_input.html index fcdb716df..79484ae97 100644 --- a/nodes/widgets/ui_text_input.html +++ b/nodes/widgets/ui_text_input.html @@ -16,7 +16,9 @@ return valid; } }, - height: {value: 0} + height: { value: 0 }, + mode: { value: 'text', required: true}, + passthru: { value: true } }, inputs: 1, outputs: 1, @@ -52,33 +54,27 @@ -
- - -
- - - - + - - +
- +
-
+
diff --git a/nodes/widgets/ui_text_input.js b/nodes/widgets/ui_text_input.js index 69e8274ed..8dae867b8 100644 --- a/nodes/widgets/ui_text_input.js +++ b/nodes/widgets/ui_text_input.js @@ -14,7 +14,9 @@ module.exports = function(RED) { const evts = { onChange: true, onInput: function (msg, send) { - send(msg) + if (config.passthru) { + send(msg) + } } } diff --git a/ui/src/widgets/ui-text-input/UITextInput.vue b/ui/src/widgets/ui-text-input/UITextInput.vue index afe802d5f..b56752583 100644 --- a/ui/src/widgets/ui-text-input/UITextInput.vue +++ b/ui/src/widgets/ui-text-input/UITextInput.vue @@ -1,7 +1,7 @@