add to pool shortcut for interface and local network (#4093)

This commit is contained in:
gabryon99 2020-10-16 18:02:22 +02:00
parent 4608c52596
commit d9bba4b4b2
4 changed files with 75 additions and 1 deletions

View file

@ -17,7 +17,7 @@ end
function ui_utils.render_notes(notes_items)
if notes_items == nil then
traceError(TRACE_ERROR, TRACE_DEBUG, "The notes table is nil!")
traceError(TRACE_DEBUG, TRACE_CONSOLE, "The notes table is nil!")
return ""
end
@ -26,6 +26,30 @@ function ui_utils.render_notes(notes_items)
})
end
function ui_utils.render_pools_dropdown(pools_instance, member, key)
if (pools_instance == nil) then
traceError(TRACE_DEBUG, TRACE_CONSOLE, "The pools instance is nil!")
return ""
end
if (member == nil) then
traceError(TRACE_DEBUG, TRACE_CONSOLE, "The member is nil!")
return ""
end
local selected_pool = pools_instance:get_pool_by_member(member)
local selected_pool_id = selected_pool and selected_pool.pool_id or pools_instance.DEFAULT_POOL_ID
local all_pools = pools_instance:get_all_pools()
return template_utils.gen("pages/components/pool-select.template", {
pools = all_pools,
selected_pool_id = selected_pool_id,
key = key,
})
end
function ui_utils.create_navbar_title(title, subpage, title_link)
if isEmptyString(subpage) then return title end