0.1.2 • Published 7 months ago

graphsboard v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

graphsboard on npm npm

Development in progress

The development of this project is ongoing, new vertions are published every day.

Host your own dashboard and generate the graphics you want. You can also simply connect the extension to your express server to automatically generate server statistics.

Default dashboard preview

Installation & setup

  1. Run
    npm i graphsboard --save
  1. If you don't use express
    const graphsboard = require('graphsboard')
    graphsboard.server()
  1. If you use express add middleware
    const express = require("express")
    const app = express()

    // Add this line before all other middleware
    const graphsboard = require('graphsboard')
    app.use(graphsboard.middleware())

    app.listen(80, () => {
        console.log(`Express server is running : http://localhost/`)
    })
  1. Visit http://ServerIP:port/graphsboard

Note: This plugin works on Node versions > 4.x

Configuration

You can change the default configuration:

    const config = {
        path: '/custom',
        ignorePaths: [ '/staff' ],
        port: 8080,
    }
    
    // Exemple 1
    graphsboard.server(config)
    // Exemple 2
    app.use(graphsboard.middleware(config))

Default config:

    path: '/graphsboard',
    ignorePaths: [ '/public', '/admin' ],
    port: 80,

    expressGraph: true

Recovered Data:

  • path : You can change the panel access path
  • ignorePaths : If you use Express, you can disable statistics for certain requests
  • port : You can change the server's exposure port
  • expressGraph : Automatically generate graphs for Express (Total Request and average request response status)

How to use

Simply add new graphics and data

    const graphsboard = require('graphsboard')
    const graph = graphsboard.Graph('Total Users', {
        type: 'line', // Default: 'line' - List : ['line', 'bar', 'polararea', 'doughnut', 'radar']
        absolute: true
    })
    graph.add({user: 1})

Graph options :

  • type: Change graph display type
  • size: Change the minimum width of the graphic on the page
  • priority: Change the order of your graphics. Enter a value between 1 and 100. Charts are sorted by increasing priority. If you use the default express graphics, they have a priority of 50.
  • absolute: Does the value continue to increment infinitely? Or does it return to 0 every new minute?
    • default: false
  • avrg: Calculate the average of inserted data
    • Exemple: Average query response time
  • min: Set a minimum value for graph display
  • max: Set a maximum value for graph display

Notifications

Use the Notification system

    const graphsboard = require('graphsboard')
    
    graphsboard.Notification('Notification Title', 'This is description', 
        {
            badge: 'sucess'
        }
    )

Notifications options :

Manage data files

A graphsboard folder is automatically generated at the root of your project, with a .json file for each graph you generate. If you wish to delete a graphic, simply delete the .json file.

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago