mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
updated ntop-widgets
This commit is contained in:
parent
c972cc3c43
commit
23a0bcbaac
5 changed files with 53 additions and 46 deletions
|
|
@ -1 +1 @@
|
|||
import{p as t,b as a}from"./p-71afff24.js";(()=>{const a=import.meta.url,e={};return""!==a&&(e.resourcesUrl=new URL(".",a).href),t(e)})().then((t=>a([["p-e1d6095f",[[0,"ntop-datasource",{ds_type:[1,"type"]}],[1,"ntop-widget",{update:[2],transformation:[1],width:[1],height:[1],displayFormatter:[1,"display"],fetchedData:[32],forceUpdate:[64]}]]]],t)));
|
||||
import{p as t,b as e}from"./p-25615ebb.js";(()=>{const e=import.meta.url,a={};return""!==e&&(a.resourcesUrl=new URL(".",e).href),t(a)})().then((t=>e([["p-19b36948",[[0,"ntop-datasource",{src:[8],styles:[1,"styling"],name:[1],type:[1]}],[1,"ntop-widget",{update:[2],type:[1],width:[1],height:[1],displayFormatter:[1,"display"],_fetchedData:[32]},[[0,"srcChanged","datasourceChanged"]]]]]],t)));
|
||||
File diff suppressed because one or more lines are too long
1
httpdocs/js/ntop-widgets/p-25615ebb.js
Normal file
1
httpdocs/js/ntop-widgets/p-25615ebb.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -28,8 +28,8 @@ dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
|||
-- NOTE: THE NTOP WIDGET SCRIPTS MUST BE LOADED FIRST!
|
||||
print([[
|
||||
|
||||
<script type="module" src="]].. ntop.getHttpPrefix() ..[[/js/ntop-widgets-dev/ntop-widgets.esm.js"></script>
|
||||
<script nomodule src="]].. ntop.getHttpPrefix() ..[[/js/ntop-widgets-dev/ntop-widgets.js"></script>
|
||||
<script type="module" src="]].. ntop.getHttpPrefix() ..[[/js/ntop-widgets/ntop-widgets.esm.js"></script>
|
||||
<script nomodule src="]].. ntop.getHttpPrefix() ..[[/js/ntop-widgets/index.js"></script>
|
||||
|
||||
]])
|
||||
|
||||
|
|
@ -41,51 +41,58 @@ end
|
|||
|
||||
print([[
|
||||
<div class='row my-4'>
|
||||
|
||||
<div class='col-6'>
|
||||
<div class='form-group mb-2'>
|
||||
<label><b>Select an interface for the first Widget:</b></label>
|
||||
<select class='form-control w-100' id='select-first'>
|
||||
]].. table.concat(options, '\n') ..[[
|
||||
</select>
|
||||
</div>
|
||||
<ntop-widget id='first-widget' transformation="pie" update="5000" height="400px">
|
||||
<ntop-datasource type="interface_packet_distro" params-ifid='0'></ntop-datasource>
|
||||
<ntop-widget id='first-widget' type="pie" update="5000" height='30rem'>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=0"></ntop-datasource>
|
||||
</ntop-widget>
|
||||
</div>
|
||||
<div class='col-6'>
|
||||
<div class='form-group mb-2'>
|
||||
<label><b>Select an interface for the second Widget:</b></label>
|
||||
<select class='form-control w-100' id='select-second'>
|
||||
]].. table.concat(options, '\n') ..[[
|
||||
</select>
|
||||
</div>
|
||||
<ntop-widget id='second-widget' display='raw' transformation="donut" update="6000" height="400px">
|
||||
<ntop-datasource type="interface_packet_distro" params-ifid='0'></ntop-datasource>
|
||||
<ntop-widget id='second-widget' display='none' type="donut" update="5000" height='30rem'>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=0"></ntop-datasource>
|
||||
</ntop-widget>
|
||||
</div>
|
||||
<div class='col-6 my-4'>
|
||||
<ntop-widget id='third-widget' display='raw' type="stackedBar" update="5000" height='28.5rem' width='100%'>
|
||||
<h3 slot='header' class='mt-2 mb-4' style='flex: auto'>
|
||||
Stacked Bar Chart (Interface/Packet Distro)
|
||||
</h3>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=0"></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=9"></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=15"></ntop-datasource>
|
||||
</ntop-widget>
|
||||
</div>
|
||||
<div class='col-6 my-4'>
|
||||
<ntop-widget id='fourth-widget' update="5000" height='100%' width='100%'>
|
||||
<h3 slot='header' class='mt-2 mb-4' style='flex: auto'>
|
||||
Line + 2xBars (Interface/Packet Distro)
|
||||
</h3>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=0" type="line" styling='{"fill": false}'></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=9" type="bar"></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=15" type="bar"></ntop-datasource>
|
||||
</ntop-widget>
|
||||
</div>
|
||||
<div class='col-6 my-4'>
|
||||
<ntop-widget id='fifth-widget' display='raw' update="5000" height='100%' width='100%'>
|
||||
<h3 slot='header' class='mt-2 mb-4' style='flex: auto'>
|
||||
3x Lines (No Fill, 2xFills) (Interface/Packet Distro)
|
||||
</h3>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=0" type="line" styling='{"fill": false}'></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=9" type="line"></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=15" type="line"></ntop-datasource>
|
||||
</ntop-widget>
|
||||
</div>
|
||||
<div class='col-6 my-4'>
|
||||
<ntop-widget id='sixth-widget' display='raw' update="5000" height='100%' width='100%'>
|
||||
<h3 slot='header' class='mt-2 mb-4' style='flex: auto'>
|
||||
Scatter (Interface/Packet Distro)
|
||||
</h3>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=0" type="scatter"></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=9" type="scatter"></ntop-datasource>
|
||||
<ntop-datasource src="interface_packet_distro?ifid=15" type="scatter"></ntop-datasource>
|
||||
</ntop-widget>
|
||||
</div>
|
||||
</div>
|
||||
]])
|
||||
|
||||
print([[
|
||||
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function() {
|
||||
$(`#select-first`).on('change', async function() {
|
||||
const value = $(this).val();
|
||||
$(`#first-widget ntop-datasource`).attr("params-ifid", value);
|
||||
await $(`#first-widget`)[0].forceUpdate();
|
||||
});
|
||||
|
||||
$(`#select-second`).on('change', async function() {
|
||||
const value = $(this).val();
|
||||
$(`#second-widget ntop-datasource`).attr("params-ifid", value);
|
||||
await $(`#second-widget`)[0].forceUpdate();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
]])
|
||||
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue