<%# LuCI - Lua Configuration Interface Copyright 2010 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: changelog.htm 7924 2011-11-12 14:31:31Z jow $ -%> <% export("uci_changelog", function(changes) -%>
<%:Legend:%>
  <%:Section added%>
  <%:Section removed%>
  <%:Option changed%>
  <%:Option removed%>


<% function replaceStr(str) str = string.lower(str) str = string.gsub(str,"enjet","wifijet") str = string.gsub(str,"senao","generic") str = string.gsub(str,"engenius","generic") return str end local util = luci.util local ret = { } for r, tbl in pairs(changes) do for s, os in pairs(tbl) do -- section add if filterRadio and s==filterRadio then else if os['.type'] and os['.type'] ~= "" then ret[#ret+1] = "%s.%s=%s" %{ replaceStr(r), replaceStr(s), replaceStr(os['.type']) } for o, v in util.kspairs(os) do if o:sub(1,1) ~= "." then if type(v) == "table" then local i for i = 1, #v do ret[#ret+1] = "
%s.%s.%s+=%s" %{ replaceStr(r), replaceStr(s), replaceStr(o), replaceStr(util.pcdata(v[i])) } end else ret[#ret+1] = "
%s.%s.%s=%s" %{ replaceStr(r), replaceStr(s), replaceStr(o), replaceStr(util.pcdata(v)) } end end end ret[#ret+1] = "

" -- section delete elseif os['.type'] and os['.type'] == "" then ret[#ret+1] = "%s.%s
" %{ replaceStr(r), replaceStr(s) } -- modifications else ret[#ret+1] = "%s.%s
" %{ replaceStr(r), replaceStr(s) } for o, v in util.kspairs(os) do if o:sub(1,1) ~= "." then if v and #v > 0 then ret[#ret+1] = "" if type(v) == "table" then local i for i = 1, #v do ret[#ret+1] = "%s.%s.%s+=%s
" %{ replaceStr(r), replaceStr(s), replaceStr(o), replaceStr(util.pcdata(v[i])) } end else if string.len(util.pcdata(v)) > 100 then util.pcdata(v):gsub("[^%s]+",function(c) ret[#ret+1] = "%s.%s.%s=%s
" %{ replaceStr(r), replaceStr(s), replaceStr(o), replaceStr(c) } end) else ret[#ret+1] = "%s.%s.%s=%s
" %{ replaceStr(r), replaceStr(s), replaceStr(o), replaceStr(util.pcdata(v)) } end end ret[#ret+1] = "
" else ret[#ret+1] = "%s.%s.%s
" %{ replaceStr(r), replaceStr(s), replaceStr(o) } end end end end ret[#ret+1] = "

" end end end write(table.concat(ret)) %>
<%- end) %>