mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
added new rtt gui page
This commit is contained in:
parent
7296331121
commit
5b1f7eb32c
4 changed files with 404 additions and 17 deletions
|
|
@ -3416,6 +3416,30 @@ function generate_switch_toggle(id, label, disabled)
|
|||
]])
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
--- Return an HTML `select` element with passed options.
|
||||
--
|
||||
function generate_select(id, name, is_required, is_disabled, options)
|
||||
|
||||
local required_flag = (is_required and "required" or "")
|
||||
local disabled_flag = (is_disabled and "disabled" or "")
|
||||
local name_attr = (name == "" and "name='" .. name .. "'" or "")
|
||||
local parsed_options = ""
|
||||
|
||||
for i, option in ipairs(options) do
|
||||
parsed_options = parsed_options .. ([[
|
||||
<option value="]].. option.value ..[[">]].. option.title ..[[</option>
|
||||
]])
|
||||
end
|
||||
|
||||
return ([[
|
||||
<select id="]].. id ..[[" class="form-control" ]].. name_attr ..[[ ]].. required_flag ..[[ ]] .. disabled_flag ..[[>
|
||||
]].. parsed_options ..[[
|
||||
</select>
|
||||
]])
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
||||
function getHttpUrlPrefix()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue