All Projects → demisto → sane-reports

demisto / sane-reports

Licence: Apache-2.0 license
Reports library that will keep you sane and not pulling your hair out

Programming Languages

javascript
184084 projects - #8 most used programming language
Less
1899 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to sane-reports

ChangeNumbersJs
Tiny Library for change number from a language in other language.
Stars: ✭ 14 (-70.21%)
Mutual labels:  javascript-library
alga-js
Alga.js is javascript helper for helping build a component of any front-end web frameworks
Stars: ✭ 18 (-61.7%)
Mutual labels:  javascript-library
aws-batch-runtime-monitoring
Serverless application to monitor an AWS Batch architecture through dashboards.
Stars: ✭ 41 (-12.77%)
Mutual labels:  dashboards
toaststrap
A simple, lightweight JavaScript library for showing Bootstrap 5 toast popups.
Stars: ✭ 16 (-65.96%)
Mutual labels:  javascript-library
necktie
Necktie – a simple DOM binding tool
Stars: ✭ 43 (-8.51%)
Mutual labels:  javascript-library
vtt-creator
Very basic Node.js/JavaScript library to generate VTT open subtitles files
Stars: ✭ 22 (-53.19%)
Mutual labels:  javascript-library
huge-uploader-nodejs
Node.js module to handle chunked file uploads sent by huge-uploader
Stars: ✭ 28 (-40.43%)
Mutual labels:  javascript-library
tomloprodModal
tomloprodModal is a configurable pure javascript library to create responsive and minimalist modal windows with no dependencies.
Stars: ✭ 17 (-63.83%)
Mutual labels:  javascript-library
rc-here-maps
React components implemented on top of Here Maps API
Stars: ✭ 16 (-65.96%)
Mutual labels:  javascript-library
imtool
🖼️ Client-side canvas-based image manipulation library.
Stars: ✭ 38 (-19.15%)
Mutual labels:  javascript-library
particle-emitter
A particle system for PixiJS
Stars: ✭ 709 (+1408.51%)
Mutual labels:  javascript-library
javascript-strong-password-generator
JavaScript Strong Password Generator: based on Jeff Atwood's Post "Password Rules Are Bullshit".
Stars: ✭ 21 (-55.32%)
Mutual labels:  javascript-library
database-js
Common Database Interface for Node
Stars: ✭ 58 (+23.4%)
Mutual labels:  javascript-library
SSCD.js
Super Simple Collision Detection for JavaScript games!
Stars: ✭ 88 (+87.23%)
Mutual labels:  javascript-library
discord.js-Moderation-Bot
.Learning how to code in the library discord.js
Stars: ✭ 57 (+21.28%)
Mutual labels:  javascript-library
renovation-core
The Frappe Javascript Front End Missing SDK
Stars: ✭ 23 (-51.06%)
Mutual labels:  javascript-library
bulksearch
Lightweight and read-write optimized full text search library.
Stars: ✭ 108 (+129.79%)
Mutual labels:  javascript-library
jackson-js
JavaScript object serialization and deserialization library using decorators. It supports also advanced Object concepts such as polymorphism, Object identity and cyclic objects.
Stars: ✭ 86 (+82.98%)
Mutual labels:  javascript-library
onli-reducer
⚛️ One line reducer. State management without boilerplate.
Stars: ✭ 31 (-34.04%)
Mutual labels:  javascript-library
ConflictJS
Finding and Understanding Conflicts Between JavaScript Libraries
Stars: ✭ 39 (-17.02%)
Mutual labels:  javascript-library

Sane Reports by Demisto

CircleCI Coverage Status

Reports library that will keep you sane and not pulling your hair out

Quick start

Works with Node v11.15.0 (https://tecadmin.net/install-nvm-macos-with-homebrew/)

Chromium/Chrome

$ npm install
$ npm run make
$ ./reportsServer templates/test.json dist/test.pdf # for linux users.
$ ./reportsServer-macos templates/test.json dist/test.pdf # for macOS users.
$ ./reportsServer-win.exe templates/test.json dist/test.pdf # for windows users.

PhantomJS

$ npm install
$ cd sane-reports
$ phantomjs reportsServer.js templates/test.json dist/test.pdf

Report will be generated in: dist/test.pdf

Generating dashboard mode (browser) report

$ git clone [email protected]:demisto/sane-reports.git
$ cd sane-reports
$ npm install
$ npm start

Now open browser at: http://localhost:8082

Generating PDF report

$ git clone [email protected]:demisto/sane-reports.git
$ cd sane-reports
$ npm install
$ npm run make
$ npm run production
$ npm run generate-report

This will generate a PDF report in the dist folder. The name of the report will start with report-.

Generate report options:

You can create PDF report with the following command as well:

Chromium/Chrome

./reportsServer <report_template_file> [<output_file> <dist_folder> <orientation> <resourceTimeout> <type> <headerLeftImage> <headerRightImage> <customReportType> <pageSize> <disableTopHeaders> <chromiumPath>]

PhantomJS

phantomjs reportServer.js <report_template_file> [<output_file> <dist_folder> <orientation> <resourceTimeout> <type> <headerLeftImage> <headerRightImage> <customReportType> <pageSize> <disableTopHeaders>]

  • report_template_file: The template of the report (JSON format)
  • output_file: The name of the generated report (leave empty for default name)
  • dist_folder: should be dist
  • orientation: The orientation of the report: portrait/landscape (default portrait)
  • resourceTimeout: Timeout for generating the report (default is 4000ms)
  • type: The report type: pdf or csv (default is pdf)
  • headerLeftImage: The image to show at the left side of the report header of each page (base64 or url)
  • headerRightImage: The image to show at the right side of the report header of each page (base64 or url)
  • customReportType: Custom report type if needed. currently not used.
  • pageSize: The report page size to generate. Possible: A4, A3, A5, letter (default A4).
  • disableTopHeaders: true or "true" to disable the top headers and show icons in the footer. (default false)
  • chromiumPath: a custom chromium or chrome path. The service searches for installed chromium or chrome by order. Default usage by priority: Chromium -> Google Chrome Stable -> Google Chrome -> the default path '/usr/bin/chromium-browser'.

Example:

  • npm run production
  • npm run make
  • ./reportsServer-macos templates/incidentDailyReportTempalte.json dist/incidentDailyReportTempalte.pdf dist portrait 4000 pdf '' '' '' A4 '' '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'

Running on MacOS Locally:

You can use npm script:

npm run test:macos

Debugging

  • Download the mamba-reports.patch
  • Apply the patch (In WebStorm: git -> patch -> apply patch...)
  • Debug the server and add a breakpoint in the beginning of the method servicereport.go/generatePdfReport
  • genereta a PDF report from the UI (web-client)
  • when it stops on the breakpoint:
    • refresh the files in Debug/lib/temp (right click -> reload from disk)
    • copy the last json content from the server folder to incidentDailyReportTemplate.json
    • while the project is running (npm start) the page will be auto-reloaded at localhost:8082

To debug the automation/docker image behind sane pdf reports, you can use your own automation with the reports.pdf.script setting (use in the troubleshooting tab).

Alternative: also possible to change the docker image at the automation settings (show filter deprecated automations to see it) screenshot

Demo

Reports templates (JSON) examples can be found in the templates folder.

Example reports outputs can be found in the examples folder.

Create your own report template

You can edit existing report templates or create your own template. Report templates are created in JSON format and includes sections. Sections are ordered according to their row and column positions.

Section types: Header, Divider, Date, Image, JSON, Markdown, Table, Text, Bar Chart, Line Chart, Pie Chart, HTML, List, Grouped List, Items Section.

Each section can have its own style (camled case css style: font-size -> fontSize).

Important notice:

HTML sections use dangerouslySetInnerHTML to set the given text as html. This method may cause a security risk, so before using, please validate the source of the text, and use with cautious at your own risk.

Contributor License Agreement

Contributions are welcome and appreciated. To contribute follow the Quick Start section and submit a PR.

Before merging any PRs, we need all contributors to sign a contributor license agreement. By signing a contributor license agreement, we ensure that the community is free to use your contributions.

When you open a new pull request, a bot will evaluate whether you have signed the CLA. If required, the bot will comment on the pull request, including a link to accept the agreement. The CLA document is also available for review as a PDF.

License

demisto/sane-reports is licensed under the Apache License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].