mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-08 06:24:34 +00:00
| .. | ||
| src | ||
| Makefile | ||
| package.json | ||
| README.md | ||
| stencil.config.ts | ||
| tsconfig.json | ||
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:
-
Type 'make'
-
Once the build is over, go to the
ntopngfolder, open your terminal and type:# change directory to ntopng root cd scripts/lua ln -s ../../tests/lua tests -
Start
ntopngand 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:
- chart.js - MIT License