@frangoteam/fuxa-min 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/_images/Pipes/P1.svg +39 -0
- package/_images/Tanks/Fl.svg +7 -0
- package/api/alarms/index.js +132 -0
- package/api/auth/index.js +71 -0
- package/api/command/index.js +187 -0
- package/api/daq/index.js +79 -0
- package/api/diagnose/index.js +163 -0
- package/api/index.js +181 -0
- package/api/jwt-helper.js +106 -0
- package/api/plugins/index.js +109 -0
- package/api/projects/index.js +229 -0
- package/api/resources/index.js +118 -0
- package/api/scripts/index.js +82 -0
- package/api/users/index.js +109 -0
- package/dist/3rdpartylicenses.txt +1477 -0
- package/dist/Quicksand-Bold.071154c292aef0b8.woff +0 -0
- package/dist/Quicksand-Bold.6383d6475ed5c40f.woff2 +0 -0
- package/dist/Quicksand-Bold.f07d467887f9cfab.ttf +0 -0
- package/dist/Quicksand-Medium.0982a651e8d4315f.woff +0 -0
- package/dist/Quicksand-Medium.9d2733fbfb9b1be8.ttf +0 -0
- package/dist/Quicksand-Medium.b09302365c586eb2.woff2 +0 -0
- package/dist/Quicksand-Regular.16adf9eecd267273.woff +0 -0
- package/dist/Quicksand-Regular.78819724f6aeff59.woff2 +0 -0
- package/dist/Quicksand-Regular.8829564f0e14bf76.ttf +0 -0
- package/dist/assets/fonts/icomoon.eot +0 -0
- package/dist/assets/fonts/icomoon.svg +19 -0
- package/dist/assets/fonts/icomoon.ttf +0 -0
- package/dist/assets/fonts/icomoon.woff +0 -0
- package/dist/assets/fonts/myicons.eot +0 -0
- package/dist/assets/fonts/myicons.svg +19 -0
- package/dist/assets/fonts/myicons.ttf +0 -0
- package/dist/assets/fonts/myicons.woff +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.ttf +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.woff +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.woff2 +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.ttf +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.woff +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.woff2 +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.ttf +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.woff +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.woff2 +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.svg +10486 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.svg +9998 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.svg +10487 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.svg +10004 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.svg +10012 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.woff2 +0 -0
- package/dist/assets/i18n/de.json +1308 -0
- package/dist/assets/i18n/en.json +1438 -0
- package/dist/assets/i18n/es.json +777 -0
- package/dist/assets/i18n/fr.json +1129 -0
- package/dist/assets/i18n/ko.json +774 -0
- package/dist/assets/i18n/pt.json +657 -0
- package/dist/assets/i18n/ru.json +1228 -0
- package/dist/assets/i18n/tr.json +673 -0
- package/dist/assets/i18n/ua.json +614 -0
- package/dist/assets/i18n/zh-cn.json +1252 -0
- package/dist/assets/images/align-bottom.svg +88 -0
- package/dist/assets/images/align-center.svg +86 -0
- package/dist/assets/images/align-left.svg +86 -0
- package/dist/assets/images/align-middle.svg +88 -0
- package/dist/assets/images/align-right.svg +88 -0
- package/dist/assets/images/align-top.svg +88 -0
- package/dist/assets/images/bag.svg +115 -0
- package/dist/assets/images/button.svg +22 -0
- package/dist/assets/images/chart.svg +17 -0
- package/dist/assets/images/circle.svg +84 -0
- package/dist/assets/images/compressor-a.svg +2 -0
- package/dist/assets/images/editvalue.svg +14 -0
- package/dist/assets/images/ellipse.svg +84 -0
- package/dist/assets/images/flip-orizontal.svg +86 -0
- package/dist/assets/images/flip-vertical.svg +82 -0
- package/dist/assets/images/gauge-donut.png +0 -0
- package/dist/assets/images/gauge-mat.png +0 -0
- package/dist/assets/images/gauge-zone.png +0 -0
- package/dist/assets/images/graphbar.svg +18 -0
- package/dist/assets/images/group.svg +91 -0
- package/dist/assets/images/iframe.svg +54 -0
- package/dist/assets/images/image.svg +95 -0
- package/dist/assets/images/led-circle.svg +77 -0
- package/dist/assets/images/line.svg +86 -0
- package/dist/assets/images/linecap-butt.svg +77 -0
- package/dist/assets/images/linecap-round.svg +77 -0
- package/dist/assets/images/linecap-square.svg +82 -0
- package/dist/assets/images/linejoin-bevel.svg +77 -0
- package/dist/assets/images/linejoin-miter.svg +77 -0
- package/dist/assets/images/linejoin-round.svg +77 -0
- package/dist/assets/images/logo.svg +18 -0
- package/dist/assets/images/path.svg +100 -0
- package/dist/assets/images/pencil.svg +98 -0
- package/dist/assets/images/pipe.svg +15 -0
- package/dist/assets/images/progress-v.svg +79 -0
- package/dist/assets/images/rect.svg +84 -0
- package/dist/assets/images/select-pointer.svg +93 -0
- package/dist/assets/images/selectvalue.svg +14 -0
- package/dist/assets/images/semaphore.svg +19 -0
- package/dist/assets/images/slider.svg +17 -0
- package/dist/assets/images/switch.svg +15 -0
- package/dist/assets/images/table.svg +55 -0
- package/dist/assets/images/text.svg +294 -0
- package/dist/assets/images/to-bottom.svg +163 -0
- package/dist/assets/images/to-path.svg +94 -0
- package/dist/assets/images/to-top.svg +163 -0
- package/dist/assets/images/to_top.svg +88 -0
- package/dist/assets/images/todelete.svg +13 -0
- package/dist/assets/images/ungroup.svg +108 -0
- package/dist/assets/images/value.svg +81 -0
- package/dist/assets/images/valve-a.svg +2 -0
- package/dist/assets/images/webcam.svg +16 -0
- package/dist/assets/lib/ext-styles.css +28 -0
- package/dist/assets/lib/gauge/gauge.js +988 -0
- package/dist/assets/lib/gauge/gauge.min.js +1 -0
- package/dist/assets/lib/nouislider/nouislider.min.css +1 -0
- package/dist/assets/lib/nouislider/nouislider.min.js +1 -0
- package/dist/assets/lib/numeral/locales.min.js +7 -0
- package/dist/assets/lib/numeral/numeral.min.js +8 -0
- package/dist/assets/lib/pdfkit-table/index.js +967 -0
- package/dist/assets/lib/svg/raphael.min.js +1 -0
- package/dist/assets/lib/svg/svg.js +5573 -0
- package/dist/assets/lib/svg/svg.min.js +13 -0
- package/dist/assets/lib/svgeditor/extensions/ext-bundle.min.js +1 -0
- package/dist/assets/lib/svgeditor/extensions/ext-html_button.min.css +1 -0
- package/dist/assets/lib/svgeditor/fuxa-editor.min.js +23 -0
- package/dist/assets/lib/svgeditor/jquery-plugin.min.css +2 -0
- package/dist/assets/lib/svgeditor/jquery-plugin.min.js +52 -0
- package/dist/assets/lib/svgeditor/jquery-ui-1.8.17.custom.min.js +54 -0
- package/dist/assets/lib/svgeditor/jquery.min.js +4 -0
- package/dist/assets/lib/svgeditor/shapes/ape-shapes.js +39 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-disc.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-paddle.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-prop.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-turbo.svg +19 -0
- package/dist/assets/lib/svgeditor/shapes/img/anim-eli.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/anim-piston.svg +14 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifugal.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifugal1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge3.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compair.svg +92 -0
- package/dist/assets/lib/svgeditor/shapes/img/compdiaph.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compejector.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compreci.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/compreci2.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-fan.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-piston.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-void.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compring.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/compring2.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/comprotary.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/comprotary2.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/compscrew.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compsilence.svg +20 -0
- package/dist/assets/lib/svgeditor/shapes/img/compturbo.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher1.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher3.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher4.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher5.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher6.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher7.svg +21 -0
- package/dist/assets/lib/svgeditor/shapes/img/diaph.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier1.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier3.svg +23 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier4.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-filter.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-heat.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-tube.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger6.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger7.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger8.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger9.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder3.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/filter2.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/filter3.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting10.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting11.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting12.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting13.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting3.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting6.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting7.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting9.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc1.svg +75 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc2.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc6.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc7.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/motor-simb.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/nozzle.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/nozzle2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi1.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi6.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi7.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpblower.svg +76 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpcentri1.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpcentri2.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpfeed.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpgear.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpgear2.svg +19 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumphidra.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumphorizo.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpjet.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpperis.svg +20 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpscreew.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpscreew2.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpturbi.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpvacuum.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-arrow.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-circle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-circleindi.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cloud.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cone.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-corner.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cross.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cylinder.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-delay.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-diamond.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-display.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-docu.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-doublearrow.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-drop.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-halfcircle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-heart.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-looplimit.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-maninput.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-nosymbol.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-octagon.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-offpage.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-or.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-or2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-parallelogram.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-pentagon.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-poval.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-prepara.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-rectangle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-rectindi.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-star4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-switch.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-tape.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-tee.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-ticket.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-trape.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-triangle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-vor.svg +14 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank1.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank5.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank6.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank7.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank9.svg +21 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-ax.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-bx.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-cx.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/webcam.svg +6 -0
- package/dist/assets/lib/svgeditor/shapes/my-shapes.js +178 -0
- package/dist/assets/lib/svgeditor/shapes/proc-comp-shapes.js +105 -0
- package/dist/assets/lib/svgeditor/shapes/proc-general-shapes.js +60 -0
- package/dist/assets/lib/svgeditor/shapes/proc-pumps-shapes.js +112 -0
- package/dist/assets/lib/svgeditor/shapes/proc-shapes.js +606 -0
- package/dist/assets/lib/svgeditor/shapes/shapes.js +30 -0
- package/dist/assets/lib/svgeditor/svg-editor.min.css +1 -0
- package/dist/assets/lib/uplot/placement.min.js +2 -0
- package/dist/assets/project.demo.fuxap +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/icomoon.86abfb46e057ade8.eot +0 -0
- package/dist/icomoon.c1f8b59bad308d66.woff +0 -0
- package/dist/icomoon.ce427f75e21963af.ttf +0 -0
- package/dist/icomoon.dfb0a89feb346906.svg +19 -0
- package/dist/index.html +50 -0
- package/dist/logo.0e8e64e69250a450.svg +18 -0
- package/dist/main.a356f552d9838b9e.js +1 -0
- package/dist/material-icons-outlined.78a93b2079680a08.woff +0 -0
- package/dist/material-icons-outlined.f86cb7b0aa53f0fe.woff2 +0 -0
- package/dist/material-icons-round.92dc7ca2f4c591e7.woff +0 -0
- package/dist/material-icons-round.b10ec9db5b7fbc74.woff2 +0 -0
- package/dist/material-icons-sharp.3885863ee4746422.woff2 +0 -0
- package/dist/material-icons-sharp.a71cb2bf66c604de.woff +0 -0
- package/dist/material-icons-two-tone.588d63134de807a7.woff +0 -0
- package/dist/material-icons-two-tone.675bd578bd14533e.woff2 +0 -0
- package/dist/material-icons.4ad034d2c499d9b6.woff +0 -0
- package/dist/material-icons.59322316b3fd6063.woff2 +0 -0
- package/dist/polyfills.2696a6f9dc75535e.js +1 -0
- package/dist/roboto-bold-webfont.29ac6158e35aee95.woff +0 -0
- package/dist/roboto-bold-webfont.568ab1fa3f154a77.svg +10486 -0
- package/dist/roboto-bold-webfont.6bcfbdc216b3bc78.woff2 +0 -0
- package/dist/roboto-bold-webfont.7c22a4dfdee2ff33.ttf +0 -0
- package/dist/roboto-light-webfont.13492ec56771eeee.svg +9998 -0
- package/dist/roboto-light-webfont.61fa26c99b07ac83.woff2 +0 -0
- package/dist/roboto-light-webfont.95295ce84942d8ce.ttf +0 -0
- package/dist/roboto-light-webfont.ae19119a2889dfdf.woff +0 -0
- package/dist/roboto-medium-webfont.30344f0411888055.woff +0 -0
- package/dist/roboto-medium-webfont.57fb00cab0317d2d.woff2 +0 -0
- package/dist/roboto-medium-webfont.a40869e060a388c0.ttf +0 -0
- package/dist/roboto-medium-webfont.ea02241c29620c02.svg +10487 -0
- package/dist/roboto-regular-webfont.2b0501b72f5a94d5.ttf +0 -0
- package/dist/roboto-regular-webfont.2ce0ba9a06424965.svg +10004 -0
- package/dist/roboto-regular-webfont.ae47f6f1292d196f.woff2 +0 -0
- package/dist/roboto-regular-webfont.f58066a2d9061006.woff +0 -0
- package/dist/roboto-thin-webfont.0a64479870f676e8.ttf +0 -0
- package/dist/roboto-thin-webfont.0f7221f5c7e972ef.woff2 +0 -0
- package/dist/roboto-thin-webfont.51b221e22714b1fe.svg +10012 -0
- package/dist/roboto-thin-webfont.dac941649dd4eac0.woff +0 -0
- package/dist/runtime.8ef63094e52a66ba.js +1 -0
- package/dist/scripts.1c3385254ff4c93c.js +1 -0
- package/dist/styles.cf8e3cf50d039a5c.css +1 -0
- package/fuxa.js +39 -0
- package/main.js +381 -0
- package/package.json +68 -0
- package/paths.js +44 -0
- package/project.default.json +11 -0
- package/project.demo.fuxap +1 -0
- package/runtime/alarms/alarmstorage.js +205 -0
- package/runtime/alarms/index.js +678 -0
- package/runtime/devices/bacnet/index.js +730 -0
- package/runtime/devices/device-utils.js +95 -0
- package/runtime/devices/device.js +551 -0
- package/runtime/devices/ethernetip/index.js +381 -0
- package/runtime/devices/fuxaserver/index.js +310 -0
- package/runtime/devices/httprequest/index.js +495 -0
- package/runtime/devices/index.js +489 -0
- package/runtime/devices/modbus/datatypes.js +122 -0
- package/runtime/devices/modbus/index.js +730 -0
- package/runtime/devices/mqtt/index.js +618 -0
- package/runtime/devices/odbc/index.js +408 -0
- package/runtime/devices/opcua/index.js +817 -0
- package/runtime/devices/s7/datatypes.js +88 -0
- package/runtime/devices/s7/index.js +702 -0
- package/runtime/devices/template/index.js +141 -0
- package/runtime/events.js +33 -0
- package/runtime/index.js +559 -0
- package/runtime/jobs/cleaner.js +74 -0
- package/runtime/jobs/fonts/LICENSE.txt +202 -0
- package/runtime/jobs/fonts/Roboto-Black.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-BlackItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Bold.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-BoldItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Italic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Light.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-LightItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Medium.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-MediumItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Regular.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Thin.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-ThinItalic.ttf +0 -0
- package/runtime/jobs/helper/image-generator.js +82 -0
- package/runtime/jobs/index.js +214 -0
- package/runtime/jobs/report.js +353 -0
- package/runtime/logger.js +113 -0
- package/runtime/notificator/index.js +383 -0
- package/runtime/notificator/notifystorage.js +179 -0
- package/runtime/plugins/index.js +255 -0
- package/runtime/project/index.js +959 -0
- package/runtime/project/prjstorage.js +222 -0
- package/runtime/scripts/index.js +313 -0
- package/runtime/scripts/msm.js +146 -0
- package/runtime/storage/calculator.js +227 -0
- package/runtime/storage/daqstorage.js +188 -0
- package/runtime/storage/influxdb/index.js +240 -0
- package/runtime/storage/sqlite/currentstorage.js +144 -0
- package/runtime/storage/sqlite/index.js +695 -0
- package/runtime/storage/tdengine/index.js +106 -0
- package/runtime/users/index.js +123 -0
- package/runtime/users/usrstorage.js +201 -0
- package/runtime/utils.js +284 -0
- package/screenshot/feature-action-move.gif +0 -0
- package/screenshot/fuxa-ani.gif +0 -0
- package/screenshot/fuxa-device.gif +0 -0
- package/screenshot/fuxa-editor.png +0 -0
- package/screenshot/fuxa-hmi.gif +0 -0
- package/screenshot/fuxa-home.png +0 -0
- package/screenshot/fuxa-test.gif +0 -0
- package/settings.default.js +65 -0
package/main.js
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const morgan = require('morgan');
|
|
6
|
+
const http = require('http');
|
|
7
|
+
const https = require('https');
|
|
8
|
+
const socketIO = require('socket.io');
|
|
9
|
+
const nopt = require("nopt");
|
|
10
|
+
|
|
11
|
+
const paths = require('./paths');
|
|
12
|
+
const logger = require('./runtime/logger');
|
|
13
|
+
const utils = require('./runtime/utils');
|
|
14
|
+
var events = require("./runtime/events").create();
|
|
15
|
+
|
|
16
|
+
const FUXA = require('./fuxa.js');
|
|
17
|
+
|
|
18
|
+
const express = require('express');
|
|
19
|
+
const app = express();
|
|
20
|
+
|
|
21
|
+
var server;
|
|
22
|
+
var settingsFile;
|
|
23
|
+
|
|
24
|
+
var startTime = new Date();
|
|
25
|
+
|
|
26
|
+
var knownOpts = {
|
|
27
|
+
"help": Boolean,
|
|
28
|
+
"port": Number,
|
|
29
|
+
"userDir": [path]
|
|
30
|
+
};
|
|
31
|
+
var shortHands = {
|
|
32
|
+
"?":["--help"],
|
|
33
|
+
"p":["--port"],
|
|
34
|
+
"u":["--userDir"]
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
nopt.invalidHandler = function(k,v,t) {
|
|
38
|
+
// TODO: console.log(k,v,t);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var parsedArgs = nopt(knownOpts, shortHands, process.argv, 2);
|
|
42
|
+
|
|
43
|
+
if (parsedArgs.help) {
|
|
44
|
+
console.log("FUXA v" + FUXA.version());
|
|
45
|
+
console.log("Usage: fuxa [-?] [--port PORT] [--userDir DIR]");
|
|
46
|
+
console.log("");
|
|
47
|
+
console.log("Options:");
|
|
48
|
+
console.log(" -p, --port PORT port to listen on");
|
|
49
|
+
console.log(" -u, --userDir DIR use specified user directory");
|
|
50
|
+
console.log(" -?, --help show this help");
|
|
51
|
+
process.exit();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Define directory
|
|
55
|
+
var rootDir = __dirname;
|
|
56
|
+
var workDir = path.resolve(process.cwd(), '_appdata');
|
|
57
|
+
if (parsedArgs.userDir) {
|
|
58
|
+
rootDir = parsedArgs.userDir;
|
|
59
|
+
workDir = path.resolve(parsedArgs.userDir, '_appdata');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (parsedArgs.env) {
|
|
63
|
+
require('./envParams.js');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!fs.existsSync(workDir)) {
|
|
67
|
+
fs.mkdirSync(workDir);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Read app settings
|
|
71
|
+
var appSettingsFile = path.join(workDir, 'settings.js');
|
|
72
|
+
if (fs.existsSync(appSettingsFile)) {
|
|
73
|
+
// _appdata/settings.js exists
|
|
74
|
+
settingsFile = appSettingsFile;
|
|
75
|
+
} else {
|
|
76
|
+
// Not exist, copy from code resource
|
|
77
|
+
var defaultSettings = path.join(__dirname, 'settings.default.js');
|
|
78
|
+
try {
|
|
79
|
+
fs.copyFileSync(defaultSettings, appSettingsFile, fs.constants.COPYFILE_EXCL);
|
|
80
|
+
logger.debug('settings.js default created successful!');
|
|
81
|
+
} catch (err) {
|
|
82
|
+
logger.error(err);
|
|
83
|
+
}
|
|
84
|
+
settingsFile = appSettingsFile;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
// load settings and set some app variable
|
|
88
|
+
var settings = require(settingsFile);
|
|
89
|
+
settings.workDir = workDir;
|
|
90
|
+
settings.appDir = __dirname;
|
|
91
|
+
settings.packageDir = path.resolve(rootDir, '_pkg');
|
|
92
|
+
settings.settingsFile = settingsFile;
|
|
93
|
+
settings.environment = process.env.NODE_ENV || 'prod';
|
|
94
|
+
settings.uploadFileDir = '_upload_files';
|
|
95
|
+
settings.imagesFileDir = path.resolve(rootDir, '_images');
|
|
96
|
+
settings.reportsDir = path.resolve(rootDir, '_reports');
|
|
97
|
+
|
|
98
|
+
// check new settings from default and merge if not defined
|
|
99
|
+
var defSettings = require(path.join(__dirname, 'settings.default.js'));
|
|
100
|
+
if (defSettings.version !== settings.version) {
|
|
101
|
+
logger.warn("Settings aren't up to date! Please check 'settings.json'.");
|
|
102
|
+
// settings = Object.assign(defSettings, settings);
|
|
103
|
+
}
|
|
104
|
+
} catch (err) {
|
|
105
|
+
logger.error('Error loading settings file: ' + settingsFile)
|
|
106
|
+
if (err.code == 'MODULE_NOT_FOUND') {
|
|
107
|
+
if (err.toString().indexOf(settingsFile) === -1) {
|
|
108
|
+
logger.error(err.toString());
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
logger.error(err);
|
|
112
|
+
}
|
|
113
|
+
process.exit();
|
|
114
|
+
}
|
|
115
|
+
// Read user settings
|
|
116
|
+
try {
|
|
117
|
+
var userSettingsFile = path.join(workDir, 'mysettings.json');
|
|
118
|
+
settings.userSettingsFile = userSettingsFile;
|
|
119
|
+
if (fs.existsSync(userSettingsFile)) {
|
|
120
|
+
var mysettings = JSON.parse(fs.readFileSync(userSettingsFile, 'utf8'));
|
|
121
|
+
if (mysettings.language) {
|
|
122
|
+
settings.language = mysettings.language;
|
|
123
|
+
}
|
|
124
|
+
if (mysettings.uiPort) {
|
|
125
|
+
settings.uiPort = mysettings.uiPort;
|
|
126
|
+
}
|
|
127
|
+
if (!utils.isNullOrUndefined(mysettings.secureEnabled)) {
|
|
128
|
+
settings.secureEnabled = mysettings.secureEnabled;
|
|
129
|
+
if (!settings.tokenExpiresIn) {
|
|
130
|
+
settings.tokenExpiresIn = '1h';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (!utils.isNullOrUndefined(mysettings.secureOnlyEditor)) {
|
|
134
|
+
settings.secureOnlyEditor = mysettings.secureOnlyEditor;
|
|
135
|
+
}
|
|
136
|
+
if (mysettings.tokenExpiresIn) {
|
|
137
|
+
settings.tokenExpiresIn = mysettings.tokenExpiresIn;
|
|
138
|
+
}
|
|
139
|
+
if (mysettings.smtp) {
|
|
140
|
+
settings.smtp = mysettings.smtp;
|
|
141
|
+
}
|
|
142
|
+
if (mysettings.daqstore) {
|
|
143
|
+
settings.daqstore = mysettings.daqstore;
|
|
144
|
+
}
|
|
145
|
+
if (mysettings.alarms) {
|
|
146
|
+
settings.alarms = mysettings.alarms;
|
|
147
|
+
}
|
|
148
|
+
if (!utils.isNullOrUndefined(mysettings.broadcastAll)) {
|
|
149
|
+
settings.broadcastAll = mysettings.broadcastAll;
|
|
150
|
+
}
|
|
151
|
+
if (!utils.isNullOrUndefined(mysettings.logFull)) {
|
|
152
|
+
settings.logFull = mysettings.logFull;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} catch (err) {
|
|
156
|
+
logger.error('Error loading user settings file: ' + userSettingsFile)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Check logger
|
|
160
|
+
if (!settings.logDir) {
|
|
161
|
+
settings.logDir = path.resolve(rootDir, '_logs');
|
|
162
|
+
}
|
|
163
|
+
if (!fs.existsSync(settings.logDir)) {
|
|
164
|
+
fs.mkdirSync(settings.logDir);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
logger.init(settings);
|
|
168
|
+
const version = FUXA.version();
|
|
169
|
+
if (version.indexOf('beta') > 0) {
|
|
170
|
+
logger.warn('FUXA V.' + version);
|
|
171
|
+
} else {
|
|
172
|
+
logger.info('FUXA V.' + version);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Check storage Database dir
|
|
176
|
+
if (!settings.dbDir) {
|
|
177
|
+
settings.dbDir = path.resolve(rootDir, '_db');
|
|
178
|
+
}
|
|
179
|
+
if (!fs.existsSync(settings.dbDir)) {
|
|
180
|
+
fs.mkdirSync(settings.dbDir);
|
|
181
|
+
}
|
|
182
|
+
// Check package folder
|
|
183
|
+
if (!fs.existsSync(settings.packageDir)) {
|
|
184
|
+
fs.mkdirSync(settings.packageDir);
|
|
185
|
+
}
|
|
186
|
+
// Check reports folder
|
|
187
|
+
if (!fs.existsSync(settings.reportsDir)) {
|
|
188
|
+
fs.mkdirSync(settings.reportsDir);
|
|
189
|
+
}
|
|
190
|
+
// Check upload file folder
|
|
191
|
+
settings.httpUploadFileStatic = 'resources';
|
|
192
|
+
settings.uploadFileDir = path.resolve(workDir, settings.uploadFileDir);
|
|
193
|
+
if (!fs.existsSync(settings.uploadFileDir)) {
|
|
194
|
+
fs.mkdirSync(settings.uploadFileDir);
|
|
195
|
+
}
|
|
196
|
+
// Check images resources folder
|
|
197
|
+
if (!fs.existsSync(settings.imagesFileDir)) {
|
|
198
|
+
fs.mkdirSync(settings.imagesFileDir);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Server settings
|
|
202
|
+
if (settings.https) {
|
|
203
|
+
server = https.createServer(settings.https, function (req, res) { app(req, res); });
|
|
204
|
+
} else {
|
|
205
|
+
server = http.createServer(function (req, res) { app(req, res); });
|
|
206
|
+
}
|
|
207
|
+
server.setMaxListeners(0);
|
|
208
|
+
|
|
209
|
+
const io = socketIO(server);
|
|
210
|
+
|
|
211
|
+
// Check settings value
|
|
212
|
+
var www = path.resolve(__dirname, './dist');
|
|
213
|
+
settings.httpStatic = settings.httpStatic || www;
|
|
214
|
+
|
|
215
|
+
if (parsedArgs.port !== undefined){
|
|
216
|
+
settings.uiPort = parsedArgs.port;
|
|
217
|
+
} else {
|
|
218
|
+
if (settings.uiPort === undefined){
|
|
219
|
+
settings.uiPort = 1881;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
settings.uiHost = settings.uiHost || "0.0.0.0";
|
|
223
|
+
|
|
224
|
+
// Wait ending initialization
|
|
225
|
+
events.once('init-runtime-ok', function () {
|
|
226
|
+
logger.info('FUXA init in ' + utils.endTime(startTime) + 'ms.');
|
|
227
|
+
startFuxa();
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// Init FUXA
|
|
231
|
+
try {
|
|
232
|
+
FUXA.init(server, io, settings, logger, events);
|
|
233
|
+
} catch(err) {
|
|
234
|
+
if (err.code == 'unsupported_version') {
|
|
235
|
+
logger.error('Unsupported version of node.js:', process.version);
|
|
236
|
+
logger.error('FUXA requires node.js v6 or later');
|
|
237
|
+
} else if (err.code == 'not_built') {
|
|
238
|
+
logger.error('FUXA has not been built. See README.md for details');
|
|
239
|
+
} else {
|
|
240
|
+
logger.error('Failed to start server:');
|
|
241
|
+
if (err.stack) {
|
|
242
|
+
logger.error(err.stack);
|
|
243
|
+
} else {
|
|
244
|
+
logger.error(err);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
process.exit(1);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Http Server for client UI
|
|
251
|
+
var allowCrossDomain = function(req, res, next) {
|
|
252
|
+
res.header('Access-Control-Allow-Origin', '*');
|
|
253
|
+
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
|
254
|
+
res.header('Access-Control-Allow-Headers', 'x-access-token, x-auth-user, Origin, Content-Type, Accept');
|
|
255
|
+
|
|
256
|
+
next();
|
|
257
|
+
try {
|
|
258
|
+
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
|
259
|
+
// logger.info("Client: " + ip, false);
|
|
260
|
+
} catch (err) {
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
app.use(allowCrossDomain);
|
|
265
|
+
app.use('/', express.static(settings.httpStatic));
|
|
266
|
+
app.use('/home', express.static(settings.httpStatic));
|
|
267
|
+
app.use('/home/:viewName', express.static(settings.httpStatic));
|
|
268
|
+
app.use('/lab', express.static(settings.httpStatic));
|
|
269
|
+
app.use('/editor', express.static(settings.httpStatic));
|
|
270
|
+
app.use('/device', express.static(settings.httpStatic));
|
|
271
|
+
app.use('/rodevice', express.static(settings.httpStatic));
|
|
272
|
+
app.use('/users', express.static(settings.httpStatic));
|
|
273
|
+
app.use('/view', express.static(settings.httpStatic));
|
|
274
|
+
app.use('/' + settings.httpUploadFileStatic, express.static(settings.uploadFileDir));
|
|
275
|
+
app.use('/_images', express.static(settings.imagesFileDir));
|
|
276
|
+
|
|
277
|
+
var accessLogStream = fs.createWriteStream(settings.logDir + '/api.log', {flags: 'a'});
|
|
278
|
+
app.use(morgan('combined', {
|
|
279
|
+
stream: accessLogStream,
|
|
280
|
+
skip: function (req, res) { return res.statusCode < 400 }
|
|
281
|
+
}));
|
|
282
|
+
|
|
283
|
+
app.use(morgan('dev', {
|
|
284
|
+
skip: function (req, res) {
|
|
285
|
+
return res.statusCode < 400
|
|
286
|
+
}, stream: process.stderr
|
|
287
|
+
}));
|
|
288
|
+
|
|
289
|
+
app.use(morgan('dev', {
|
|
290
|
+
skip: function (req, res) {
|
|
291
|
+
return res.statusCode >= 400
|
|
292
|
+
}, stream: process.stdout
|
|
293
|
+
}));
|
|
294
|
+
|
|
295
|
+
// app.get('/', function (req, res) {
|
|
296
|
+
// res.sendFile('/index.html');
|
|
297
|
+
// try {
|
|
298
|
+
// var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
|
299
|
+
// logger.info("Client connected: " + ip);
|
|
300
|
+
// } catch (err) {
|
|
301
|
+
|
|
302
|
+
// }
|
|
303
|
+
// })
|
|
304
|
+
|
|
305
|
+
// set api to listen
|
|
306
|
+
if (settings.disableServer !== false) {
|
|
307
|
+
app.use('/', FUXA.httpApi);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function getListenPath() {
|
|
311
|
+
var port = settings.serverPort;
|
|
312
|
+
if (port === undefined) {
|
|
313
|
+
port = settings.uiPort;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
var listenPath = 'http' + (settings.https ? 's' : '') + '://' +
|
|
317
|
+
(settings.uiHost == '::' ? 'localhost' : (settings.uiHost == '0.0.0.0' ? '127.0.0.1' : settings.uiHost)) +
|
|
318
|
+
':' + port;
|
|
319
|
+
if (settings.httpStatic) {
|
|
320
|
+
listenPath += '/';
|
|
321
|
+
}
|
|
322
|
+
return listenPath;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Start FUXA
|
|
326
|
+
function startFuxa() {
|
|
327
|
+
FUXA.start().then(function () {
|
|
328
|
+
if (settings.httpStatic) {
|
|
329
|
+
server.on('error', function (err) {
|
|
330
|
+
if (err.errno === 'EADDRINUSE') {
|
|
331
|
+
logger.error('server.port-in-use');
|
|
332
|
+
logger.error('server.unable-to-listen ', { listenpath: getListenPath() });
|
|
333
|
+
} else {
|
|
334
|
+
if (err.stack) {
|
|
335
|
+
logger.error(err.stack);
|
|
336
|
+
} else {
|
|
337
|
+
logger.error('server.error ' + err);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
process.exit(1);
|
|
341
|
+
});
|
|
342
|
+
server.listen(settings.uiPort, settings.uiHost, function () {
|
|
343
|
+
settings.serverPort = server.address().port;
|
|
344
|
+
process.title = 'FUXA';
|
|
345
|
+
logger.info('WebServer is running ' + getListenPath());
|
|
346
|
+
});
|
|
347
|
+
} else {
|
|
348
|
+
logger.info('server.headless-mode');
|
|
349
|
+
}
|
|
350
|
+
}).catch(function (err) {
|
|
351
|
+
logger.error('server.failed-to-start');
|
|
352
|
+
if (err) {
|
|
353
|
+
if (err.stack) {
|
|
354
|
+
logger.error(err.stack);
|
|
355
|
+
} else {
|
|
356
|
+
logger.error(err);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Don't wait any more
|
|
363
|
+
setTimeout(() => {
|
|
364
|
+
events.emit('init-runtime-ok');
|
|
365
|
+
}, 60000);
|
|
366
|
+
|
|
367
|
+
process.on('uncaughtException', function (err) {
|
|
368
|
+
if (err.stack) {
|
|
369
|
+
logger.error(err.stack);
|
|
370
|
+
} else {
|
|
371
|
+
logger.error(err);
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
process.on('SIGINT', function () {
|
|
376
|
+
FUXA.stop().then(function() {
|
|
377
|
+
process.exit();
|
|
378
|
+
});
|
|
379
|
+
logger.info('FUXA end!');
|
|
380
|
+
process.exit();
|
|
381
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@frangoteam/fuxa-min",
|
|
3
|
+
"version": "1.1.19",
|
|
4
|
+
"description": "Web-based Process Visualization (SCADA/HMI/Dashboard) software",
|
|
5
|
+
"main": "main.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"start": "node main.js"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"fuxa": "./main.js"
|
|
12
|
+
},
|
|
13
|
+
"author": "frangoteam <4frango@gmail.com>",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"web-scada",
|
|
17
|
+
"dashboard",
|
|
18
|
+
"web-hmi",
|
|
19
|
+
"iot",
|
|
20
|
+
"svg-editor",
|
|
21
|
+
"plc",
|
|
22
|
+
"opcua",
|
|
23
|
+
"opc-ua",
|
|
24
|
+
"siemens",
|
|
25
|
+
"s7",
|
|
26
|
+
"modbus",
|
|
27
|
+
"bacnet",
|
|
28
|
+
"mqtt"
|
|
29
|
+
],
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/frangoteam/FUXA.git"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@influxdata/influxdb-client": "1.25.0",
|
|
36
|
+
"@tdengine/rest": "3.0.2",
|
|
37
|
+
"@types/socket.io": "2.1.2",
|
|
38
|
+
"app-root-path": "2.2.1",
|
|
39
|
+
"async": "3.2.3",
|
|
40
|
+
"axios": "0.28.0",
|
|
41
|
+
"bcryptjs": "2.4.3",
|
|
42
|
+
"bluebird": "3.7.2",
|
|
43
|
+
"body-parser": "1.20.0",
|
|
44
|
+
"dayjs": "1.11.9",
|
|
45
|
+
"express": "4.19.2",
|
|
46
|
+
"express-rate-limit": "5.5.1",
|
|
47
|
+
"fs-extra": "7.0.1",
|
|
48
|
+
"influx": "5.9.3",
|
|
49
|
+
"ip": "2.0.1",
|
|
50
|
+
"jsonwebtoken": "9.0.0",
|
|
51
|
+
"live-plugin-manager": "0.15.1",
|
|
52
|
+
"modbus-serial": "8.0.16",
|
|
53
|
+
"morgan": "1.10.0",
|
|
54
|
+
"mqtt": "4.3.7",
|
|
55
|
+
"node-bacnet": "0.2.4",
|
|
56
|
+
"node-opcua": "2.123.0",
|
|
57
|
+
"node-schedule": "2.1.1",
|
|
58
|
+
"nodemailer": "6.9.9",
|
|
59
|
+
"nopt": "5.0.0",
|
|
60
|
+
"pdfmake": "0.2.5",
|
|
61
|
+
"socket.io": "2.5.0",
|
|
62
|
+
"sqlite3": "5.1.5",
|
|
63
|
+
"winston": "3.7.2"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@mapbox/node-pre-gyp": "^1.0.0"
|
|
67
|
+
}
|
|
68
|
+
}
|
package/paths.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
const pkg = require('./package.json');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const os = require('os');
|
|
8
|
+
var fs = require('fs-extra');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} platform
|
|
12
|
+
* @returns {string}
|
|
13
|
+
*/
|
|
14
|
+
function getAppDataPath(platform) {
|
|
15
|
+
switch (platform) {
|
|
16
|
+
case 'win32': return process.env['FUXA_APPDATA'] || process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming');
|
|
17
|
+
case 'darwin': return process.env['FUXA_APPDATA'] || path.join(os.homedir(), 'Library', 'Application Support');
|
|
18
|
+
case 'linux': return process.env['FUXA_APPDATA'] || process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config');
|
|
19
|
+
default: throw new Error('Platform not supported');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} platform
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
function getDefaultUserDataPath(platform) {
|
|
28
|
+
return path.join(getAppDataPath(platform), pkg.name);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {*} dirPath
|
|
34
|
+
*/
|
|
35
|
+
function ensureDirs(dirPath) {
|
|
36
|
+
if (fs.existsSync(dirPath)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
fs.mkdirSync(dirPath);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.getAppDataPath = getAppDataPath;
|
|
43
|
+
exports.getDefaultUserDataPath = getDefaultUserDataPath;
|
|
44
|
+
exports.ensureDirs = ensureDirs;
|