X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=applications%2Fluci-app-adblock%2Fluasrc%2Fmodel%2Fcbi%2Fadblock%2Fblacklist_tab.lua;h=ef70100e4f0b42a2509d378a9929ed4a0b49f230;hb=277aeb0a4c0b5c794f0f96efda91b50f9a574cd4;hp=7945aa154e639dbd18a4033bc9bbda3fd320a5f4;hpb=494fc4cdb913cfd68c7299bfc7dbad0dab8dfc0c;p=project%2Fluci.git diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua index 7945aa154..ef70100e4 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua @@ -7,12 +7,26 @@ local uci = require("uci") local adbinput = uci.get("adblock", "blacklist", "adb_src" or "/etc/adblock/adblock.blacklist") if not nixio.fs.access(adbinput) then - m = SimpleForm("error", nil, translate("Input file not found, please check your configuration.")) + m = SimpleForm("error", nil, + translate("Input file not found, please check your configuration.")) + m.reset = false + m.submit = false + return m +end + +if nixio.fs.stat(adbinput).size > 524288 then + m = SimpleForm("error", nil, + translate("The file size is too large for online editing in LuCI (> 512 KB). ") + .. translate("Please edit this file directly in a terminal session.")) + m.reset = false + m.submit = false return m end m = SimpleForm("input", nil) m:append(Template("adblock/config_css")) +m.submit = translate("Save") +m.reset = false s = m:section(SimpleSection, nil, translatef("This form allows you to modify the content of the adblock blacklist (%s).
", adbinput)