@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/runtime/index.js
ADDED
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* 'runtime': Manager the communication with frontend (socket.io)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
var Promise = require('bluebird');
|
|
7
|
+
var Events = require('./events');
|
|
8
|
+
var events = Events.create();
|
|
9
|
+
var devices = require('./devices');
|
|
10
|
+
var project = require('./project');
|
|
11
|
+
var users = require('./users');
|
|
12
|
+
var alarms = require('./alarms');
|
|
13
|
+
var notificator = require('./notificator');
|
|
14
|
+
var scripts = require('./scripts');
|
|
15
|
+
var plugins = require('./plugins');
|
|
16
|
+
var utils = require('./utils');
|
|
17
|
+
const daqstorage = require('./storage/daqstorage');
|
|
18
|
+
var jobs = require('./jobs');
|
|
19
|
+
|
|
20
|
+
var api;
|
|
21
|
+
var settings
|
|
22
|
+
var logger;
|
|
23
|
+
var io;
|
|
24
|
+
var alarmsMgr;
|
|
25
|
+
var notificatorMgr;
|
|
26
|
+
var scriptsMgr;
|
|
27
|
+
var jobsMgr;
|
|
28
|
+
var tagsSubscription = new Map();
|
|
29
|
+
|
|
30
|
+
function init(_io, _api, _settings, _log, eventsMain) {
|
|
31
|
+
io = _io;
|
|
32
|
+
settings = _settings;
|
|
33
|
+
logger = _log;
|
|
34
|
+
api = _api;
|
|
35
|
+
// check runtime init dependency and send to main if ready
|
|
36
|
+
var checkInit = function () {
|
|
37
|
+
if (!events.listenerCount('init-plugins-ok') && !events.listenerCount('init-users-ok') && !events.listenerCount('init-project-ok')) {
|
|
38
|
+
eventsMain.emit('init-runtime-ok');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
events.once('init-plugins-ok', checkInit);
|
|
42
|
+
events.once('init-users-ok', checkInit);
|
|
43
|
+
events.once('init-project-ok', checkInit);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
daqstorage.init(settings, logger);
|
|
47
|
+
|
|
48
|
+
plugins.init(settings, logger).then(result => {
|
|
49
|
+
logger.info('runtime init plugins successful!', true);
|
|
50
|
+
events.emit('init-plugins-ok');
|
|
51
|
+
}).catch(function (err) {
|
|
52
|
+
logger.error('runtime.failed-to-init plugins');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
users.init(settings, logger).then(result => {
|
|
57
|
+
logger.info('runtime init users successful!', true);
|
|
58
|
+
events.emit('init-users-ok');
|
|
59
|
+
}).catch(function (err) {
|
|
60
|
+
logger.error('runtime.failed-to-init users');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
project.init(settings, logger).then(result => {
|
|
64
|
+
logger.info('runtime init project successful!', true);
|
|
65
|
+
events.emit('init-project-ok');
|
|
66
|
+
}).catch(function (err) {
|
|
67
|
+
logger.error('runtime.failed-to-init project');
|
|
68
|
+
});
|
|
69
|
+
alarmsMgr = alarms.create(runtime);
|
|
70
|
+
notificatorMgr = notificator.create(runtime);
|
|
71
|
+
scriptsMgr = scripts.create(runtime);
|
|
72
|
+
jobsMgr = jobs.create(runtime);
|
|
73
|
+
devices.init(runtime);
|
|
74
|
+
|
|
75
|
+
events.on('project-device:change', updateDevice);
|
|
76
|
+
events.on('device-value:changed', updateDeviceValues);
|
|
77
|
+
events.on('device-status:changed', updateDeviceStatus);
|
|
78
|
+
events.on('alarms-status:changed', updateAlarmsStatus);
|
|
79
|
+
events.on('tag-change:subscription', subscriptionTagChange);
|
|
80
|
+
events.on('script-console', scriptConsoleOutput);
|
|
81
|
+
|
|
82
|
+
io.on('connection', async (socket) => {
|
|
83
|
+
logger.info(`socket.io client connected`);
|
|
84
|
+
socket.tagsClientSubscriptions = [];
|
|
85
|
+
// check authorizations
|
|
86
|
+
if (settings.secureEnabled && !settings.secureOnlyEditor) {
|
|
87
|
+
const token = socket.handshake.query.token;
|
|
88
|
+
if (!token || token === 'null') {
|
|
89
|
+
socket.disconnect();
|
|
90
|
+
logger.error(`Token is missing!`);
|
|
91
|
+
} else {
|
|
92
|
+
try {
|
|
93
|
+
const authenticated = await api.authJwt.verify(token);
|
|
94
|
+
if (!authenticated) {
|
|
95
|
+
logger.error(`Token error!`);
|
|
96
|
+
socket.disconnect();
|
|
97
|
+
}
|
|
98
|
+
} catch (error) {
|
|
99
|
+
logger.error(`Token error: ${error}`);
|
|
100
|
+
socket.disconnect();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// client ask device status
|
|
105
|
+
socket.on(Events.IoEventTypes.DEVICE_STATUS, (message) => {
|
|
106
|
+
if (message === 'get') {
|
|
107
|
+
var adevs = devices.getDevicesStatus();
|
|
108
|
+
for (var id in adevs) {
|
|
109
|
+
updateDeviceStatus({ id: id, status: adevs[id] });
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
updateDeviceStatus(message);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// client ask device property
|
|
116
|
+
socket.on(Events.IoEventTypes.DEVICE_PROPERTY, (message) => {
|
|
117
|
+
try {
|
|
118
|
+
if (message && message.endpoint && message.type) {
|
|
119
|
+
devices.getSupportedProperty(message.endpoint, message.type).then(result => {
|
|
120
|
+
message.result = result;
|
|
121
|
+
io.emit(Events.IoEventTypes.DEVICE_PROPERTY, message);
|
|
122
|
+
}).catch(function (err) {
|
|
123
|
+
logger.error(`${Events.IoEventTypes.DEVICE_PROPERTY}: ${err}`);
|
|
124
|
+
message.error = err;
|
|
125
|
+
io.emit(Events.IoEventTypes.DEVICE_PROPERTY, message);
|
|
126
|
+
});
|
|
127
|
+
} else {
|
|
128
|
+
logger.error(`${Events.IoEventTypes.DEVICE_PROPERTY}: wrong message`);
|
|
129
|
+
message.error = 'wrong message';
|
|
130
|
+
io.emit(Events.IoEventTypes.DEVICE_PROPERTY, message);
|
|
131
|
+
}
|
|
132
|
+
} catch (err) {
|
|
133
|
+
logger.error(`${Events.IoEventTypes.DEVICE_PROPERTY}: ${err}`);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
// client ask device values
|
|
137
|
+
socket.on(Events.IoEventTypes.DEVICE_VALUES, (message) => {
|
|
138
|
+
try {
|
|
139
|
+
if (message === 'get') {
|
|
140
|
+
var adevs = devices.getDevicesValues();
|
|
141
|
+
for (var id in adevs) {
|
|
142
|
+
updateDeviceValues({ id: id, values: adevs[id] });
|
|
143
|
+
}
|
|
144
|
+
} else if (message.cmd === 'set' && message.var) {
|
|
145
|
+
devices.setDeviceValue(message.var.source, message.var.id, message.var.value, message.fnc);
|
|
146
|
+
// logger.info(`${Events.IoEventTypes.DEVICE_VALUES}: ${message.var.source} ${message.var.id} = ${message.var.value}`);
|
|
147
|
+
}
|
|
148
|
+
} catch (err) {
|
|
149
|
+
logger.error(`${Events.IoEventTypes.DEVICE_VALUES}: ${err}`);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
// client ask device browse
|
|
153
|
+
socket.on(Events.IoEventTypes.DEVICE_BROWSE, (message) => {
|
|
154
|
+
try {
|
|
155
|
+
if (message) {
|
|
156
|
+
if (message.device) {
|
|
157
|
+
devices.browseDevice(message.device, message.node, function (nodes) {
|
|
158
|
+
io.emit(Events.IoEventTypes.DEVICE_BROWSE, nodes);
|
|
159
|
+
}).then(result => {
|
|
160
|
+
message.result = result;
|
|
161
|
+
io.emit(Events.IoEventTypes.DEVICE_BROWSE, message);
|
|
162
|
+
}).catch(function (err) {
|
|
163
|
+
logger.error(`${Events.IoEventTypes.DEVICE_BROWSE}: ${err}`);
|
|
164
|
+
message.error = err;
|
|
165
|
+
io.emit(Events.IoEventTypes.DEVICE_BROWSE, message);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} catch (err) {
|
|
170
|
+
logger.error(`${Events.IoEventTypes.DEVICE_BROWSE}: ${err}`);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// client ask device node attribute
|
|
174
|
+
socket.on(Events.IoEventTypes.DEVICE_NODE_ATTRIBUTE, (message) => {
|
|
175
|
+
try {
|
|
176
|
+
if (message) {
|
|
177
|
+
if (message.device) {
|
|
178
|
+
devices.readNodeAttribute(message.device, message.node).then(result => {
|
|
179
|
+
io.emit(Events.IoEventTypes.DEVICE_NODE_ATTRIBUTE, message);
|
|
180
|
+
}).catch(function (err) {
|
|
181
|
+
logger.error(`${Events.IoEventTypes.DEVICE_NODE_ATTRIBUTE}: ${err}`);
|
|
182
|
+
message.error = err;
|
|
183
|
+
io.emit(Events.IoEventTypes.DEVICE_NODE_ATTRIBUTE, message);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} catch (err) {
|
|
188
|
+
logger.error(`${Events.IoEventTypes.DEVICE_NODE_ATTRIBUTE}: ${err}`);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
// client query DAQ values
|
|
192
|
+
socket.on(Events.IoEventTypes.DAQ_QUERY, (msg) => {
|
|
193
|
+
try {
|
|
194
|
+
if (msg && msg.from && msg.to && msg.sids && msg.sids.length) {
|
|
195
|
+
var dbfncs = [];
|
|
196
|
+
for (let i = 0; i < msg.sids.length; i++) {
|
|
197
|
+
dbfncs.push(daqstorage.getNodeValues(msg.sids[i], msg.from, msg.to));
|
|
198
|
+
}
|
|
199
|
+
Promise.all(dbfncs).then(values => {
|
|
200
|
+
io.emit(Events.IoEventTypes.DAQ_RESULT, { gid: msg.gid, result: values });
|
|
201
|
+
}, reason => {
|
|
202
|
+
if (reason && reason.stack) {
|
|
203
|
+
logger.error(`${Events.IoEventTypes.DAQ_QUERY}: ${reason.stack}`);
|
|
204
|
+
} else {
|
|
205
|
+
logger.error(`${Events.IoEventTypes.DAQ_QUERY}: ${reason}`);
|
|
206
|
+
}
|
|
207
|
+
io.emit(Events.IoEventTypes.DAQ_ERROR, { gid: msg.gid, error: reason });
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
} catch (err) {
|
|
211
|
+
logger.error(`${Events.IoEventTypes.DAQ_QUERY}: ${err}`);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
// client ask alarms status
|
|
215
|
+
socket.on(Events.IoEventTypes.ALARMS_STATUS, (message) => {
|
|
216
|
+
if (message === 'get') {
|
|
217
|
+
updateAlarmsStatus();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
// client ask host interfaces
|
|
221
|
+
socket.on(Events.IoEventTypes.HOST_INTERFACES, (message) => {
|
|
222
|
+
try {
|
|
223
|
+
if (message === 'get') {
|
|
224
|
+
message = {};
|
|
225
|
+
utils.getHostInterfaces().then(result => {
|
|
226
|
+
message.result = result;
|
|
227
|
+
io.emit(Events.IoEventTypes.HOST_INTERFACES, message);
|
|
228
|
+
}).catch(function (err) {
|
|
229
|
+
logger.error(`${Events.IoEventTypes.HOST_INTERFACES}: ${err}`);
|
|
230
|
+
message.error = err;
|
|
231
|
+
io.emit(Events.IoEventTypes.HOST_INTERFACES, message);
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
logger.error(`${Events.IoEventTypes.HOST_INTERFACES}: wrong message`);
|
|
235
|
+
message.error = 'wrong message';
|
|
236
|
+
io.emit(Events.IoEventTypes.HOST_INTERFACES, message);
|
|
237
|
+
}
|
|
238
|
+
} catch (err) {
|
|
239
|
+
logger.error(`${Events.IoEventTypes.HOST_INTERFACES}: ${err}`);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
// client ask device webapi request and return result
|
|
243
|
+
socket.on(Events.IoEventTypes.DEVICE_WEBAPI_REQUEST, (message) => {
|
|
244
|
+
try {
|
|
245
|
+
if (message && message.property) {
|
|
246
|
+
devices.getRequestResult(message.property).then(result => {
|
|
247
|
+
message.result = result;
|
|
248
|
+
io.emit(Events.IoEventTypes.DEVICE_WEBAPI_REQUEST, message);
|
|
249
|
+
}).catch(function (err) {
|
|
250
|
+
logger.error(`${Events.IoEventTypes.DEVICE_WEBAPI_REQUEST}: ${err}`);
|
|
251
|
+
message.error = err;
|
|
252
|
+
io.emit(Events.IoEventTypes.DEVICE_WEBAPI_REQUEST, message);
|
|
253
|
+
});
|
|
254
|
+
} else {
|
|
255
|
+
logger.error(`${Events.IoEventTypes.DEVICE_WEBAPI_REQUEST}: wrong message`);
|
|
256
|
+
message.error = 'wrong message';
|
|
257
|
+
io.emit(Events.IoEventTypes.DEVICE_WEBAPI_REQUEST, message);
|
|
258
|
+
}
|
|
259
|
+
} catch (err) {
|
|
260
|
+
logger.error(`${Events.IoEventTypes.DEVICE_WEBAPI_REQUEST}: ${err}`);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
// client ask device tags configurtions, used for connections that load tags dinamically (webapi)
|
|
264
|
+
socket.on(Events.IoEventTypes.DEVICE_TAGS_REQUEST, (message) => {
|
|
265
|
+
try {
|
|
266
|
+
if (message && message.deviceId) {
|
|
267
|
+
devices.getDeviceTagsResult(message.deviceId).then(result => {
|
|
268
|
+
message.result = result;
|
|
269
|
+
io.emit(Events.IoEventTypes.DEVICE_TAGS_REQUEST, message);
|
|
270
|
+
}).catch(function (err) {
|
|
271
|
+
logger.error(`${Events.IoEventTypes.DEVICE_TAGS_REQUEST}: ${err}`);
|
|
272
|
+
message.error = err;
|
|
273
|
+
io.emit(Events.IoEventTypes.DEVICE_TAGS_REQUEST, message);
|
|
274
|
+
});
|
|
275
|
+
} else {
|
|
276
|
+
logger.error(`${Events.IoEventTypes.DEVICE_TAGS_REQUEST}: wrong message`);
|
|
277
|
+
message.error = 'wrong message';
|
|
278
|
+
io.emit(Events.IoEventTypes.DEVICE_TAGS_REQUEST, message);
|
|
279
|
+
}
|
|
280
|
+
} catch (err) {
|
|
281
|
+
logger.error(`${Events.IoEventTypes.DEVICE_TAGS_REQUEST}: ${err}`);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
socket.on(Events.IoEventTypes.DEVICE_TAGS_SUBSCRIBE, (message) => {
|
|
285
|
+
try {
|
|
286
|
+
socket.tagsClientSubscriptions = message.tagsId
|
|
287
|
+
} catch (err) {
|
|
288
|
+
logger.error(`${Events.IoEventTypes.DEVICE_TAGS_SUBSCRIBE}: ${err}`);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
socket.on(Events.IoEventTypes.DEVICE_TAGS_UNSUBSCRIBE, (message) => {
|
|
292
|
+
try {
|
|
293
|
+
} catch (err) {
|
|
294
|
+
logger.error(`${Events.IoEventTypes.DEVICE_TAGS_UNSUBSCRIBE}: ${err}`);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
socket.on(Events.IoEventTypes.DEVICE_ENABLE, (message) => {
|
|
298
|
+
try {
|
|
299
|
+
devices.enableDevice(message.deviceName, message.enable);
|
|
300
|
+
} catch (err) {
|
|
301
|
+
logger.error(`${Events.IoEventTypes.DEVICE_ENABLE}: ${err}`);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function start() {
|
|
308
|
+
return new Promise(function (resolve, reject) {
|
|
309
|
+
// load project
|
|
310
|
+
project.load().then(result => {
|
|
311
|
+
// start to comunicate with devices
|
|
312
|
+
devices.start().then(function () {
|
|
313
|
+
resolve(true);
|
|
314
|
+
}).catch(function (err) {
|
|
315
|
+
logger.error('runtime.failed-to-start-devices: ' + err);
|
|
316
|
+
reject();
|
|
317
|
+
});
|
|
318
|
+
// start alarms manager
|
|
319
|
+
alarmsMgr.start().then(function () {
|
|
320
|
+
resolve(true);
|
|
321
|
+
}).catch(function (err) {
|
|
322
|
+
logger.error('runtime.failed-to-start-alarms: ' + err);
|
|
323
|
+
reject();
|
|
324
|
+
});
|
|
325
|
+
// start notificator manager
|
|
326
|
+
notificatorMgr.start().then(function () {
|
|
327
|
+
resolve(true);
|
|
328
|
+
}).catch(function (err) {
|
|
329
|
+
logger.error('runtime.failed-to-start-notificator: ' + err);
|
|
330
|
+
reject();
|
|
331
|
+
});
|
|
332
|
+
// start scripts manager
|
|
333
|
+
scriptsMgr.start().then(function () {
|
|
334
|
+
resolve(true);
|
|
335
|
+
}).catch(function (err) {
|
|
336
|
+
logger.error('runtime.failed-to-start-scripts: ' + err);
|
|
337
|
+
reject();
|
|
338
|
+
});
|
|
339
|
+
// start jobs manager
|
|
340
|
+
jobsMgr.start().then(function () {
|
|
341
|
+
resolve(true);
|
|
342
|
+
}).catch(function (err) {
|
|
343
|
+
logger.error('runtime.failed-to-start-jobs: ' + err);
|
|
344
|
+
reject();
|
|
345
|
+
});
|
|
346
|
+
}).catch(function (err) {
|
|
347
|
+
logger.error('runtime.failed-to-start: ' + err);
|
|
348
|
+
reject();
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function stop() {
|
|
354
|
+
return new Promise(function (resolve, reject) {
|
|
355
|
+
devices.stop().then(function () {
|
|
356
|
+
}).catch(function (err) {
|
|
357
|
+
logger.error('runtime.failed-to-stop-devices: ' + err);
|
|
358
|
+
});
|
|
359
|
+
alarmsMgr.stop().then(function () {
|
|
360
|
+
}).catch(function (err) {
|
|
361
|
+
logger.error('runtime.failed-to-stop-alarms: ' + err);
|
|
362
|
+
});
|
|
363
|
+
notificatorMgr.stop().then(function () {
|
|
364
|
+
}).catch(function (err) {
|
|
365
|
+
logger.error('runtime.failed-to-stop-notificatorMgr: ' + err);
|
|
366
|
+
});
|
|
367
|
+
scriptsMgr.stop().then(function () {
|
|
368
|
+
}).catch(function (err) {
|
|
369
|
+
logger.error('runtime.failed-to-stop-scriptsMgr: ' + err);
|
|
370
|
+
});
|
|
371
|
+
jobsMgr.stop().then(function () {
|
|
372
|
+
}).catch(function (err) {
|
|
373
|
+
logger.error('runtime.failed-to-stop-jobsMgr: ' + err);
|
|
374
|
+
});
|
|
375
|
+
resolve(true);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function update(cmd, data) {
|
|
380
|
+
return new Promise(function (resolve, reject) {
|
|
381
|
+
try {
|
|
382
|
+
if (cmd === project.ProjectDataCmdType.SetDevice) {
|
|
383
|
+
devices.updateDevice(data);
|
|
384
|
+
alarmsMgr.reset();
|
|
385
|
+
} else if (cmd === project.ProjectDataCmdType.DelDevice) {
|
|
386
|
+
devices.removeDevice(data);
|
|
387
|
+
alarmsMgr.reset();
|
|
388
|
+
} else if (cmd === project.ProjectDataCmdType.SetAlarm || cmd === project.ProjectDataCmdType.DelAlarm) {
|
|
389
|
+
alarmsMgr.reset();
|
|
390
|
+
notificatorMgr.reset();
|
|
391
|
+
} else if (cmd === project.ProjectDataCmdType.SetNotification || cmd === project.ProjectDataCmdType.DelNotification) {
|
|
392
|
+
notificatorMgr.reset();
|
|
393
|
+
} else if (cmd === project.ProjectDataCmdType.SetScript) {
|
|
394
|
+
scriptsMgr.updateScript(data);
|
|
395
|
+
} else if (cmd === project.ProjectDataCmdType.DelScript) {
|
|
396
|
+
scriptsMgr.removeScript(data);
|
|
397
|
+
} else if (cmd === project.ProjectDataCmdType.SetReport || cmd === project.ProjectDataCmdType.DelReport) {
|
|
398
|
+
jobsMgr.reset();
|
|
399
|
+
}
|
|
400
|
+
resolve(true);
|
|
401
|
+
} catch (err) {
|
|
402
|
+
if (err.stack) {
|
|
403
|
+
logger.error(err.stack);
|
|
404
|
+
} else {
|
|
405
|
+
logger.error(err);
|
|
406
|
+
}
|
|
407
|
+
reject();
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function restart(clear) {
|
|
413
|
+
return new Promise(function (resolve, reject) {
|
|
414
|
+
try {
|
|
415
|
+
stop().then(function () {
|
|
416
|
+
if (clear) {
|
|
417
|
+
alarmsMgr.clear();
|
|
418
|
+
notificatorMgr.clear();
|
|
419
|
+
}
|
|
420
|
+
logger.info('runtime.update-project: stopped!', true);
|
|
421
|
+
start().then(function () {
|
|
422
|
+
logger.info('runtime.update-project: restart!');
|
|
423
|
+
resolve(true);
|
|
424
|
+
}).catch(function (err) {
|
|
425
|
+
logger.error('runtime.update-project-start: ' + err);
|
|
426
|
+
reject();
|
|
427
|
+
});
|
|
428
|
+
}).catch(function (err) {
|
|
429
|
+
logger.error('runtime.update-project-stop: ' + err);
|
|
430
|
+
reject();
|
|
431
|
+
});
|
|
432
|
+
} catch (err) {
|
|
433
|
+
if (err.stack) {
|
|
434
|
+
logger.error(err.stack);
|
|
435
|
+
} else {
|
|
436
|
+
logger.error(err);
|
|
437
|
+
}
|
|
438
|
+
reject();
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
function updateDevice(event) {
|
|
445
|
+
console.log('emit updateDevice: ' + event);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Transmit the device values to all frontend
|
|
450
|
+
* @param {*} event
|
|
451
|
+
*/
|
|
452
|
+
function updateDeviceValues(event) {
|
|
453
|
+
try {
|
|
454
|
+
//!TOFIX
|
|
455
|
+
if (settings.broadcastAll === false) {
|
|
456
|
+
Object.values(io.sockets.sockets).forEach((socket) => {
|
|
457
|
+
const tags = Object.values(event.values).filter((tag) => {
|
|
458
|
+
return socket.tagsClientSubscriptions.includes(tag.id);
|
|
459
|
+
});
|
|
460
|
+
socket.emit(Events.IoEventTypes.DEVICE_VALUES, {
|
|
461
|
+
id: event.id,
|
|
462
|
+
values: Object.values(tags)
|
|
463
|
+
});
|
|
464
|
+
});
|
|
465
|
+
} else {
|
|
466
|
+
io.emit(Events.IoEventTypes.DEVICE_VALUES, {
|
|
467
|
+
id: event.id,
|
|
468
|
+
values: Object.values(event.values)
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
tagsSubscription.forEach((key, value) => {
|
|
472
|
+
if (event.values[value]) {
|
|
473
|
+
events.emit('tag-value:changed', event.values[value]);
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
} catch (err) {
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function subscriptionTagChange(tagid) {
|
|
481
|
+
try {
|
|
482
|
+
tagsSubscription.set(tagid, true);
|
|
483
|
+
} catch (err) {
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Transmit the device status to all frontend
|
|
489
|
+
* @param {*} event
|
|
490
|
+
*/
|
|
491
|
+
function updateDeviceStatus(event) {
|
|
492
|
+
try {
|
|
493
|
+
io.emit(Events.IoEventTypes.DEVICE_STATUS, event);
|
|
494
|
+
} catch (err) {
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Transmit the alarms status to all frontend
|
|
500
|
+
*/
|
|
501
|
+
function updateAlarmsStatus() {
|
|
502
|
+
try {
|
|
503
|
+
alarmsMgr.getAlarmsStatus().then(function (result) {
|
|
504
|
+
io.emit(Events.IoEventTypes.ALARMS_STATUS, result);
|
|
505
|
+
}).catch(function (err) {
|
|
506
|
+
if (err) {
|
|
507
|
+
logger.error('runtime.failed-to-update-alarms: ' + err);
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
} catch (err) {
|
|
511
|
+
logger.error('runtime.failed-to-update-alarms: ' + err);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Trasmit the scripts console output
|
|
517
|
+
* @param {*} output
|
|
518
|
+
*/
|
|
519
|
+
function scriptConsoleOutput(output) {
|
|
520
|
+
try {
|
|
521
|
+
io.emit(Events.IoEventTypes.SCRIPT_CONSOLE, output);
|
|
522
|
+
} catch (err) {
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Trasmit the scripts command to frontend (clients)
|
|
528
|
+
* @param {*} command
|
|
529
|
+
* @param {*} parameters
|
|
530
|
+
*/
|
|
531
|
+
function scriptSendCommand(command) {
|
|
532
|
+
try {
|
|
533
|
+
io.emit(Events.IoEventTypes.SCRIPT_COMMAND, command);
|
|
534
|
+
} catch (err) {
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
var runtime = module.exports = {
|
|
539
|
+
init: init,
|
|
540
|
+
project: project,
|
|
541
|
+
users: users,
|
|
542
|
+
plugins: plugins,
|
|
543
|
+
start: start,
|
|
544
|
+
stop: stop,
|
|
545
|
+
update: update,
|
|
546
|
+
restart: restart,
|
|
547
|
+
|
|
548
|
+
get io() { return io },
|
|
549
|
+
get logger() { return logger },
|
|
550
|
+
get settings() { return settings },
|
|
551
|
+
get devices() { return devices },
|
|
552
|
+
get daqStorage() { return daqstorage },
|
|
553
|
+
get alarmsMgr() { return alarmsMgr },
|
|
554
|
+
get notificatorMgr() { return notificatorMgr },
|
|
555
|
+
get scriptsMgr() { return scriptsMgr },
|
|
556
|
+
get jobsMgr() { return jobsMgr },
|
|
557
|
+
events: events,
|
|
558
|
+
scriptSendCommand: scriptSendCommand,
|
|
559
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Cleaner: delete/clear (database) operations
|
|
3
|
+
*/
|
|
4
|
+
var utils = require('../utils');
|
|
5
|
+
var fs = require('fs')
|
|
6
|
+
var path = require('path');
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
const timeRange = {from: 1, to: 2};
|
|
10
|
+
|
|
11
|
+
function Cleaner(_runtime) {
|
|
12
|
+
var runtime = _runtime;
|
|
13
|
+
var logger = runtime.logger;
|
|
14
|
+
var currentTime = 0;
|
|
15
|
+
var lastExecuted;
|
|
16
|
+
|
|
17
|
+
this.execute = function (time, force) {
|
|
18
|
+
currentTime = time;
|
|
19
|
+
return new Promise(async function (resolve, reject) {
|
|
20
|
+
try {
|
|
21
|
+
if (!_isToExecute(time) && !force) {
|
|
22
|
+
resolve(true);
|
|
23
|
+
} else {
|
|
24
|
+
const clearFncs = [await runtime.daqStorage.checkRetention(),
|
|
25
|
+
await runtime.alarmsMgr.checkRetention()];
|
|
26
|
+
|
|
27
|
+
Promise.all(clearFncs).then(values => {
|
|
28
|
+
lastExecuted = currentTime;
|
|
29
|
+
resolve();
|
|
30
|
+
}, reason => {
|
|
31
|
+
if (reason && reason.stack) {
|
|
32
|
+
logger.error(`Cleaner.execute: ${reason.stack}`);
|
|
33
|
+
} else {
|
|
34
|
+
logger.error(`Cleaner.execute: ${reason}`);
|
|
35
|
+
}
|
|
36
|
+
reject(reason);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
} catch (err) {
|
|
40
|
+
reject(err);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this.getProperty = function () {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var _isToExecute = function (date) {
|
|
50
|
+
// 1 time per day
|
|
51
|
+
if (inTimeToExecute(date.getHours()) && utils.dayOfYear(lastExecuted) !== utils.dayOfYear(date)) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function inTimeToExecute(hour) {
|
|
59
|
+
return (hour >= timeRange.from && hour <= timeRange.to);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
const ReportDateRangeType = {
|
|
64
|
+
none: 'none',
|
|
65
|
+
day: 'day',
|
|
66
|
+
week: 'week',
|
|
67
|
+
month: 'month',
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
module.exports = {
|
|
71
|
+
create: function (property, runtime) {
|
|
72
|
+
return new Cleaner(property, runtime);
|
|
73
|
+
},
|
|
74
|
+
}
|