diff --git a/.github/no-response.yml b/.github/no-response.yml new file mode 100644 index 0000000..a393986 --- /dev/null +++ b/.github/no-response.yml @@ -0,0 +1,13 @@ +# Configuration for probot-no-response - https://github.com/probot/no-response + +# Number of days of inactivity before an Issue is closed for lack of response +daysUntilClose: 14 +# Label requiring a response +responseRequiredLabel: needs-more-info +# Comment to post when closing an Issue for lack of response. Set to `false` to disable +closeComment: > + This issue has been automatically closed because there has been no response + to our request for more information from the original author. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so + that we can investigate further. diff --git a/.gitignore b/.gitignore index df33556..8cfcfe9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,15 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release dist/* lib/* -build/* - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git node_modules -.config.json -.flows.json.backup +logs +.config.* +.electronflow* .sessions.json *darwin-x64* *linux-x64* *win32-x64* -*.back +*.back* +*.log +*lock* +*error* diff --git a/.travis.bak b/.travis.bak new file mode 100644 index 0000000..8dc0cb9 --- /dev/null +++ b/.travis.bak @@ -0,0 +1,41 @@ + +matrix: + include: + - os: osx + osx_image: xcode10.2 + language: node_js + node_js: "12" + env: + - ELECTRON_CACHE=$HOME/.cache/electron + - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder + + - os: linux + services: docker + language: generic + +cache: + directories: + - node_modules + - $HOME/.cache/electron + - $HOME/.cache/electron-builder + +script: + - | + npm i -g yarn + if [ "$TRAVIS_OS_NAME" == "linux" ]; then + docker run --rm \ + --env-file <(env | grep -vE '\r|\n' | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \ + -v ${PWD}:/project \ + -v ~/.cache/electron:/root/.cache/electron \ + -v ~/.cache/electron-builder:/root/.cache/electron-builder \ + electronuserland/builder:wine \ + /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn release --linux --win" + else + yarn release + fi +before_cache: + - rm -rf $HOME/.cache/electron-builder/wine + +branches: + except: + - "/^v\\d+\\.\\d+\\.\\d+$/" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5c152d9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Use OSX as env to build in - language: objective-c - cache: - directories: - - node_modules - env: - # Node in order to install it by running the command individually, here to specify the version - #- NODE_VERSION="4.6" - before_install: - # Install brew -> wine and makensis - - brew update - - brew install libusb - - brew install wine - - wine --version - - brew install makensis - # Install the nvm. Nvm is not included by default in OS X environment of Travis - - git clone https://github.com/creationix/nvm.git /tmp/.nvm - - source /tmp/.nvm/nvm.sh - - nvm install 4.6 - - nvm use --delete-prefix 4.6 - - node --version - - npm -v - - npm install -g electron-packager - - npm install -g appdmg - install: - - npm install - script: - - npm run build - #deploy: - # skip_cleanup: true diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..364397c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Electron Main", + "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", + "program": "${workspaceFolder}/main.js" + } + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d9a10c0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index b823bcc..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,39 +0,0 @@ -CC0 1.0 Universal -================== - -Statement of Purpose ---------------------- - -The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. --------------------------------- -A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: - -i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; -ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; -iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; -v. rights protecting the extraction, dissemination, use and reuse of data in a Work; -vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and -vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. - -2. Waiver. ------------ -To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. ----------------------------- -Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. - -4. Limitations and Disclaimers. --------------------------------- - -a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. -b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. -c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. -d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. diff --git a/README.md b/README.md index 1255463..4a7e52a 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,111 @@ -# electron-node-red +# Electron Node-RED -This is an Electron template to embed Node-RED with a Dashboard generated by node-red-dashboard. +[](https://nodered.org) +[](https://badge.fury.io/gh/dceejay%2Felectron-node-red) +[](https://github.com/dceejay/electron-node-red/blob/master/LICENSE) -You can base off this model and update the package.json file to include your own required dependencies. +This is an Electron template to embed [Node-RED](https://nodered.org) with an existing Node-RED project to create a native application. -## To Use +This is not intended to be a useful tool as-is, but as a base for you to create your own versions. You will need to edit the `main.js` to suit your application and update the `package.json` file to include your own required nodes and dependencies. -To clone and run this repository you'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer. From your command line: +There are several simple switches that can be set in the `NRelectron` section of +the `package.json` file. More significant modifications will require modification +of the `main.js` file. Have fun. + +## Wrapping an existing Node-RED project + +The `merger.js` utility should be run from within this projects directory and can be pointed at +an existing Node-RED project directory. It will try to copy over and package up the +relevant files into this project ready to install and build - so the simple flow would be ```bash -# Clone this repository -git clone https://github.com/dceejay/electron-node-red.git -# Go into the repository -cd electron-node-red -# Install dependencies and run the app -npm install && npm run clean && npm start +./merger.js {path to my Node-RED project directory} +yarn +yarn start ``` -## TL:DR - building runtimes +This uses the `package-template.json` file as the main electron setup - so you should edit any +build parameters, product name, whether you want the app version to be editable, run in kiosk mode, etc in the `NRelectron` section before running. -On OSX you can run `./buildall` to build binaries of "everything"... maybe... +The app name, version and description are picked up from the package.json file of the original project. -Run `npm run pack` to create packages for all platforms - these are the files required to run, they are not binary installers. +When running using yarn start - the flow file is picked from the current directory. When running as an app (but only if editable), then the flow file is copied into the users `.node-red` directory and is read and written from there. The default name can be changed in the package.json file if required. -Builds are created in the `build` directory. Runtimes are created in the `../electron-bin` directory. +**NOTE**: Currently the settings are set around line 110 of the `main.js` file. If you do use any +custom settings then currently you will need to modify this manually. -**Note**: this was written to work on a Mac... other tools may/will be needed on other platforms. +## Configuring the project for building -## Packaging your application +This project uses the **electron-builder** project to help build native versions +of Node-RED applications, so please read and become familiar with their +[documentation](https://www.electron.build/) as some basic knowledge is assumed. -If you want to distribute executables of this project, the easiest way is to use electron-packager: +As a pre-req, as well as a recent version of node.js, you will need the **yarn** install tool. +```bash +# Clone this repository +git clone https://github.com/dceejay/electron-node-red.git +# Go into the repository +cd electron-node-red +# Install the yarn install tool globally +sudo npm i -g yarn +# Install project dependencies +yarn ``` -sudo npm install -g electron-packager -# build for OSX 64 bits -electron-packager . Node-RED --icon=nodered.icns --platform=darwin --arch=x64 --out=build --overwrite +## Building local runtime -# build for Windows 64 bits -electron-packager . Node-RED --icon=nodered.icns --platform=win32 --arch=x64 --out=build --asar=true --overwrite --win32metadata.CompanyName='IBM Corp.' --win32metadata.ProductName='Node-RED Electron' +You should then be able to run -# build for Linux 64 bits -electron-packager . Node-RED --icon=nodered.icns --platform=linux --arch=x64 --out=build --overwrite +```bash +yarn && yarn dist ``` -Learn more about Electron and its API in the [documentation](http://electron.atom.io/docs/latest). - - -### To package as a dmg - -`npm run build:osx` - -look at `https://github.com/LinusU/node-appdmg` +to create a runtime for your local platform. +However - there may be some errors. If so they are usually fairly self explanatory, +and may just require installation of another **npm** or **brew** or **apt** package, +then retry the command. - sudo npm install -g appdmg +Runtimes are created in the `dist` directory under the `electron-node-red` project. - appdmg appdmg.json ~/Desktop/NodeRED.dmg +### Building for other platforms +Generally you can just add the required parameter to the command -### To package as a deb - -`npm run build:linux64` or `npm run build:linux32` - for Intel Linux +```bash +yarn && yarn dist -w // for windows (but use multi-platform builder below for building on Mac Catalina) +yarn && yarn dist -l // for linux +yarn && yarn dist -m // for mac +``` -Look at `https://github.com/jordansissel/fpm` +These will generally fail the first time through, and you will need to install some extra library in order to make it +complete successfully. - fpm -s dir -t deb -f -n node-red-electron -v 0.16.2 -m your-email@example.com -a i386 Node-RED-linux-ia32/ - fpm -s dir -t deb -f -n node-red-electron -v 0.16.2 -m your-email@example.com -a x86_64 Node-RED-linux-x64/ +The defaults are to build a `.msi` for Windows, a `.dmg` for Mac, and both a `.deb` and `.rpm` for Linux. +These can be changed by editing the build section of the `package.json` file, see the +[electron-builder config docs](https://www.electron.build/configuration/configuration) for more information. -Use **sudo dpkg -i ...*** to install the correct deb for your architecture. +## Building multi platform using Docker -Use `Node-RED` command to run. Flows are stored in `~/.node-red`. +Electron-builder has a pre-configured Docker image that can help you build cross platform +images if you like Docker - again read [their docs](https://www.electron.build/multi-platform-build#build-electron-app-using-docker-on-a-local-machine). +This is very useful if you need to build for Windows on a Mac as the electron-builder invokes **wine** which is only 32-bit and so can't be run under Catalina. -### To package as an exe +## Developing and Testing - Running locally -`npm run build:win32` - to build for 32-bit Windows. +While developing and testing you can just run your app locally by running -`npm run build:win64` - to build for 64-bit Windows. +```bash +yarn start +``` -**Note**: This project was built to run on Mac OSX - To build for windows on other platforms you may need to use other tools. +from within the project folder. +The initial flow file is named `electronflow.json` along with it's credentials file +`electronflow_cred.json`. Just copy your existing flow in instead. -## License [CC0 (Public Domain)](LICENSE.md) +The default is to start on the dashboard page - as this is intended to be just an application - without the Node-RED editor exposed to the end user, but there are some simple flags to +to configure this within the package.json or at the top of main.js. -## See also - - **Stand-alone Starter Project** - https://github.com/dceejay/node-red-project-starter - - **Bluemix Starter Project** - https://github.com/dceejay/node-red-bluemix-starter +--- diff --git a/afterinst.sh b/afterinst.sh deleted file mode 100755 index 2652b72..0000000 --- a/afterinst.sh +++ /dev/null @@ -1 +0,0 @@ -ln -s /opt/node-red/Node-RED /usr/bin/Node-RED diff --git a/appbkg.png b/appbkg.png deleted file mode 100644 index 6063be1..0000000 Binary files a/appbkg.png and /dev/null differ diff --git a/appdmg.json b/appdmg.json deleted file mode 100644 index 53ee667..0000000 --- a/appdmg.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Node-RED Electron installer", - "icon": "nodered.icns", - "background": "appbkg.png", - "icon-size": 80, - "contents": [ - { "x": 448, "y": 344, "type": "link", "path": "/Applications" }, - { "x": 192, "y": 344, "type": "file", "path": "build/Node-RED-darwin-x64/Node-RED.app" } - ] -} diff --git a/build/background.png b/build/background.png new file mode 100644 index 0000000..0719272 Binary files /dev/null and b/build/background.png differ diff --git a/nodered.icns b/build/icon.icns similarity index 100% rename from nodered.icns rename to build/icon.icns diff --git a/build/icon.ico b/build/icon.ico new file mode 100644 index 0000000..46a0e49 Binary files /dev/null and b/build/icon.ico differ diff --git a/build/icon.png b/build/icon.png new file mode 100644 index 0000000..3e95fbb Binary files /dev/null and b/build/icon.png differ diff --git a/buildall b/buildall deleted file mode 100755 index 5e0170e..0000000 --- a/buildall +++ /dev/null @@ -1,17 +0,0 @@ -npm i -#cd node_modules/electron-winstaller -#npm i is-property -#cd ../.. -rm -rf node_modules/node-red/node_modules/node-red-node-serialport node_modules/node-red/node_modules/node-red-node-feedparser node_modules/node-red/node_modules/node-red-node-email -./node_modules/.bin/electron-rebuild -npm run clean -npm run build:osx -rm -rf build/ -npm run build:linux32 -rm -rf build/ -npm run build:linux64 -rm -rf build/ -npm run build:win32 -rm -rf build/ ../electron-bin/*.nupkg ../electron-bin/RELEASES -npm run build:win64 -rm -rf build/ ../electron-bin/*.nu* ../electron-bin/RELEASES diff --git a/console.htm b/console.htm new file mode 100644 index 0000000..3157013 --- /dev/null +++ b/console.htm @@ -0,0 +1,40 @@ + + +
+ + +On the right you will see a graph and a chart logging data from the sliders underneath.
", + "storeOutMessages": false, + "fwdInMessages": false, + "x": 100, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "9f19ee5c.beaef", + "type": "ui_chart", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "bbdf3e02.e8fee", + "order": 1, + "width": "0", + "height": "0", + "label": "Chart Title", + "chartType": "line", + "xformat": "HH:mm:ss", + "interpolate": "basis", + "nodata": "No Data", + "dot": false, + "ymin": "0", + "ymax": "100", + "removeOlder": 1, + "removeOlderPoints": "", + "removeOlderUnit": "60", + "cutout": "", + "useOneColor": false, + "useUTC": false, + "colors": [ + "#1f77b4", + "#aec7e8", + "#ff7f0e", + "#2ca02c", + "#98df8a", + "#d62728", + "#ff9896", + "#9467bd", + "#c5b0d5" + ], + "outputs": 1, + "x": 290, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "799d9318.fd385c", + "type": "ui_gauge", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "30e652f.d9de3ae", + "order": 2, + "width": "", + "height": "", + "gtype": "gage", + "title": "Gauge Title", + "label": "gauge", + "format": "{{value}}", + "min": 0, + "max": "100", + "colors": [ + "#00b500", + "#e6e600", + "#ca3838" + ], + "seg1": "", + "seg2": "", + "x": 290, + "y": 140, + "wires": [] + }, + { + "id": "6f18b200.666a4", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "87356b62.92e3d8", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "press to talk", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "fa-volume-up", + "payload": "Hello to Jason Isaacs", + "payloadType": "str", + "topic": "", + "x": 110, + "y": 300, + "wires": [ + [ + "f897d7c2.467a58" + ] + ] + }, + { + "id": "f897d7c2.467a58", + "type": "ui_audio", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "30e652f.d9de3ae", + "voice": "0", + "x": 280, + "y": 300, + "wires": [] + }, + { + "id": "da0f7e67.0d38a", + "type": "ui_slider", + "z": "41f61d2.fbe09e4", + "name": "", + "label": "slider", + "group": "30e652f.d9de3ae", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, + "topic": "", + "min": 0, + "max": "100", + "step": 1, + "x": 90, + "y": 140, + "wires": [ + [ + "799d9318.fd385c" + ] + ] + }, + { + "id": "eabf2bd7.f4e0c8", + "type": "ui_slider", + "z": "41f61d2.fbe09e4", + "name": "", + "label": "slider", + "group": "bbdf3e02.e8fee", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, + "topic": "", + "min": 0, + "max": "100", + "step": 1, + "x": 90, + "y": 200, + "wires": [ + [ + "9f19ee5c.beaef" + ] + ] + }, + { + "id": "45508d88.744a54", + "type": "function", + "z": "41f61d2.fbe09e4", + "name": "", + "func": "// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Jason\", icon:\"male\", url:\"IBM link\"};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 480, + "wires": [ + [ + "576d953b.3e57dc", + "1bc50b6.cfc1cf5" + ] + ] + }, + { + "id": "6ca8cfc2.e0bce", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "c75ad4f0.0cede8", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "Where's Jason", + "color": "", + "bgcolor": "#910000", + "icon": "fa-male", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 120, + "y": 480, + "wires": [ + [ + "45508d88.744a54" + ] + ] + }, + { + "id": "576d953b.3e57dc", + "type": "worldmap-tracks", + "z": "41f61d2.fbe09e4", + "name": "", + "depth": 20, + "layer": "combined", + "x": 470, + "y": 440, + "wires": [ + [ + "1bc50b6.cfc1cf5" + ] + ] + }, + { + "id": "814a9c85.e6fb8", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "c75ad4f0.0cede8", + "order": 3, + "width": 0, + "height": 0, + "passthru": false, + "label": "Remove Jason", + "tooltip": "", + "color": "", + "bgcolor": "#910000", + "icon": "fa-male", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 110, + "y": 420, + "wires": [ + [ + "b9d3d78b.360d38" + ] + ] + }, + { + "id": "b9d3d78b.360d38", + "type": "function", + "z": "41f61d2.fbe09e4", + "name": "", + "func": "// create random position\nmsg.payload={name:\"Jason\", deleted:true};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 420, + "wires": [ + [ + "576d953b.3e57dc" + ] + ] + }, + { + "id": "36c05d33.b783b2", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "c75ad4f0.0cede8", + "order": 4, + "width": 0, + "height": 0, + "passthru": false, + "label": "Delete Track", + "tooltip": "", + "color": "", + "bgcolor": "#910000", + "icon": "fa-male", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 110, + "y": 360, + "wires": [ + [ + "108b8604.f5bb8a" + ] + ] + }, + { + "id": "108b8604.f5bb8a", + "type": "function", + "z": "41f61d2.fbe09e4", + "name": "", + "func": "// create random position\nmsg.payload={name:\"Jason_\", deleted:true};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 360, + "wires": [ + [ + "1bc50b6.cfc1cf5" + ] + ] + }, + { + "id": "e90f82d8.46a78", + "type": "ui_ui_control", + "z": "41f61d2.fbe09e4", + "name": "", + "events": "all", + "x": 340, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "c920e625.e95578", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "Close Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"close\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 130, + "y": 560, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "48892dbf.1d3e64", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 5, + "width": 0, + "height": 0, + "passthru": false, + "label": "Show Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"show\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 130, + "y": 640, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "e44dda45.d85038", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 4, + "width": 0, + "height": 0, + "passthru": false, + "label": "Hide Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"hide\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 120, + "y": 680, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "1ffc9864.56de48", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 3, + "width": 0, + "height": 0, + "passthru": false, + "label": "Open Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"open\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 130, + "y": 600, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "1bc50b6.cfc1cf5", + "type": "ui_worldmap", + "z": "41f61d2.fbe09e4", + "group": "c75ad4f0.0cede8", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "lat": "", + "lon": "", + "zoom": "", + "layer": "", + "cluster": "", + "maxage": "", + "usermenu": "hide", + "layers": "hide", + "panit": "false", + "panlock": "false", + "zoomlock": "false", + "hiderightclick": "true", + "coords": "none", + "showgrid": "false", + "path": "/worldmap", + "x": 480, + "y": 360, + "wires": [] + } +] \ No newline at end of file diff --git a/electronflow_cred.json b/electronflow_cred.json new file mode 100644 index 0000000..4d5996a --- /dev/null +++ b/electronflow_cred.json @@ -0,0 +1 @@ +{"$":"8dbcfcd6d9f25932aa00994065774d5ctxk="} \ No newline at end of file diff --git a/example/electronflow.json b/example/electronflow.json new file mode 100644 index 0000000..87986e8 --- /dev/null +++ b/example/electronflow.json @@ -0,0 +1,615 @@ +[ + { + "id": "41f61d2.fbe09e4", + "type": "tab", + "label": "Flow 1" + }, + { + "id": "52a903f3.ad56fc", + "type": "ui_tab", + "z": "41f61d2.fbe09e4", + "name": "My Simple Dashboard", + "icon": "dashboard", + "disabled": false, + "hidden": false + }, + { + "id": "30e652f.d9de3ae", + "type": "ui_group", + "z": "41f61d2.fbe09e4", + "name": "Panel 2", + "tab": "52a903f3.ad56fc", + "order": 4, + "disp": true, + "width": "6" + }, + { + "id": "a8ecb9.c60f4348", + "type": "ui_group", + "z": "41f61d2.fbe09e4", + "name": "Introduction", + "tab": "52a903f3.ad56fc", + "order": 1, + "disp": false, + "width": "3" + }, + { + "id": "bbdf3e02.e8fee", + "type": "ui_group", + "z": "41f61d2.fbe09e4", + "name": "Panel 1", + "tab": "52a903f3.ad56fc", + "order": 2, + "disp": true, + "width": "6" + }, + { + "id": "d9ba26fa.6d2b18", + "type": "ui_base", + "theme": { + "name": "theme-light", + "lightTheme": { + "default": "#0094CE", + "baseColor": "#8e0d17", + "baseFont": "Copperplate,Copperplate Gothic Light,fantasy", + "edited": true, + "reset": false + }, + "darkTheme": { + "default": "#097479", + "baseColor": "#097479", + "baseFont": "Helvetica Neue", + "edited": false + }, + "customTheme": { + "name": "Untitled Theme 1", + "default": "#4B7930", + "baseColor": "#4B7930", + "baseFont": "Helvetica Neue" + }, + "themeState": { + "base-color": { + "default": "#0094CE", + "value": "#d80005", + "edited": true + }, + "page-titlebar-backgroundColor": { + "value": "#8e0d17", + "edited": false + }, + "page-backgroundColor": { + "value": "#fafafa", + "edited": false + }, + "page-sidebar-backgroundColor": { + "value": "#333333", + "edited": false + }, + "group-textColor": { + "value": "#d41322", + "edited": false + }, + "group-borderColor": { + "value": "#ffffff", + "edited": false + }, + "group-backgroundColor": { + "value": "#ffffff", + "edited": false + }, + "widget-textColor": { + "value": "#111111", + "edited": false + }, + "widget-backgroundColor": { + "value": "#8e0d17", + "edited": false + }, + "widget-borderColor": { + "value": "#ffffff", + "edited": false + }, + "base-font": { + "value": "Copperplate,Copperplate Gothic Light,fantasy" + } + }, + "angularTheme": { + "primary": "indigo", + "accents": "blue", + "warn": "red", + "background": "grey" + } + }, + "site": { + "name": "Node-RED Dashboard", + "hideToolbar": "false", + "allowSwipe": "false", + "dateFormat": "DD/MM/YYYY", + "sizes": { + "sx": 48, + "sy": 48, + "gx": 6, + "gy": 6, + "cx": 6, + "cy": 6, + "px": 0, + "py": 0 + } + } + }, + { + "id": "87356b62.92e3d8", + "type": "ui_group", + "z": "", + "name": "Text to Speech", + "tab": "52a903f3.ad56fc", + "order": 5, + "disp": true, + "width": "6", + "collapse": false + }, + { + "id": "c75ad4f0.0cede8", + "type": "ui_group", + "z": "", + "name": "Map", + "tab": "52a903f3.ad56fc", + "order": 3, + "disp": true, + "width": "6", + "collapse": true + }, + { + "id": "189cf871.681118", + "type": "ui_template", + "z": "41f61d2.fbe09e4", + "group": "a8ecb9.c60f4348", + "name": "Welcome", + "order": 1, + "width": "3", + "height": "9", + "format": "On the right you will see a graph and a chart logging data from the sliders underneath.
", + "storeOutMessages": false, + "fwdInMessages": false, + "x": 93, + "y": 45, + "wires": [ + [] + ] + }, + { + "id": "9f19ee5c.beaef", + "type": "ui_chart", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "bbdf3e02.e8fee", + "order": 1, + "width": "0", + "height": "0", + "label": "Chart Title", + "chartType": "line", + "xformat": "HH:mm:ss", + "interpolate": "basis", + "nodata": "No Data", + "dot": false, + "ymin": "0", + "ymax": "100", + "removeOlder": 1, + "removeOlderPoints": "", + "removeOlderUnit": "60", + "cutout": "", + "useOneColor": false, + "useUTC": false, + "colors": [ + "#1f77b4", + "#aec7e8", + "#ff7f0e", + "#2ca02c", + "#98df8a", + "#d62728", + "#ff9896", + "#9467bd", + "#c5b0d5" + ], + "outputs": 1, + "x": 290, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "799d9318.fd385c", + "type": "ui_gauge", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "30e652f.d9de3ae", + "order": 2, + "width": "", + "height": "", + "gtype": "gage", + "title": "Gauge Title", + "label": "gauge", + "format": "{{value}}", + "min": 0, + "max": "100", + "colors": [ + "#00b500", + "#e6e600", + "#ca3838" + ], + "seg1": "", + "seg2": "", + "x": 290, + "y": 140, + "wires": [] + }, + { + "id": "6f18b200.666a4", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "87356b62.92e3d8", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "press to talk", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "fa-volume-up", + "payload": "Hello to Jason Isaacs", + "payloadType": "str", + "topic": "", + "x": 110, + "y": 300, + "wires": [ + [ + "f897d7c2.467a58" + ] + ] + }, + { + "id": "f897d7c2.467a58", + "type": "ui_audio", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "30e652f.d9de3ae", + "voice": "0", + "x": 280, + "y": 300, + "wires": [] + }, + { + "id": "da0f7e67.0d38a", + "type": "ui_slider", + "z": "41f61d2.fbe09e4", + "name": "", + "label": "slider", + "group": "30e652f.d9de3ae", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, + "topic": "", + "min": 0, + "max": "100", + "step": 1, + "x": 90, + "y": 140, + "wires": [ + [ + "799d9318.fd385c" + ] + ] + }, + { + "id": "eabf2bd7.f4e0c8", + "type": "ui_slider", + "z": "41f61d2.fbe09e4", + "name": "", + "label": "slider", + "group": "bbdf3e02.e8fee", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, + "topic": "", + "min": 0, + "max": "100", + "step": 1, + "x": 90, + "y": 200, + "wires": [ + [ + "9f19ee5c.beaef" + ] + ] + }, + { + "id": "45508d88.744a54", + "type": "function", + "z": "41f61d2.fbe09e4", + "name": "", + "func": "// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Jason\", icon:\"male\", url:\"IBM link\"};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 480, + "wires": [ + [ + "576d953b.3e57dc", + "1bc50b6.cfc1cf5" + ] + ] + }, + { + "id": "6ca8cfc2.e0bce", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "c75ad4f0.0cede8", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "Where's Jason", + "color": "", + "bgcolor": "#910000", + "icon": "fa-male", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 120, + "y": 480, + "wires": [ + [ + "45508d88.744a54" + ] + ] + }, + { + "id": "576d953b.3e57dc", + "type": "worldmap-tracks", + "z": "41f61d2.fbe09e4", + "name": "", + "depth": 20, + "layer": "combined", + "x": 470, + "y": 440, + "wires": [ + [ + "1bc50b6.cfc1cf5" + ] + ] + }, + { + "id": "814a9c85.e6fb8", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "c75ad4f0.0cede8", + "order": 3, + "width": 0, + "height": 0, + "passthru": false, + "label": "Remove Jason", + "tooltip": "", + "color": "", + "bgcolor": "#910000", + "icon": "fa-male", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 110, + "y": 420, + "wires": [ + [ + "b9d3d78b.360d38" + ] + ] + }, + { + "id": "b9d3d78b.360d38", + "type": "function", + "z": "41f61d2.fbe09e4", + "name": "", + "func": "// create random position\nmsg.payload={name:\"Jason\", deleted:true};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 420, + "wires": [ + [ + "576d953b.3e57dc" + ] + ] + }, + { + "id": "36c05d33.b783b2", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "c75ad4f0.0cede8", + "order": 4, + "width": 0, + "height": 0, + "passthru": false, + "label": "Delete Track", + "tooltip": "", + "color": "", + "bgcolor": "#910000", + "icon": "fa-male", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 110, + "y": 360, + "wires": [ + [ + "108b8604.f5bb8a" + ] + ] + }, + { + "id": "108b8604.f5bb8a", + "type": "function", + "z": "41f61d2.fbe09e4", + "name": "", + "func": "// create random position\nmsg.payload={name:\"Jason_\", deleted:true};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 360, + "wires": [ + [ + "1bc50b6.cfc1cf5" + ] + ] + }, + { + "id": "e90f82d8.46a78", + "type": "ui_ui_control", + "z": "41f61d2.fbe09e4", + "name": "", + "events": "all", + "x": 340, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "c920e625.e95578", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "Close Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"close\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 130, + "y": 560, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "48892dbf.1d3e64", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 5, + "width": 0, + "height": 0, + "passthru": false, + "label": "Show Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"show\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 130, + "y": 640, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "e44dda45.d85038", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 4, + "width": 0, + "height": 0, + "passthru": false, + "label": "Hide Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"hide\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 120, + "y": 680, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "1ffc9864.56de48", + "type": "ui_button", + "z": "41f61d2.fbe09e4", + "name": "", + "group": "a8ecb9.c60f4348", + "order": 3, + "width": 0, + "height": 0, + "passthru": false, + "label": "Open Map", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "{\"group\":{\"open\":[\"My_Simple_Dashboard_Map\"]}}", + "payloadType": "json", + "topic": "", + "x": 130, + "y": 600, + "wires": [ + [ + "e90f82d8.46a78" + ] + ] + }, + { + "id": "1bc50b6.cfc1cf5", + "type": "ui_worldmap", + "z": "41f61d2.fbe09e4", + "group": "c75ad4f0.0cede8", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "lat": "", + "lon": "", + "zoom": "", + "layer": "", + "cluster": "", + "maxage": "", + "usermenu": "hide", + "layers": "hide", + "panit": "false", + "panlock": "false", + "zoomlock": "false", + "hiderightclick": "true", + "coords": "none", + "showgrid": "false", + "path": "/worldmap", + "x": 480, + "y": 360, + "wires": [] + } +] \ No newline at end of file diff --git a/example/electronflow_cred.json b/example/electronflow_cred.json new file mode 100644 index 0000000..4d5996a --- /dev/null +++ b/example/electronflow_cred.json @@ -0,0 +1 @@ +{"$":"8dbcfcd6d9f25932aa00994065774d5ctxk="} \ No newline at end of file diff --git a/example/package.json b/example/package.json new file mode 100644 index 0000000..6af4fab --- /dev/null +++ b/example/package.json @@ -0,0 +1,17 @@ +{ + "name": "electron_node_red", + "version": "1.1.3", + "description": "Electron Node-RED application starter kit for development", + "dependencies": { + "node-red-contrib-play-audio": "*", + "node-red-contrib-web-worldmap": "*", + "node-red-dashboard": "*", + "node-red-node-base64": "*", + "node-red-node-geofence": "*", + "node-red-node-random": "*", + "node-red-node-smooth": "*" + }, + "scripts": { + "start": "node node_modules/node-red/red.js -u . electronflow.json" + } +} diff --git a/flows.json b/flows.json deleted file mode 100644 index 9e6c07a..0000000 --- a/flows.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"41f61d2.fbe09e4","type":"tab","label":"Flow 1"},{"id":"52a903f3.ad56fc","type":"ui_tab","z":"41f61d2.fbe09e4","name":"Home","icon":"dashboard"},{"id":"30e652f.d9de3ae","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 2","tab":"52a903f3.ad56fc","order":3,"disp":true,"width":"6"},{"id":"a8ecb9.c60f4348","type":"ui_group","z":"41f61d2.fbe09e4","name":"Introduction","tab":"52a903f3.ad56fc","order":1,"disp":false,"width":"3"},{"id":"bbdf3e02.e8fee","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 1","tab":"52a903f3.ad56fc","order":2,"disp":true,"width":"6"},{"id":"d9ba26fa.6d2b18","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#8e0d17","baseFont":"Copperplate,Copperplate Gothic Light,fantasy","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#d80005","edited":true},"page-titlebar-backgroundColor":{"value":"#8e0d17","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#d41322","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#8e0d17","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"Copperplate,Copperplate Gothic Light,fantasy"}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"87356b62.92e3d8","type":"ui_group","z":"","name":"Text to Speech","tab":"52a903f3.ad56fc","order":5,"disp":true,"width":"6"},{"id":"c75ad4f0.0cede8","type":"ui_group","z":"","name":"Map","tab":"52a903f3.ad56fc","order":4,"disp":true,"width":"6"},{"id":"189cf871.681118","type":"ui_template","z":"41f61d2.fbe09e4","group":"a8ecb9.c60f4348","name":"Welcome","order":1,"width":"3","height":"9","format":"On the right you will see a graph and a chart logging data from the sliders underneath.
","storeOutMessages":false,"fwdInMessages":false,"x":93,"y":45,"wires":[[]]},{"id":"9f19ee5c.beaef","type":"ui_chart","z":"41f61d2.fbe09e4","name":"","group":"bbdf3e02.e8fee","order":1,"width":"0","height":"0","label":"","chartType":"line","xformat":"HH:mm:ss","interpolate":"basis","nodata":"No Data","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":270,"y":200,"wires":[[],[]]},{"id":"799d9318.fd385c","type":"ui_gauge","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","order":2,"width":"","height":"","gtype":"gage","title":"Title","label":"gauge","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":270,"y":140,"wires":[]},{"id":"6f18b200.666a4","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"87356b62.92e3d8","order":2,"width":0,"height":0,"label":"press to talk","color":"","bgcolor":"","icon":"fa-volume-up","payload":"Hello to Jason Isaacs","payloadType":"str","topic":"","x":110,"y":300,"wires":[["f897d7c2.467a58"]]},{"id":"f897d7c2.467a58","type":"ui_audio","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","voice":"0","x":300,"y":300,"wires":[]},{"id":"da0f7e67.0d38a","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"30e652f.d9de3ae","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":140,"wires":[["799d9318.fd385c"]]},{"id":"eabf2bd7.f4e0c8","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"bbdf3e02.e8fee","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":200,"wires":[["9f19ee5c.beaef"]]},{"id":"7d549f6e.58ab6","type":"worldmap","z":"41f61d2.fbe09e4","name":"","lat":"","lon":"","zoom":"","layer":"OSM","cluster":"","maxage":"","usermenu":"hide","panit":"true","x":445,"y":411,"wires":[]},{"id":"45508d88.744a54","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Mike\", icon:\"male\", url:\"IBM link\"};\nreturn msg;","outputs":1,"noerr":0,"x":265,"y":411,"wires":[["7d549f6e.58ab6"]]},{"id":"6ca8cfc2.e0bce","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":1,"width":0,"height":0,"label":"Move Mike","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":103,"y":412,"wires":[["45508d88.744a54"]]},{"id":"c87aa53d.223ba8","type":"inject","z":"41f61d2.fbe09e4","name":"","topic":"","payload":"/worldmap","payloadType":"str","repeat":"","crontab":"","once":true,"x":106,"y":461,"wires":[["42a56979.e10b68"]]},{"id":"582c9a7e.d9d014","type":"ui_template","z":"41f61d2.fbe09e4","group":"c75ad4f0.0cede8","name":"","order":2,"width":"6","height":"6","format":"","storeOutMessages":true,"fwdInMessages":true,"x":436,"y":461,"wires":[[]]},{"id":"42a56979.e10b68","type":"template","z":"41f61d2.fbe09e4","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"","x":266,"y":461,"wires":[["582c9a7e.d9d014"]]}] \ No newline at end of file diff --git a/flows_cred.json b/flows_cred.json deleted file mode 100644 index e166066..0000000 --- a/flows_cred.json +++ /dev/null @@ -1 +0,0 @@ -{"$":"7b15c36b8209a9e08997cdea6bd0c71cpNQ="} \ No newline at end of file diff --git a/load.html b/load.html new file mode 100644 index 0000000..5297c28 --- /dev/null +++ b/load.html @@ -0,0 +1,19 @@ + + +