Skip to content

Commit 7f51947

Browse files
committed
gui: refactor acl table code
Refactor acl table code and fix display bug. Fixes: #1046 Signed-off-by: Ansuel Smith <[email protected]>
1 parent c7aad25 commit 7f51947

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

decompressed/gui_file/www/docroot/modals/wireless-modal.lp

+16-14
Original file line numberDiff line numberDiff line change
@@ -261,26 +261,28 @@ local function loadAclList(aclmode, action)
261261
if aclmode == "unlock" or aclmode == "disabled" then
262262
whitelistclass["group"].style = "display:none;"
263263
end
264-
if #acl_whitelist_data < 1 and action ~= "POST" then
265-
whitelistclass["group"].style = "display:none;"
266-
whitelistclass ["span"] = {id = "Address_list_Whitelistclass"}
267-
html[#html+1] = ui_helper.createLabel("", T"MAC Address list is empty", whitelistclass, nil)
268-
acl_columns[1].header=""
269-
end
270-
html[#html+1] = ui_helper.createTable(acl_columns, acl_whitelist_data, acl_whitelist_options, whitelistclass, acl_whitelist_helpmsg)
264+
271265
local blacklistclass = {
272266
group = {
273267
class = "monitor-acl_mode monitor-unlock"
274268
}
275269
}
276-
if #acl_blacklist_data < 1 and action ~= "POST" then
277-
blacklistclass["group"].style = "display:none;"
278-
blacklistclass ["span"] = {id = "Address_list_Blacklistclass"}
279-
html[#html+1] = ui_helper.createLabel("", T"MAC Address list is empty", blacklistclass, nil)
280-
acl_columns[1].header=""
281-
else
282-
acl_columns[1].header = format("<span style=\"font-weight:normal;\">%s</span>", T"MAC Address")
270+
271+
if (#acl_whitelist_data < 1 or #acl_blacklist_data < 1) and action ~= "POST" then
272+
acl_columns[1].header = ""
273+
if aclmode == "unlock" then
274+
whitelistclass["group"].style = "display:none;"
275+
whitelistclass ["span"] = {id = "Address_list_Whitelistclass"}
276+
html[#html+1] = ui_helper.createLabel("", T"MAC Address list is empty", whitelistclass, nil)
277+
elseif aclmode == "lock" then
278+
blacklistclass["group"].style = "display:none;"
279+
blacklistclass ["span"] = {id = "Address_list_Blacklistclass"}
280+
html[#html+1] = ui_helper.createLabel("", T"MAC Address list is empty", blacklistclass, nil)
281+
end
283282
end
283+
284+
html[#html+1] = ui_helper.createTable(acl_columns, acl_whitelist_data, acl_whitelist_options, whitelistclass, acl_whitelist_helpmsg)
285+
284286
if aclmode == "lock" or aclmode == "register" or aclmode == "disabled" then
285287
blacklistclass["group"].style = "display:none;"
286288
end

0 commit comments

Comments
 (0)