-
-
Notifications
You must be signed in to change notification settings - Fork 86
Front End Library available properties and methods
Update 2022-01-19: This page is now deprecated and outdated, it is only kept for historic reference. Please check out the more detailed information available in the Tech docs either here on GitHub pages or via the link in any uibuilder node.
NOTE that more and up-to-date details are available in the docs folder of the repository.
uibuilderfe.js (or uibuilderfe.min.js) exposes the following global object.
Note that you can use webpack or similar to bundle uibuilder with your own code.
uibuilder: The main global object containing the following...
-
.onChange(property, callbackFn)
- listen for changes to property and execute callback when it changes -
.get(property)
- Get any available property -
.set(property, value)
- Set any available property (can't overwrite internal properties) -
.msg
- Shortcut to get the latest value of msg. Equivalent to uibuilder.get('msg') -
.send(msg)
- Shortcut to send a msg back to Node-RED manually -
.sendCtrl(msg)
- Shortcut to send a control msg back to Node-RED manually (@since v0.4.8) -
.debug(true/false)
- Turn on/off debugging -
.uiDebug(type,msg)
- Utility function: Send debug msg to console (type=[log,info,warn,error,dir]) -
.me()
- Returns the self object if debugging otherwise just the current version string -
.autoSendReady(true/false)
- If true, sends "ready for content" ctrl msg on window.load If false, you will need to manually douibuilder.sendCtrl({'uibuilderCtrl':'ready for content', 'cacheControl':'REPLAY'})
(e.g. in an app.mounted event) @since v0.4.8a
All properties can be read using the .get()
method.
New properties can be added via .set()
method as long as the property name does not clash with anything internal.
All properties (including custom) can have change events associated with them by using the .onChange()
method.
-
.autoSendReady
- see.autoSendReady()
method -
.debug
- see.debug()
method, also see 'server connected' control msg from server
-
.allowScript
- Allow incoming msg to contain msg.script with JavaScript that will be automatically executed -
.allowStyle
- Allow incoming msg to contain msg.style with CSS that will be automatically executed -
.removeScript
- Delete msg.code after inserting to DOM if it exists on incoming msg -
.removeStyle
- Delete msg.style after inserting to DOM if it exists on incoming msg
-
.msg
- Copy of the last msg sent from Node-RED over Socket.IO -
.sentMsg
- Copy of the last msg sent by us to Node-RED (both data and control) -
.ctrlMsg
- Copy of the last control msg received by us from Node-RED (Types: ['shutdown','server connected']) -
.msgsReceived
- How many standard messages have we received -
.msgsSent
- How many messages have we sent -
.msgsSentCtrl
- How many control messages have we sent -
.msgsCtrl
- How many control messages have we received -
.ioConnected
- Is Socket.IO connected right now? (true/false)
You are not likely to need any of these, they are for internal use.
-
.version
- check the current version of the uibuilder code -
.ioChannels
- List of the channel names in use [uiBuilderControl, uiBuilderClient, uiBuilder] -
.retryMs
- starting retry ms period for manual socket reconnections workaround -
.retryFactor
- starting delay factor for subsequent reconnect attempts -
.ioNamespace
- Get the namespace from the current URL -
.ioPath
- make sure client uses Socket.IO version from the uibuilder module (using path) -
.ioTransport
- ['polling', 'websocket'] -
.timerid
- internal use only -
.events
- list of registered events
Please feel free to add comments to the page (clearly mark with your initials & please add a commit msg so we know what has changed). You can contact me in the Discourse forum, or raise an issue here in GitHub! I will make sure all comments & suggestions are represented here.
-
Walkthrough 🔗 Getting started
-
In Progress and To Do 🔗 What's coming up for uibuilder?
-
Awesome uibuilder Examples, tutorials, templates and references.
-
How To
- How to send data when a client connects or reloads the page
- Send messages to a specific client
- Cache & Replay Messages
- Cache without a helper node
- Use webpack to optimise front-end libraries and code
- How to contribute & coding standards
- How to use NGINX as a proxy for Node-RED
- How to manage packages manually
- How to upload a file from the browser to Node-RED
-
Vanilla HTML/JavaScript examples
-
VueJS general hints, tips and examples
- Load Vue (v2 or v3) components without a build step (modern browsers only)
- How to use webpack with VueJS (or other frameworks)
- Awesome VueJS - Tips, info & libraries for working with Vue
- Components that work
-
VueJS v3 hints, tips and examples
-
VueJS v2 hints, tips and examples
- Dynamically load .vue files without a build step (Vue v2)
- Really Simple Example (Quote of the Day)
- Example charts using Chartkick, Chart.js, Google
- Example Gauge using vue-svg-gauge
- Example charts using ApexCharts
- Example chart using Vue-ECharts
- Example: debug messages using uibuilder & Vue
- Example: knob/gauge widget for uibuilder & Vue
- Example: Embedded video player using VideoJS
- Simple Button Acknowledgement Example Thanks to ringmybell
- Using Vue-Router without a build step Thanks to AFelix
- Vue Canvas Knob Component Thanks to Klaus Zerbe
-
Examples for other frameworks (check version before trying)
- Basic jQuery example - Updated for uibuilder v6.1
- ReactJS with no build - updated for uibuilder v5/6
-
Examples for other frameworks (may not work, out-of-date)
-
Outdated Pages (Historic only)
- v1 Examples (these need updating to uibuilder v2/v3/v4/v5)