ntopng/widgets
2021-03-01 15:49:12 +01:00
..
src add bubble widget and removed old code 2021-03-01 15:49:12 +01:00
Makefile add a rm command to delete old widget files 2021-03-01 15:49:12 +01:00
package.json add bubble widget and removed old code 2021-03-01 15:49:12 +01:00
README.md Updated widgets build instraction and output 2021-02-15 21:09:22 +01:00
stencil.config.ts updated .gitignore 2021-02-17 18:17:14 +01:00
tsconfig.json Added widgets source code 2021-02-15 19:57:00 +01:00

ntop-widgets

How to run ntop-widgets in ntopng

To run and test the ntop widgets components in ntopng you have to follow these steps:

  1. Type 'make'

  2. Once the build is over, go to the ntopng folder, open your terminal and type:

    
    # change directory to ntopng root
    cd scripts/lua
    ln -s ../../tests/lua tests
    
  3. Start ntopng and go to the page: http://localhost:3000/lua/tests/test_gui_widgets.lua.

How to include ntop-widgets inside a web page

To include an ntop-widget inside your web page you have to insert the following tags:

<script type="module" src="../path/to/ntop-widgets/ntop-widgets.esm.js"></script>
<script nomodule src="../path/to/ntop-widgets/ntop-widgets.js"></script>

Once the script tags have been included in your page you can use the ntop widgets. There is an example:

   <ntop-widget transformation="pie" update="15000" width="600px" height="400px">
       <ntop-datasource type="interface_packet_distro" params-ifid='0'></ntop-datasource>
   </ntop-widget>

The update paramater indicates, in milliseconds, when refresh a widget.

Packages Used

These are the packages used for ntop-widgets: