mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Add pref utility function
This commit is contained in:
parent
3c83a73602
commit
3fadd94708
1 changed files with 10 additions and 2 deletions
|
|
@ -438,13 +438,13 @@ end
|
|||
|
||||
function multipleTableButtonPrefs(label, comment, array_labels, array_values, default_value, selected_color,
|
||||
submit_field, redis_key, disabled, elementToSwitch, showElementArray,
|
||||
javascriptAfterSwitch, showElement)
|
||||
javascriptAfterSwitch, showElement, initialValue)
|
||||
if(_POST[submit_field] ~= nil) then
|
||||
ntop.setPref(redis_key, _POST[submit_field])
|
||||
value = _POST[submit_field]
|
||||
notifyNtopng(submit_field)
|
||||
else
|
||||
value = ntop.getPref(redis_key)
|
||||
value = initialValue or ntop.getPref(redis_key)
|
||||
if(value == "") then
|
||||
if(default_value ~= nil) then
|
||||
ntop.setPref(redis_key, default_value)
|
||||
|
|
@ -565,3 +565,11 @@ function loggingSelector(label, comment, submit_field, redis_key)
|
|||
|
||||
return(value)
|
||||
end
|
||||
|
||||
function printPageSection(section_name)
|
||||
print('<tr><th colspan=2 class="info">'..section_name..'</th></tr>')
|
||||
end
|
||||
|
||||
function printSaveButton()
|
||||
print('<tr><th colspan=2 style="text-align:right;"><button type="submit" class="btn btn-primary" style="width:115px" disabled="disabled">'..i18n("save")..'</button></th></tr>')
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue