mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
parent
c40f854283
commit
4e31f600f6
118 changed files with 34006 additions and 10177 deletions
|
|
@ -3,29 +3,29 @@
|
|||
*/
|
||||
|
||||
const interfaces = [
|
||||
{is_pcap_interface: true, icon: '<i class=\'fas fa-file\'></i>'},
|
||||
{is_packet_interface: true, icon: '<i class=\'fas fa-ethernet\'></i>'},
|
||||
{is_zmq_interface: true, icon: '<i class=\'fas fa-bezier-curve\'></i>'},
|
||||
{is_view_interface: true, icon: '<i class=\'fas fa-eye\'></i>'},
|
||||
{is_dynamic_interface: true, icon: '<i class=\'fas fa-code-branch\'></i>'},
|
||||
{is_dropping_interface: true, icon: '<i class=\'fas fa-tint\'></i>'},
|
||||
{is_recording_interface: true, icon: '<i class=\'fas fa-hdd\'></i>'},
|
||||
];
|
||||
{ is_pcap_interface: true, icon: "<i class='fas fa-file'></i>" },
|
||||
{ is_packet_interface: true, icon: "<i class='fas fa-ethernet'></i>" },
|
||||
{ is_zmq_interface: true, icon: "<i class='fas fa-bezier-curve'></i>" },
|
||||
{ is_view_interface: true, icon: "<i class='fas fa-eye'></i>" },
|
||||
{ is_dynamic_interface: true, icon: "<i class='fas fa-code-branch'></i>" },
|
||||
{ is_dropping_interface: true, icon: "<i class='fas fa-tint'></i>" },
|
||||
{ is_recording_interface: true, icon: "<i class='fas fa-hdd'></i>" },
|
||||
]
|
||||
|
||||
const getInterfaceIcon = (interface_types) => {
|
||||
for (const [key, value] of Object.entries(interface_types)) {
|
||||
const interface_info = interfaces.find((el) => el[key] ? (el[key] === value) : false);
|
||||
if (interface_info) {
|
||||
return interface_info.icon;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
for (const [key, value] of Object.entries(interface_types)) {
|
||||
const interface_info = interfaces.find((el) => el[key] ? (el[key] === value) : false)
|
||||
if (interface_info) {
|
||||
return interface_info.icon;
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
const interfaceUtils = function() {
|
||||
return {
|
||||
getInterfaceIcon,
|
||||
};
|
||||
const interfaceUtils = function () {
|
||||
return {
|
||||
getInterfaceIcon
|
||||
};
|
||||
}();
|
||||
|
||||
export default interfaceUtils;
|
||||
export default interfaceUtils;
|
||||
Loading…
Add table
Add a link
Reference in a new issue