@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
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Report: get data, create/send/store pdf
|
|
3
|
+
*/
|
|
4
|
+
const utils = require('../utils');
|
|
5
|
+
const Pdfmake = require('pdfmake');
|
|
6
|
+
var fs = require('fs')
|
|
7
|
+
var path = require('path');
|
|
8
|
+
// TODO wait compatibility with arm
|
|
9
|
+
// const imageGenerator = require('./helper/image-generator');
|
|
10
|
+
const { time } = require('console');
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
function Report(_property, _runtime) {
|
|
15
|
+
var property = _property;
|
|
16
|
+
var runtime = _runtime;
|
|
17
|
+
var logger = runtime.logger;
|
|
18
|
+
var currentTime = 0;
|
|
19
|
+
var lastExecuted;
|
|
20
|
+
|
|
21
|
+
this.execute = function (time, force) {
|
|
22
|
+
currentTime = time;
|
|
23
|
+
return new Promise(async function (resolve, reject) {
|
|
24
|
+
try {
|
|
25
|
+
if (!_isToExecute(time) && !force) {
|
|
26
|
+
resolve(true);
|
|
27
|
+
} else {
|
|
28
|
+
await _createPdfBinary().then(filepath => {
|
|
29
|
+
if (property.receiver) {
|
|
30
|
+
let subject = `Report ${property.name}`;
|
|
31
|
+
let attachments = { path: filepath };
|
|
32
|
+
runtime.notificatorMgr.sendMailMessage(null, property.receiver, subject, '', null, attachments).then(function () {
|
|
33
|
+
logger.info(`report.sended.successful: ${new Date()} ${property.receiver} ${property.name}`);
|
|
34
|
+
}).catch(function (senderr) {
|
|
35
|
+
logger.error(`report.send.failed: ${senderr}`);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
lastExecuted = currentTime;
|
|
39
|
+
resolve(filepath);
|
|
40
|
+
}).catch(function (err) {
|
|
41
|
+
reject(err);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
} catch (err) {
|
|
45
|
+
reject(err);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
this.getProperty = function () {
|
|
51
|
+
return property;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
this.getChartImage = function (itemChart, values) {
|
|
55
|
+
return _getChartImage(itemChart, values);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var _getSampleValues = function (lines, timeRange) {
|
|
59
|
+
let result = {};
|
|
60
|
+
lines.forEach(line => {
|
|
61
|
+
result[line.id] = [{x: timeRange.begin, y: Math.floor(Math.random() * 100)},
|
|
62
|
+
{x: timeRange.end, y: Math.floor(Math.random() * 100)}];
|
|
63
|
+
});
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var _isToExecute = function (date) {
|
|
68
|
+
if (inTimeToExecute(date.getHours()) && utils.dayOfYear(lastExecuted) !== utils.dayOfYear(date)) {
|
|
69
|
+
if (property.scheduling === ReportSchedulingType.day) {
|
|
70
|
+
return true;
|
|
71
|
+
} else if (property.scheduling === ReportSchedulingType.week && date.getDay() === 1) { // monday
|
|
72
|
+
return true;
|
|
73
|
+
} else if (property.scheduling === ReportSchedulingType.month && date.getDate() === 1) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var _createPdfBinary = function () {
|
|
81
|
+
return new Promise(async function (resolve, reject) {
|
|
82
|
+
var fonts = {
|
|
83
|
+
Roboto: {
|
|
84
|
+
normal: path.join(__dirname, 'fonts/Roboto-Regular.ttf'),
|
|
85
|
+
bold: path.join(__dirname, 'fonts/Roboto-Medium.ttf'),
|
|
86
|
+
italics: path.join(__dirname, 'fonts/Roboto-Italic.ttf'),
|
|
87
|
+
bolditalics: path.join(__dirname, 'fonts/Roboto-MediumItalic.ttf')
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
let pdfmake = new Pdfmake(fonts);
|
|
91
|
+
await _getPdfContent(property).then(content => {
|
|
92
|
+
let docPath = path.join(runtime.settings.reportsDir,`${property.name}_${utils.getDate(new Date())}.pdf`);
|
|
93
|
+
pdfDoc = pdfmake.createPdfKitDocument(content, {});
|
|
94
|
+
const stream = fs.createWriteStream(docPath);
|
|
95
|
+
pdfDoc.pipe(stream);
|
|
96
|
+
pdfDoc.end();
|
|
97
|
+
stream.on("finish", function() {
|
|
98
|
+
resolve(docPath);
|
|
99
|
+
});
|
|
100
|
+
}).catch(function (err) {
|
|
101
|
+
reject(err);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
var _getPdfContent = function (report) {
|
|
107
|
+
return new Promise(async function (resolve, reject) {
|
|
108
|
+
try {
|
|
109
|
+
let docDefinition = {...report.docproperty };
|
|
110
|
+
docDefinition['header'] = { text: 'FUXA by frangoteam', style:[{fontSize: 6}]};
|
|
111
|
+
docDefinition['footer'] = function(currentPage, pageCount) {
|
|
112
|
+
return { text: currentPage.toString() + ' / ' + pageCount, style:[{alignment: 'right', fontSize: 8}]} ;
|
|
113
|
+
},
|
|
114
|
+
docDefinition['content'] = [];
|
|
115
|
+
for (let i = 0; i < report.content.items.length; i++) {
|
|
116
|
+
let item = report.content.items[i];
|
|
117
|
+
if (item.type === 'text') {
|
|
118
|
+
docDefinition['content'].push({ text: item.text, style: [{ alignment: item.align, fontSize: item.size }] });
|
|
119
|
+
} else if (item.type === 'table') {
|
|
120
|
+
await _getTableContent(item).then(itemTable => {
|
|
121
|
+
const tableDateRange = _getDateRange(item.range);
|
|
122
|
+
docDefinition['content'].push({ text: `${tableDateRange.begin.toLocaleDateString()} - ${tableDateRange.end.toLocaleDateString()}`,
|
|
123
|
+
style: [{ fontSize: item.size }] });
|
|
124
|
+
docDefinition['content'].push(itemTable);
|
|
125
|
+
});
|
|
126
|
+
} else if (item.type === 'alarms') {
|
|
127
|
+
await _getAlarmsContent(item).then(itemAlarms => {
|
|
128
|
+
const alarmsDateRange = _getDateRange(item.range);
|
|
129
|
+
docDefinition['content'].push({ text: `${alarmsDateRange.begin.toLocaleDateString()} - ${alarmsDateRange.end.toLocaleDateString()}`,
|
|
130
|
+
style: [{ fontSize: item.size }] });
|
|
131
|
+
docDefinition['content'].push(itemAlarms);
|
|
132
|
+
});
|
|
133
|
+
} else if (item.type === 'chart') {
|
|
134
|
+
await _getChartContent(item).then(itemChart => {
|
|
135
|
+
docDefinition['content'].push(itemChart);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
resolve(docDefinition);
|
|
140
|
+
} catch (err) {
|
|
141
|
+
reject(err);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var _getTableContent = function (item) {
|
|
147
|
+
return new Promise(async function (resolve, reject) {
|
|
148
|
+
try {
|
|
149
|
+
let content = { layout: 'lightHorizontalLines', fontSize: item.size }; // optional
|
|
150
|
+
let header = item.columns.map(col => {
|
|
151
|
+
return { text: col.label || col.tag.label || col.tag.name, bold: true, style: [{ alignment: col.align }] }
|
|
152
|
+
});
|
|
153
|
+
//item.columns.map(col => col.tag.address || '');
|
|
154
|
+
let values = [];
|
|
155
|
+
let tagsids = item.columns.filter(col => col.type !== 0).map(col => col.tag.id);
|
|
156
|
+
let fncs = item.columns.filter(col => col.type !== 0).map(col => col.function);
|
|
157
|
+
let formats = item.columns.filter(col => col.type !== 0).map(col => runtime.devices.getTagFormat(col.tag.id));
|
|
158
|
+
let timeRange = _getDateRange(item.range);
|
|
159
|
+
let options = { interval: item.interval, functions: fncs, formats: formats };
|
|
160
|
+
await runtime.daqStorage.getNodesValues(tagsids, timeRange.begin.getTime(), timeRange.end.getTime(), options).then(result => {
|
|
161
|
+
if (!result || !result.length) {
|
|
162
|
+
values = [item.columns.map(col => { return {text: ''}})];
|
|
163
|
+
} else {
|
|
164
|
+
values = result;
|
|
165
|
+
}
|
|
166
|
+
}).catch(function (err) {
|
|
167
|
+
values = [item.columns.map(col => { return {text: 'ERROR'}})];
|
|
168
|
+
});
|
|
169
|
+
content['table'] = {
|
|
170
|
+
// headers are automatically repeated if the table spans over multiple pages
|
|
171
|
+
// you can declare how many rows should be treated as headers
|
|
172
|
+
headerRows: 1,
|
|
173
|
+
widths: item.columns.map(col => col.width), //[ '*', 'auto', 100],
|
|
174
|
+
body: [
|
|
175
|
+
header,
|
|
176
|
+
...values
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
resolve(content);
|
|
180
|
+
} catch (err) {
|
|
181
|
+
reject(err);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
var _getChartContent = function (itemChart) {
|
|
187
|
+
return new Promise(async function (resolve, reject) {
|
|
188
|
+
try {
|
|
189
|
+
let values = {};
|
|
190
|
+
let tagsids = itemChart.chart.lines.map(line => line.id);
|
|
191
|
+
let timeRange = _getDateRange(itemChart.range);
|
|
192
|
+
await runtime.daqStorage.getNodesValues(tagsids, timeRange.begin.getTime(), timeRange.end.getTime(), null).then(result => {
|
|
193
|
+
if (!result) {
|
|
194
|
+
values = {};
|
|
195
|
+
} else {
|
|
196
|
+
values = result;
|
|
197
|
+
}
|
|
198
|
+
}).catch(function (err) {
|
|
199
|
+
values = {};
|
|
200
|
+
});
|
|
201
|
+
await _getChartImage(itemChart, values).then((imageData) => {
|
|
202
|
+
content = {
|
|
203
|
+
layout: 'lightHorizontalLines',
|
|
204
|
+
image: `data:image/png;base64,${imageData.toString('base64')}`,
|
|
205
|
+
// if you specify both width and height - image will be stretched
|
|
206
|
+
width: itemChart.width || 500,
|
|
207
|
+
height: itemChart.height || 350,
|
|
208
|
+
// height: 70
|
|
209
|
+
}
|
|
210
|
+
resolve(content);
|
|
211
|
+
}).catch(function (err) {
|
|
212
|
+
reject(err);
|
|
213
|
+
});
|
|
214
|
+
} catch (err) {
|
|
215
|
+
reject(err);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
var _getChartImage = function (itemChart, values) {
|
|
221
|
+
return new Promise(async function (resolve, reject) {
|
|
222
|
+
const timeRange = _getDateRange(itemChart.range);
|
|
223
|
+
if (!values) {
|
|
224
|
+
values = _getSampleValues(itemChart.chart.lines, timeRange);
|
|
225
|
+
}
|
|
226
|
+
reject('TODO node create image from canvas is not supported!');
|
|
227
|
+
|
|
228
|
+
// TODO wait compatibility with arm
|
|
229
|
+
// imageGenerator.createImage(itemChart, values).then((content) => {
|
|
230
|
+
// resolve(content.toString('base64'));
|
|
231
|
+
// }).catch(function (err) {
|
|
232
|
+
// reject(err);
|
|
233
|
+
// logger.error("createImage: " + err);
|
|
234
|
+
// });
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
var _getDateRange = function (dateRange) {
|
|
239
|
+
if (dateRange === ReportDateRangeType.day) {
|
|
240
|
+
var yesterday = new Date(currentTime || Date.now());
|
|
241
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
242
|
+
return {
|
|
243
|
+
begin: new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate()),
|
|
244
|
+
end: new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate(), 23, 59, 59)
|
|
245
|
+
};
|
|
246
|
+
} else if (dateRange === ReportDateRangeType.week) {
|
|
247
|
+
var lastWeek = new Date(currentTime || Date.now());
|
|
248
|
+
lastWeek = new Date(lastWeek.setDate(lastWeek.getDate() - 7 - (lastWeek.getDay() + 6 ) % 7));
|
|
249
|
+
var diff = lastWeek.getDate() - lastWeek.getDay() + (lastWeek.getDay() == 0 ? -6 : 1); // adjust when day is sunday
|
|
250
|
+
lastWeek = new Date(lastWeek.setDate(diff));
|
|
251
|
+
return {
|
|
252
|
+
begin: new Date(lastWeek.getFullYear(), lastWeek.getMonth(), lastWeek.getDate()),
|
|
253
|
+
end: new Date(lastWeek.getFullYear(), lastWeek.getMonth(), lastWeek.getDate() + 6, 23, 59, 59)
|
|
254
|
+
};
|
|
255
|
+
} else if (dateRange === ReportDateRangeType.month) {
|
|
256
|
+
var lastMonth = new Date(currentTime || Date.now());
|
|
257
|
+
return {
|
|
258
|
+
begin: new Date(lastMonth.getFullYear(), lastMonth.getMonth() - 1, 1, 0, 0, 0),
|
|
259
|
+
end: new Date(lastMonth.getFullYear(), lastMonth.getMonth(), 0, 23, 59, 59)
|
|
260
|
+
};
|
|
261
|
+
} else {
|
|
262
|
+
return {
|
|
263
|
+
begin: new Date(currentTime || Date.now()),
|
|
264
|
+
end: new Date(currentTime || Date.now())
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
var _getAlarmsContent = function (item) {
|
|
270
|
+
return new Promise(async function (resolve, reject) {
|
|
271
|
+
try {
|
|
272
|
+
let content = { layout: 'lightHorizontalLines', fontSize: item.size }; // optional
|
|
273
|
+
let header = Object.values(item.propertyText).map(col => {
|
|
274
|
+
return { text: col, bold: true, style: [{ alignment: 'left' }] }
|
|
275
|
+
});
|
|
276
|
+
let values = [];
|
|
277
|
+
const timeRange = _getDateRange(item.range);
|
|
278
|
+
const query = { start: timeRange.begin.getTime(), end: timeRange.end.getTime() };
|
|
279
|
+
await runtime.alarmsMgr.getAlarmsHistory(query).then(result => {
|
|
280
|
+
if (!result || !result.length) {
|
|
281
|
+
values = [Object.values(item.propertyText).map(col => {
|
|
282
|
+
return { text: '', style: [{ alignment: 'left' }] }
|
|
283
|
+
})];
|
|
284
|
+
} else {
|
|
285
|
+
const property = Object.keys(item.property).filter(prop => { if (item.property[prop]) return prop; });
|
|
286
|
+
values = result.filter(alr => {
|
|
287
|
+
if (item.priority[alr.type] && (!item.alarmFilter || !!item.alarmFilter.find(name => name === alr.name))) {
|
|
288
|
+
return alr;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
values = values.map(alr => {
|
|
292
|
+
let row = [];
|
|
293
|
+
property.forEach((prop) => {
|
|
294
|
+
var text = '';
|
|
295
|
+
if (prop === 'ontime' && alr.ontime) text = utils.getFormatDate(new Date(Number(alr.ontime)), 'ymd');
|
|
296
|
+
else if (prop === 'offtime' && alr.offtime) text = utils.getFormatDate(new Date(Number(alr.offtime)), 'ymd');
|
|
297
|
+
else if (prop === 'acktime' && alr.acktime) text = utils.getFormatDate(new Date(Number(alr.acktime)), 'ymd');
|
|
298
|
+
else if (prop === 'text') text = alr.text;
|
|
299
|
+
else if (prop === 'group') text = alr.group;
|
|
300
|
+
else if (prop === 'userack') text = alr.userack;
|
|
301
|
+
else if (prop === 'status') text = item.statusText[alr.status];
|
|
302
|
+
else if (prop === 'type') text = item.priorityText[alr.type];
|
|
303
|
+
row.push({text: text, style: [{fillColor: alr.bkcolor, color: alr.color}]});
|
|
304
|
+
});
|
|
305
|
+
return row;
|
|
306
|
+
})
|
|
307
|
+
}
|
|
308
|
+
}).catch(function (err) {
|
|
309
|
+
console.error(err);
|
|
310
|
+
values = [Object.values(item.propertyText).map(col => { return {text: 'ERROR'}})];
|
|
311
|
+
});
|
|
312
|
+
content['table'] = {
|
|
313
|
+
// headers are automatically repeated if the table spans over multiple pages
|
|
314
|
+
// you can declare how many rows should be treated as headers
|
|
315
|
+
headerRows: 1,
|
|
316
|
+
widths: Object.values(item.propertyText).map(col => '*'), //[ '*', 'auto', 100],
|
|
317
|
+
body: [
|
|
318
|
+
header,
|
|
319
|
+
...values
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
resolve(content);
|
|
323
|
+
} catch (err) {
|
|
324
|
+
reject(err);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function inTimeToExecute(hour) {
|
|
331
|
+
return (hour >= 2 && hour <= 3);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const ReportSchedulingType = {
|
|
335
|
+
none: 'none',
|
|
336
|
+
day: 'day',
|
|
337
|
+
week: 'week',
|
|
338
|
+
month: 'month',
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const ReportDateRangeType = {
|
|
342
|
+
none: 'none',
|
|
343
|
+
day: 'day',
|
|
344
|
+
week: 'week',
|
|
345
|
+
month: 'month',
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
module.exports = {
|
|
349
|
+
create: function (property, runtime) {
|
|
350
|
+
return new Report(property, runtime);
|
|
351
|
+
},
|
|
352
|
+
ReportSchedulingType: ReportSchedulingType
|
|
353
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { createLogger, format, transports } = require('winston');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
var initialized = false;
|
|
8
|
+
var filelogger;
|
|
9
|
+
var settings;
|
|
10
|
+
var logDir = '';
|
|
11
|
+
|
|
12
|
+
const env = process.env.NODE_ENV || 'development';
|
|
13
|
+
const logFileName = 'fuxa.log';
|
|
14
|
+
const errorFileName = 'fuxa-err.log';
|
|
15
|
+
|
|
16
|
+
var log = module.exports = {
|
|
17
|
+
|
|
18
|
+
init: function (_settings) {
|
|
19
|
+
settings = _settings;
|
|
20
|
+
if (settings.logDir) {
|
|
21
|
+
logDir = settings.logDir;
|
|
22
|
+
}
|
|
23
|
+
filelogger = createLogger({
|
|
24
|
+
level: env === 'production' ? 'info' : 'debug',
|
|
25
|
+
format: format.combine(
|
|
26
|
+
// format.label({ label: path.basename(caller) }),
|
|
27
|
+
format.timestamp(),
|
|
28
|
+
format.printf(info => `${info.timestamp} [${info.level}] ${info.message}`)
|
|
29
|
+
),
|
|
30
|
+
transports: [
|
|
31
|
+
// new transports.Console({
|
|
32
|
+
// level: 'info',
|
|
33
|
+
// format: format.combine(
|
|
34
|
+
// format.colorize(),
|
|
35
|
+
// format.timestamp({format: 'YYYY-MM-DD HH:mm:ss.fff'}),
|
|
36
|
+
// format.printf(info => `${info.timestamp} [${info.level}] ${info.message}`)
|
|
37
|
+
// )
|
|
38
|
+
// }),
|
|
39
|
+
new (transports.File)({
|
|
40
|
+
level: 'info',
|
|
41
|
+
filename: `${logDir}/${logFileName}`,
|
|
42
|
+
maxsize: 1048576, // 1MB
|
|
43
|
+
maxFiles: 5,
|
|
44
|
+
json: false
|
|
45
|
+
}),
|
|
46
|
+
new (transports.File)({
|
|
47
|
+
level: 'error',
|
|
48
|
+
filename: `${logDir}/${errorFileName}`,
|
|
49
|
+
maxsize: 1048576,//5242880, // 1MB
|
|
50
|
+
maxFiles: 5,
|
|
51
|
+
json: false
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
initialized = true;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
debug: function (str, flag) {
|
|
59
|
+
// debug color: Cyan
|
|
60
|
+
console.log("\x1B[36m" + new Date().toISOString() + ' [DBG] ' + "\t" + processInput(str) + "\x1B[39m");
|
|
61
|
+
if (initialized && (null == flag || true === flag)) {
|
|
62
|
+
filelogger.debug(str);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
info: function (str, notConsoleLog = false, onlyFull = false) {
|
|
66
|
+
// debug color: Default (White / Black)
|
|
67
|
+
if (initialized && notConsoleLog === false) {
|
|
68
|
+
console.log(new Date().toISOString() + ' [INF] ' + "\t" + processInput(str));
|
|
69
|
+
}
|
|
70
|
+
if (initialized && !(onlyFull && !settings.logFull)) {
|
|
71
|
+
filelogger.info(str);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
trace: function (str, flag) {
|
|
75
|
+
// trace color: Grey
|
|
76
|
+
console.error("\x1B[90m" + new Date().toISOString() + ' [TRA] ' + "\t" + processInput(str) + "\x1B[0m");
|
|
77
|
+
if (initialized && (null == flag || true === flag)) {
|
|
78
|
+
filelogger.trace(str);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
warn: function (str, flag) {
|
|
82
|
+
// warn color: Yellow
|
|
83
|
+
console.log("\x1B[33m" + new Date().toISOString() + ' [WAR] ' + "\t" + processInput(str) + "\x1B[39m");
|
|
84
|
+
if (initialized && (null == flag || true === flag)) {
|
|
85
|
+
filelogger.warn(str);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
error: function (str, flag) {
|
|
89
|
+
// error color: Red
|
|
90
|
+
console.error("\x1B[31m" + new Date().toISOString() + ' [ERR] ' + "\t" + processInput(str) + "\x1B[0m");
|
|
91
|
+
if (initialized && (null == flag || true === flag)) {
|
|
92
|
+
filelogger.error(str);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
logDir: function () {
|
|
96
|
+
return logDir;
|
|
97
|
+
},
|
|
98
|
+
logFile: function () {
|
|
99
|
+
return `${logDir}/${logFileName}`;
|
|
100
|
+
},
|
|
101
|
+
errorFile: function () {
|
|
102
|
+
return `${logDir}/${errorFileName}`;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function processInput(param) {
|
|
107
|
+
if ('string' == typeof param) {
|
|
108
|
+
return param;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return JSON.stringify(param);
|
|
112
|
+
}
|
|
113
|
+
};
|