%- local sys = require "luci.sys" if firstmap and messages then local msg; for _, msg in ipairs(messages) do local a, b, msgEdited msg = tostring(msg) b = 0 -- In this context 0 will mean "no tag" a = msg:sub(1, 4) if a == "wrn:" then b = 1 -- In this context 1 will mean "warning" elseif a == "err:" then b = 2 -- In this context 2 will mean "error" elseif a == "scs:" then b = 3 -- 3 will mean success end if b == 1 then msgEdited = msg:sub(5) -- Grab a substring starting with the 5-th character and ending at with the last -%>
<%- elseif b == 2 then msgEdited = msg:sub(5) -- Grab a substring starting with the 5-th character and ending at with the last -%> <%- elseif b == 3 then msgEdited = msg:sub(5) -%> <%- else -%> <%- end end -- To end the for loop end -- To end the master if statement -%> <%-+cbi/apply_xhr-%>