mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Added Vite to frontend builds
This commit is contained in:
parent
daf007c161
commit
2b5d2d7949
118 changed files with 10172 additions and 34001 deletions
|
|
@ -3,50 +3,50 @@
|
|||
*/
|
||||
|
||||
const breed_icon = {
|
||||
Safe: "<i class='fas fa-thumbs-up'></i>",
|
||||
Acceptable: "<i class='fas fa-thumbs-up'></i>",
|
||||
Fun: "<i class='fas fa-smile'></i>",
|
||||
Unsafe: "<i class='fas fa-thumbs-down'></i>",
|
||||
Dangerous: "<i class='fas fa-exclamation-triangle'></i>"
|
||||
}
|
||||
Safe: '<i class=\'fas fa-thumbs-up\'></i>',
|
||||
Acceptable: '<i class=\'fas fa-thumbs-up\'></i>',
|
||||
Fun: '<i class=\'fas fa-smile\'></i>',
|
||||
Unsafe: '<i class=\'fas fa-thumbs-down\'></i>',
|
||||
Dangerous: '<i class=\'fas fa-exclamation-triangle\'></i>',
|
||||
};
|
||||
|
||||
const confidence_icons = [
|
||||
{ id: -1, icon_class: "badge bg-warning" }, /* Unknown */
|
||||
{ id: 0, icon_class: "badge bg-warning" }, /* Guessed */
|
||||
{ id: 1, icon_class: "badge bg-success" }, /* DPI */
|
||||
]
|
||||
{id: -1, icon_class: 'badge bg-warning'}, /* Unknown */
|
||||
{id: 0, icon_class: 'badge bg-warning'}, /* Guessed */
|
||||
{id: 1, icon_class: 'badge bg-success'}, /* DPI */
|
||||
];
|
||||
|
||||
const encrypted_icon = "<i class='fas fa-lock'></i>"
|
||||
const encrypted_icon = '<i class=\'fas fa-lock\'></i>';
|
||||
|
||||
/* *********************************** */
|
||||
|
||||
const formatBreedIcon = function(breed, is_encrypted) {
|
||||
let icon = ''
|
||||
if(breed_icon[breed]) {
|
||||
icon = breed_icon[breed]
|
||||
}
|
||||
return is_encrypted ? `${icon} ${encrypted_icon}` : icon
|
||||
}
|
||||
let icon = '';
|
||||
if (breed_icon[breed]) {
|
||||
icon = breed_icon[breed];
|
||||
}
|
||||
return is_encrypted ? `${icon} ${encrypted_icon}` : icon;
|
||||
};
|
||||
|
||||
/* *********************************** */
|
||||
|
||||
const formatConfidence = function(confidence, confidence_id) {
|
||||
let confidence_string = ''
|
||||
confidence_icons.forEach((el) => {
|
||||
if(Number(el.id) === Number(confidence_id)) {
|
||||
confidence_string = `<span class="${el.icon_class}" title="${confidence}">${confidence}</span>`
|
||||
}
|
||||
})
|
||||
return confidence_string
|
||||
}
|
||||
let confidence_string = '';
|
||||
confidence_icons.forEach((el) => {
|
||||
if (Number(el.id) === Number(confidence_id)) {
|
||||
confidence_string = `<span class="${el.icon_class}" title="${confidence}">${confidence}</span>`;
|
||||
}
|
||||
});
|
||||
return confidence_string;
|
||||
};
|
||||
|
||||
/* *********************************** */
|
||||
|
||||
const protocolUtils = function () {
|
||||
return {
|
||||
formatBreedIcon,
|
||||
formatConfidence
|
||||
};
|
||||
const protocolUtils = function() {
|
||||
return {
|
||||
formatBreedIcon,
|
||||
formatConfidence,
|
||||
};
|
||||
}();
|
||||
|
||||
export default protocolUtils;
|
||||
export default protocolUtils;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue