@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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019-2021 frangoteam 4frango@gmail.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+

|
|
2
|
+
# FUXA
|
|
3
|
+
FUXA is a web-based Process Visualization (SCADA/HMI/Dashboard) software. With FUXA you can create modern process visualizations with individual designs for your machines and real-time data display.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
- Devices connectivity with Modbus RTU/TCP, OPC-UA, BACnet IP, MQTT, WebAPI, Ethernet/IP (Allen Bradley)
|
|
13
|
+
- SCADA/HMI Web-Editor - Engineering and Design completely web-based
|
|
14
|
+
- Cross-Platform Full-Stack - Backend with NodeJs and Frontend with Web technologies (HTML5, CSS, Javascript, Angular, SVG)
|
|
15
|
+
|
|
16
|
+
## Live Demo
|
|
17
|
+
Here is a [live demo](https://frangoteam.github.io) example of FUXA editor.
|
|
18
|
+
|
|
19
|
+
## Installing and Running
|
|
20
|
+
FUXA is developed with NodeJS (backend) and Angular (frontend).
|
|
21
|
+
|
|
22
|
+
**WARNING** You need to have installed [Node](https://nodejs.org/en/about/previous-releases) Version 14 || 16 || 18
|
|
23
|
+
|
|
24
|
+
Install from [NPM](https://www.npmjs.com/package/@frangoteam/fuxa-sim)
|
|
25
|
+
```
|
|
26
|
+
npm install -g --unsafe-perm @frangoteam/fuxa-sim
|
|
27
|
+
fuxa
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Open up a browser (better Chrome) and navigate to http://localhost:1881
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
Look the guide in [wiki](https://github.com/frangoteam/FUXA/wiki) pages
|
|
34
|
+
|
|
35
|
+
## Let us know!
|
|
36
|
+
We’d be really happy if you send us your own shapes in order to collect a library to share it with others. Just send an email to 4frango@gmail.com and do let us know if you have any questions or suggestions regarding our work.
|
|
37
|
+
|
|
38
|
+
## <a href="https://discord.gg/WZhxz9uHh4" target="_blank" > <img src="https://skillicons.dev/icons?i=discord" alt=""></a>
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
MIT.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"[]><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64px" height="64px" viewBox="0 0 98.043 112.5" enable-background="new 0 0 98.043 112.5" xml:space="preserve">
|
|
2
|
+
|
|
3
|
+
<g id="Group_30_Deg_Pipe">
|
|
4
|
+
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5.4983" y1="69.9102" x2="96.4444" y2="53.8739">
|
|
5
|
+
<stop offset="0.01" style="stop-color:#646566" />
|
|
6
|
+
<stop offset="0.49" style="stop-color:#CCCCCC" />
|
|
7
|
+
<stop offset="1" style="stop-color:#646566" />
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<path fill="url(#SVGID_1_)" d="M19.83,112.388l-0.25-39.671L0.098,39.284L67.983,0.112c0,0,23.453,37.924,25.948,46.158 s4.014,13.972,4.014,17.964c0,3.991,0,48.153,0,48.153H19.83z" />
|
|
10
|
+
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="81.7634" y1="71.0283" x2="81.7634" y2="-7.6465" gradientTransform="matrix(0 1 1 0 27.3308 6.6702)">
|
|
11
|
+
<stop offset="0.01" style="stop-color:#646566" />
|
|
12
|
+
<stop offset="0.16" style="stop-color:#909091" />
|
|
13
|
+
<stop offset="0.49" style="stop-color:#E0E0E0" />
|
|
14
|
+
<stop offset="1" style="stop-color:#646566" />
|
|
15
|
+
</linearGradient>
|
|
16
|
+
<path fill="url(#SVGID_2_)" d="M98.359,68.311v44.023H19.798l-0.113-47.802L98.359,68.311z" />
|
|
17
|
+
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="10.3582" y1="51.5098" x2="50.0603" y2="-17.2564" gradientTransform="matrix(0 1 1 0 27.3308 6.6702)">
|
|
18
|
+
<stop offset="0.01" style="stop-color:#646566" />
|
|
19
|
+
<stop offset="0.16" style="stop-color:#909091" />
|
|
20
|
+
<stop offset="0.49" style="stop-color:#E0E0E0" />
|
|
21
|
+
<stop offset="1" style="stop-color:#646566" />
|
|
22
|
+
</linearGradient>
|
|
23
|
+
<path fill="url(#SVGID_3_)" d="M68.191,0l19.643,32.604L20.262,74.115L0,39.28L68.191,0z" />
|
|
24
|
+
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="34.9104" y1="69.6563" x2="49.3619" y2="-8.1895" gradientTransform="matrix(0.2501 0.9682 0.9682 -0.2501 16.0898 24.9472)">
|
|
25
|
+
<stop offset="0.01" style="stop-color:#646566" />
|
|
26
|
+
<stop offset="0.16" style="stop-color:#909091" />
|
|
27
|
+
<stop offset="0.49" style="stop-color:#E0E0E0" />
|
|
28
|
+
<stop offset="1" style="stop-color:#646566" />
|
|
29
|
+
</linearGradient>
|
|
30
|
+
<path fill="url(#SVGID_4_)" d="M19.684,73.024l67.793-41.096c0,0,3.701,6.927,4.743,9.326c1.063,2.444,3.646,10.021,3.646,10.021 L19.684,73.024z" />
|
|
31
|
+
<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="53.1277" y1="71.4404" x2="61.4217" y2="-7.6076" gradientTransform="matrix(0.0176 0.9998 0.9998 -0.0176 25.7504 7.737)">
|
|
32
|
+
<stop offset="0.01" style="stop-color:#646566" />
|
|
33
|
+
<stop offset="0.17" style="stop-color:#8F8F90" />
|
|
34
|
+
<stop offset="0.49" style="stop-color:#E0E0E0" />
|
|
35
|
+
<stop offset="1" style="stop-color:#646566" />
|
|
36
|
+
</linearGradient>
|
|
37
|
+
<path fill="url(#SVGID_5_)" d="M19.684,73.024l75.908-22.709c0,0,2.418,8.415,2.767,11.304c0.226,1.871,0,7.538,0,7.538 L19.684,73.024z" />
|
|
38
|
+
</g>
|
|
39
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"[]><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64px" height="64px" viewBox="0 0 80.295 112.5" enable-background="new 0 0 80.295 112.5" xml:space="preserve">
|
|
2
|
+
<g id="Group_TankBody">
|
|
3
|
+
<path fill="#C0C0C0" d="M80.292,13.889C80.292,6.218,62.319,0,40.147,0C17.976,0,0.002,6.218,0.002,13.889H0.001v66.526 l22.41,32.085h35.36l22.522-32.085V13.889H80.292z" />
|
|
4
|
+
<path fill="none" stroke="#4C4C4C" stroke-width="0.25" d="M0.113,13.063h79.955" />
|
|
5
|
+
<path fill="none" stroke="#4C4C4C" stroke-width="0.25" d="M0.113,80.18h79.955" />
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/alarms': Alarms API to GET/POST alarms data
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var express = require("express");
|
|
6
|
+
const authJwt = require('../jwt-helper');
|
|
7
|
+
var runtime;
|
|
8
|
+
var secureFnc;
|
|
9
|
+
var checkGroupsFnc;
|
|
10
|
+
|
|
11
|
+
module.exports = {
|
|
12
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
13
|
+
runtime = _runtime;
|
|
14
|
+
secureFnc = _secureFnc;
|
|
15
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
16
|
+
},
|
|
17
|
+
app: function() {
|
|
18
|
+
var alarmsApp = express();
|
|
19
|
+
alarmsApp.use(function(req, res, next) {
|
|
20
|
+
if (!runtime.project) {
|
|
21
|
+
res.status(404).end();
|
|
22
|
+
} else {
|
|
23
|
+
next();
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* GET current Alarms
|
|
29
|
+
* Take from alarms storage and reply
|
|
30
|
+
*/
|
|
31
|
+
alarmsApp.get("/api/alarms", secureFnc, function(req, res) {
|
|
32
|
+
var groups = checkGroupsFnc(req);
|
|
33
|
+
if (res.statusCode === 403) {
|
|
34
|
+
runtime.logger.error("api get alarms: Tocken Expired");
|
|
35
|
+
} else {
|
|
36
|
+
try {
|
|
37
|
+
var result = runtime.alarmsMgr.getAlarmsValues(req.query, groups);
|
|
38
|
+
// res.header("Access-Control-Allow-Origin", "*");
|
|
39
|
+
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
40
|
+
if (result) {
|
|
41
|
+
res.json(result);
|
|
42
|
+
} else {
|
|
43
|
+
res.end();
|
|
44
|
+
}
|
|
45
|
+
} catch (err) {
|
|
46
|
+
if (err.code) {
|
|
47
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
48
|
+
} else {
|
|
49
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
50
|
+
}
|
|
51
|
+
runtime.logger.error("api get alarms: " + err.message);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* GET current Alarms
|
|
58
|
+
* Take from alarms storage and reply
|
|
59
|
+
*/
|
|
60
|
+
alarmsApp.get("/api/alarmsHistory", secureFnc, function(req, res) {
|
|
61
|
+
var groups = checkGroupsFnc(req);
|
|
62
|
+
if (res.statusCode === 403) {
|
|
63
|
+
runtime.logger.error("api get alarms: Tocken Expired");
|
|
64
|
+
} else {
|
|
65
|
+
runtime.alarmsMgr.getAlarmsHistory(req.query, groups).then(result => {
|
|
66
|
+
// res.header("Access-Control-Allow-Origin", "*");
|
|
67
|
+
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
68
|
+
if (result) {
|
|
69
|
+
res.json(result);
|
|
70
|
+
} else {
|
|
71
|
+
res.end();
|
|
72
|
+
}
|
|
73
|
+
}).catch(function(err) {
|
|
74
|
+
if (err.code) {
|
|
75
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
76
|
+
} else {
|
|
77
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
78
|
+
}
|
|
79
|
+
runtime.logger.error("api get alarms: " + err.message);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* POST Alarm ACK
|
|
86
|
+
* Set alarm ack
|
|
87
|
+
*/
|
|
88
|
+
alarmsApp.post("/api/alarmack", secureFnc, function(req, res, next) {
|
|
89
|
+
var groups = checkGroupsFnc(req);
|
|
90
|
+
if (res.statusCode === 403) {
|
|
91
|
+
runtime.logger.error("api post alarms: Tocken Expired");
|
|
92
|
+
} else {
|
|
93
|
+
runtime.alarmsMgr.setAlarmAck(req.body.params, req.userId, groups).then(function(data) {
|
|
94
|
+
res.end();
|
|
95
|
+
}).catch(function(err) {
|
|
96
|
+
if (err.code) {
|
|
97
|
+
res.status(err.code).json({error:err.code, message: err.message});
|
|
98
|
+
} else {
|
|
99
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
100
|
+
}
|
|
101
|
+
runtime.logger.error("api post alarm-ack: " + err.message);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* POST Alarms clear
|
|
108
|
+
*/
|
|
109
|
+
alarmsApp.post("/api/alarmsClear", secureFnc, function(req, res, next) {
|
|
110
|
+
var groups = checkGroupsFnc(req);
|
|
111
|
+
if (res.statusCode === 403) {
|
|
112
|
+
runtime.logger.error("api post alarms: Tocken Expired");
|
|
113
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
114
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
115
|
+
runtime.logger.error("api post alarms: Unauthorized");
|
|
116
|
+
} else {
|
|
117
|
+
runtime.alarmsMgr.clearAlarms(req.body.params).then(function() {
|
|
118
|
+
runtime.alarmsMgr.reset();
|
|
119
|
+
res.end();
|
|
120
|
+
}).catch(function(err) {
|
|
121
|
+
if (err.code) {
|
|
122
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
123
|
+
} else {
|
|
124
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
125
|
+
}
|
|
126
|
+
runtime.logger.error("api post alarms-clear: " + err.message);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return alarmsApp;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/auth': Authentication API to Sign In/Out users
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var express = require('express');
|
|
6
|
+
const bcrypt = require('bcryptjs');
|
|
7
|
+
const jwt = require('jsonwebtoken');
|
|
8
|
+
const authJwt = require('../jwt-helper');
|
|
9
|
+
|
|
10
|
+
var runtime;
|
|
11
|
+
var secretCode;
|
|
12
|
+
var tokenExpiresIn;
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
init: function (_runtime, _secretCode, _tokenExpires) {
|
|
16
|
+
runtime = _runtime;
|
|
17
|
+
secretCode = _secretCode;
|
|
18
|
+
tokenExpiresIn = _tokenExpires;
|
|
19
|
+
},
|
|
20
|
+
app: function () {
|
|
21
|
+
var authApp = express();
|
|
22
|
+
authApp.use(function (req, res, next) {
|
|
23
|
+
if (!runtime.project) {
|
|
24
|
+
res.status(404).end();
|
|
25
|
+
} else {
|
|
26
|
+
next();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* POST SignIn
|
|
32
|
+
* Sign In with User credentials
|
|
33
|
+
*/
|
|
34
|
+
authApp.post('/api/signin', function (req, res, next) {
|
|
35
|
+
runtime.users.findOne(req.body).then(function (userInfo) {
|
|
36
|
+
if (userInfo && userInfo.length && userInfo[0].password) {
|
|
37
|
+
if (bcrypt.compareSync(req.body.password, userInfo[0].password)) {
|
|
38
|
+
const token = jwt.sign({ id: userInfo[0].username, groups: userInfo[0].groups }, secretCode, { expiresIn: tokenExpiresIn });//'1h' });
|
|
39
|
+
res.json({
|
|
40
|
+
status: 'success',
|
|
41
|
+
message: 'user found!!!',
|
|
42
|
+
data: {
|
|
43
|
+
username: userInfo[0].username,
|
|
44
|
+
fullname: userInfo[0].fullname,
|
|
45
|
+
groups: userInfo[0].groups,
|
|
46
|
+
info: userInfo[0].info,
|
|
47
|
+
token: token
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
runtime.logger.info('api-signin: ' + userInfo[0].username + ' ' + userInfo[0].fullname + ' ' + userInfo[0].groups);
|
|
51
|
+
} else {
|
|
52
|
+
res.status(401).json({ status: 'error', message: 'Invalid email/password!!!', data: null });
|
|
53
|
+
runtime.logger.error('api post signin: Invalid email/password!!!');
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
res.status(404).end();
|
|
57
|
+
runtime.logger.error('api post signin: Not Found!');
|
|
58
|
+
}
|
|
59
|
+
}).catch(function (err) {
|
|
60
|
+
if (err.code) {
|
|
61
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
62
|
+
} else {
|
|
63
|
+
res.status(400).json({error:'unexpected_error', message:err.toString()});
|
|
64
|
+
}
|
|
65
|
+
runtime.logger.error('api post signin: ' + err.message);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return authApp;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/command': Command API to process command like build Report
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var express = require("express");
|
|
6
|
+
const authJwt = require('../jwt-helper');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
var runtime;
|
|
10
|
+
var secureFnc;
|
|
11
|
+
var checkGroupsFnc;
|
|
12
|
+
|
|
13
|
+
module.exports = {
|
|
14
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
15
|
+
runtime = _runtime;
|
|
16
|
+
secureFnc = _secureFnc;
|
|
17
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
18
|
+
},
|
|
19
|
+
app: function () {
|
|
20
|
+
var commandApp = express();
|
|
21
|
+
commandApp.use(function (req, res, next) {
|
|
22
|
+
if (!runtime.project) {
|
|
23
|
+
res.status(404).end();
|
|
24
|
+
} else {
|
|
25
|
+
next();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* POST build report
|
|
31
|
+
*/
|
|
32
|
+
commandApp.post("/api/command", secureFnc, function (req, res, next) {
|
|
33
|
+
var groups = checkGroupsFnc(req);
|
|
34
|
+
if (res.statusCode === 403) {
|
|
35
|
+
runtime.logger.error("api post command: Tocken Expired");
|
|
36
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
37
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
38
|
+
runtime.logger.error("api post command: Unauthorized");
|
|
39
|
+
} else {
|
|
40
|
+
try {
|
|
41
|
+
if (req.body.params.cmd === CommanTypeEnum.reportBuild) {
|
|
42
|
+
if (runtime.jobsMgr.forceReport(req.body.params.report)) {
|
|
43
|
+
res.end();
|
|
44
|
+
} else {
|
|
45
|
+
res.status(400).json({ error: "not_found", message: 'report not found!'});
|
|
46
|
+
runtime.logger.error("api post buildreport: " + 'report not found!');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} catch (error) {
|
|
50
|
+
res.status(400).json({ error: "error", message: error});
|
|
51
|
+
runtime.logger.error("api post buildreport: " + error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* GET download
|
|
58
|
+
*/
|
|
59
|
+
commandApp.get('/api/download', secureFnc, function(req, res){
|
|
60
|
+
var groups = checkGroupsFnc(req);
|
|
61
|
+
if (res.statusCode === 403) {
|
|
62
|
+
runtime.logger.error("api post command: Tocken Expired");
|
|
63
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
64
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
65
|
+
runtime.logger.error("api post command: Unauthorized");
|
|
66
|
+
} else {
|
|
67
|
+
if (req.query.cmd === CommanTypeEnum.reportDownload) {
|
|
68
|
+
try {
|
|
69
|
+
const fileName = req.query.name.replace(new RegExp('../', 'g'), '');
|
|
70
|
+
var reportPath = path.join(runtime.settings.reportsDir, fileName);
|
|
71
|
+
if (!fs.existsSync(reportPath)) {
|
|
72
|
+
reportPath = path.join(process.cwd(), runtime.settings.reportsDir, fileName);
|
|
73
|
+
}
|
|
74
|
+
if (fs.existsSync(reportPath)) {
|
|
75
|
+
res.sendFile(reportPath, (err) => {
|
|
76
|
+
if (err) {
|
|
77
|
+
runtime.logger.error("api get download: " + err);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
res.status(400).json({ error: "not_found", message: 'report not found!'});
|
|
82
|
+
runtime.logger.error("api get download: " + 'report not found!');
|
|
83
|
+
}
|
|
84
|
+
} catch (error) {
|
|
85
|
+
res.status(400).json({ error: 'error', message: error});
|
|
86
|
+
runtime.logger.error("api get download: " + error);
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
res.status(400).json({ error: "not_found", message: 'command not found!'});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* GET get tags values
|
|
96
|
+
*/
|
|
97
|
+
commandApp.get("/api/getTagValue", secureFnc, async function (req, res, next) {
|
|
98
|
+
var groups = checkGroupsFnc(req);
|
|
99
|
+
if (res.statusCode === 403) {
|
|
100
|
+
runtime.logger.error("api get getTagValue: Tocken Expired");
|
|
101
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
102
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
103
|
+
runtime.logger.error("api get getTagValue: Unauthorized");
|
|
104
|
+
} else {
|
|
105
|
+
try {
|
|
106
|
+
var tagsIds = JSON.parse(req.query.ids);
|
|
107
|
+
if (tagsIds) {
|
|
108
|
+
var errors = '';
|
|
109
|
+
var result = [];
|
|
110
|
+
for (const tagId of tagsIds) {
|
|
111
|
+
try {
|
|
112
|
+
const value = runtime.devices.getTagValue(tagId, true);
|
|
113
|
+
if (value) {
|
|
114
|
+
result.push(value);
|
|
115
|
+
} else {
|
|
116
|
+
result.push({id: tagId, value: null});
|
|
117
|
+
errors += `${tagId}; `;
|
|
118
|
+
}
|
|
119
|
+
} catch (err) {
|
|
120
|
+
errors += `${tagId}: ${err}`;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (errors) {
|
|
124
|
+
runtime.logger.error("api get getTagValue: " + 'id not found!' + errors);
|
|
125
|
+
}
|
|
126
|
+
res.json(result);
|
|
127
|
+
} else {
|
|
128
|
+
res.status(400).json({ error: "not_found", message: 'tag id not found!'});
|
|
129
|
+
runtime.logger.error("api get getTagValue: " + 'id not found!');
|
|
130
|
+
}
|
|
131
|
+
} catch (error) {
|
|
132
|
+
res.status(400).json({ error: "error", message: error});
|
|
133
|
+
runtime.logger.error("api get getTagValue: " + error);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* POST set tags values
|
|
140
|
+
*/
|
|
141
|
+
commandApp.post("/api/setTagValue", secureFnc, async function (req, res, next) {
|
|
142
|
+
var groups = checkGroupsFnc(req);
|
|
143
|
+
if (res.statusCode === 403) {
|
|
144
|
+
runtime.logger.error("api post setTagValue: Tocken Expired");
|
|
145
|
+
} else if (authJwt.adminGroups.indexOf(groups) === -1 ) {
|
|
146
|
+
res.status(401).json({error:"unauthorized_error", message: "Unauthorized!"});
|
|
147
|
+
runtime.logger.error("api post setTagValue: Unauthorized");
|
|
148
|
+
} else {
|
|
149
|
+
try {
|
|
150
|
+
if (req.body.tags) {
|
|
151
|
+
var errors = '';
|
|
152
|
+
for (const tag of req.body.tags) {
|
|
153
|
+
try {
|
|
154
|
+
if (!runtime.devices.setTagValue(tag.id, tag.value)) {
|
|
155
|
+
errors += `${tag.id}; `
|
|
156
|
+
}
|
|
157
|
+
} catch (err) {
|
|
158
|
+
errors += `${tag.id}: ${err}`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (errors) {
|
|
162
|
+
res.status(400).json({ error: "not_found", message: 'tag id not found: ' + errors});
|
|
163
|
+
runtime.logger.error("api post setTagValue: " + 'id not found!' + errors);
|
|
164
|
+
} else {
|
|
165
|
+
res.end();
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
res.status(400).json({ error: "not_found", message: 'tag id not found!'});
|
|
169
|
+
runtime.logger.error("api post setTagValue: " + 'id not found!');
|
|
170
|
+
}
|
|
171
|
+
} catch (error) {
|
|
172
|
+
res.status(400).json({ error: "error", message: error});
|
|
173
|
+
runtime.logger.error("api post setTagValue: " + error);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
return commandApp;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
const CommanTypeEnum = {
|
|
184
|
+
reportBuild: 'REPORT-BUILD',
|
|
185
|
+
reportDelete: 'REPORT-DELETE',
|
|
186
|
+
reportDownload: 'REPORT-DOWNLOAD'
|
|
187
|
+
};
|
package/api/daq/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 'api/daq': DAQ API to GET/POST storage daq data
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var express = require("express");
|
|
6
|
+
const authJwt = require('../jwt-helper');
|
|
7
|
+
|
|
8
|
+
var runtime;
|
|
9
|
+
var secureFnc;
|
|
10
|
+
var checkGroupsFnc;
|
|
11
|
+
|
|
12
|
+
module.exports = {
|
|
13
|
+
init: function (_runtime, _secureFnc, _checkGroupsFnc) {
|
|
14
|
+
runtime = _runtime;
|
|
15
|
+
secureFnc = _secureFnc;
|
|
16
|
+
checkGroupsFnc = _checkGroupsFnc;
|
|
17
|
+
},
|
|
18
|
+
app: function () {
|
|
19
|
+
var daqApp = express();
|
|
20
|
+
daqApp.use(function (req, res, next) {
|
|
21
|
+
if (!runtime.project) {
|
|
22
|
+
res.status(404).end();
|
|
23
|
+
} else {
|
|
24
|
+
next();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* GET daq data
|
|
30
|
+
* Take from daq storage data and reply
|
|
31
|
+
*/
|
|
32
|
+
daqApp.get("/api/daq", secureFnc, function(req, res) {
|
|
33
|
+
try {
|
|
34
|
+
if (req.query && req.query.query) {
|
|
35
|
+
var query = JSON.parse(req.query.query);
|
|
36
|
+
var dbfncs = [];
|
|
37
|
+
for (let i = 0; i < query.sids.length; i++) {
|
|
38
|
+
if (query.to === query.from) { // current values
|
|
39
|
+
dbfncs.push([runtime.devices.getTagValue(query.sids[i], true)]);
|
|
40
|
+
} else { // from history
|
|
41
|
+
dbfncs.push(runtime.daqStorage.getNodeValues(query.sids[i], query.from, query.to));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (query.to === query.from) { // current values
|
|
45
|
+
res.json(dbfncs);
|
|
46
|
+
} else {
|
|
47
|
+
Promise.all(dbfncs).then(values => {
|
|
48
|
+
if (values) {
|
|
49
|
+
res.json(values);
|
|
50
|
+
} else {
|
|
51
|
+
res.status(404).end();
|
|
52
|
+
runtime.logger.error("api get daq: Not Found!");
|
|
53
|
+
}
|
|
54
|
+
}, reason => {
|
|
55
|
+
if (reason && reason.stack) {
|
|
56
|
+
runtime.logger.error(`api get daq: Not Found!: ${reason.stack}`);
|
|
57
|
+
res.status(400).json({error:"unexpected_error", message: reason.stack});
|
|
58
|
+
} else {
|
|
59
|
+
runtime.logger.error(`api get daq: Not Found!: ${reason}`);
|
|
60
|
+
res.status(400).json({error:"unexpected_error", message: reason});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
res.status(404).end();
|
|
66
|
+
runtime.logger.error("api get daq: Not Found!");
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
if (err && err.code) {
|
|
70
|
+
res.status(400).json({error:err.code, message: err.message});
|
|
71
|
+
} else {
|
|
72
|
+
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
|
73
|
+
}
|
|
74
|
+
runtime.logger.error("api get daq: " + err.message);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return daqApp;
|
|
78
|
+
}
|
|
79
|
+
}
|