mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-22 02:38:59 +00:00
Fixes for the 'all' hook
This commit is contained in:
parent
76c4736b73
commit
eafa80da09
5 changed files with 21 additions and 6 deletions
|
|
@ -450,7 +450,7 @@ const ThresholdCross = (gui, hooks, script_subdir, script_key) => {
|
|||
// append label and checkbox inside the row
|
||||
$input_container.append(
|
||||
$(`<td class='text-center'></td>`).append($checkbox),
|
||||
$(`<td>${hook.label.titleCase()}</td>`),
|
||||
$(`<td>${(hook.label ? hook.label.titleCase() : "")}</td>`),
|
||||
$(`<td></td>`).append($field)
|
||||
);
|
||||
|
||||
|
|
@ -464,21 +464,37 @@ const ThresholdCross = (gui, hooks, script_subdir, script_key) => {
|
|||
|
||||
// append each hooks to the table
|
||||
$table_editor.append(`<tr><th class='text-center'>Enabled</th></tr>`)
|
||||
|
||||
|
||||
if ("min" in $input_fields) {
|
||||
$table_editor.append($input_fields['min']);
|
||||
delete $input_fields['min'];
|
||||
}
|
||||
if ("5mins" in $input_fields) {
|
||||
$table_editor.append($input_fields['5mins']);
|
||||
delete $input_fields['5mins'];
|
||||
}
|
||||
if ("hour" in $input_fields) {
|
||||
$table_editor.append($input_fields['hour']);
|
||||
delete $input_fields['hour'];
|
||||
}
|
||||
if ("day" in $input_fields) {
|
||||
$table_editor.append($input_fields['day']);
|
||||
delete $input_fields['day'];
|
||||
}
|
||||
|
||||
var other_keys = [];
|
||||
|
||||
for(var key in $input_fields)
|
||||
other_keys.push(key);
|
||||
|
||||
/* Guarantees the sort order */
|
||||
other_keys.sort();
|
||||
|
||||
$.each(other_keys, function(idx, item) {
|
||||
$table_editor.append($input_fields[item]);
|
||||
});
|
||||
|
||||
console.log($input_fields);
|
||||
};
|
||||
|
||||
const apply_event = (event) => {
|
||||
|
|
|
|||
|
|
@ -10,5 +10,4 @@ if ntop.isPro() then
|
|||
require "5min"
|
||||
end
|
||||
|
||||
-- Run hourly scripts
|
||||
ntop.checkSystemScripts5Min()
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ local function snmp_device_run_user_scripts(snmp_device)
|
|||
granularity = granularity,
|
||||
alert_entity = iface_entity,
|
||||
user_script = script,
|
||||
conf = conf,
|
||||
conf = conf.script_conf,
|
||||
}))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ for hook, config in pairs(hooks_config) do
|
|||
end
|
||||
|
||||
result.hooks[hook] = table.merge(config, {
|
||||
label = label,
|
||||
label = label or "",
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ ntop.checkSystemScriptsMin()
|
|||
--require "snmp_utils"
|
||||
--run_5min_snmp_caching(600)
|
||||
--dofile(dirs.installdir .. "/pro/scripts/callbacks/system/5min.lua")
|
||||
--ntop.checkSNMPDeviceAlerts5Min()
|
||||
ntop.checkSNMPDeviceAlerts5Min()
|
||||
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue