1 -- Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
2 -- Licensed under the Apache License, Version 2.0
4 local CTRL = require "luci.controller.privoxy" -- this application's controller
5 local DISP = require "luci.dispatcher"
6 local SYS = require "luci.sys"
8 local HELP = [[<a href="http://www.privoxy.org/user-manual/config.html#%s" target="_blank">%s</a>]]
10 -- cbi-map -- ##################################################################
11 local m = Map("privoxy")
12 m.title = [[</a><a href="javascript:alert(']]
13 .. translate("Version Information")
14 .. [[\n\nluci-app-privoxy]]
15 .. [[\n\t]] .. translate("Version") .. [[:\t]]
16 .. SYS.exec([[opkg list-installed ]] .. [[luci-app-privoxy]] .. [[ | cut -d " " -f 3 ]])
17 .. [[\n\nprivoxy ]] .. translate("required") .. [[:]]
18 .. [[\n\t]] .. translate("Version") .. [[:\t]] .. CTRL.PRIVOXY_MIN .. [[ ]] .. translate("or higher")
19 .. [[\n\nprivoxy ]] .. translate("installed") .. [[:]]
20 .. [[\n\t]] .. translate("Version") .. [[:\t]]
21 .. SYS.exec([[opkg list-installed ]] .. [[privoxy]] .. [[ | cut -d " " -f 3 ]])
24 .. translate("Privoxy WEB proxy")
25 m.description = translate("Privoxy is a non-caching web proxy with advanced filtering "
26 .. "capabilities for enhancing privacy, modifying web page data and HTTP headers, "
27 .. "controlling access, and removing ads and other obnoxious Internet junk.")
29 -- cbi-section -- ##############################################################
30 local s = m:section(SimpleSection)
31 s.title = [[<font color="red">]] .. [[<strong>]]
32 .. translate("Software update required")
33 .. [[</strong>]] .. [[</font>]]
35 -- old privoxy sofware version --------------------------------------------------------------
36 local v = s:option(DummyValue, "_update_needed")
37 v.titleref = DISP.build_url("admin", "system", "packages")
39 --v.title = [[<h3>]] .. [[<font color="red">]] .. [[<strong>]]
40 -- .. translate("Software update required")
41 -- .. [[</strong>]] .. [[</font>]] .. [[</h3>]] .. [[<br />]]
42 v.value = [[<h3>]] .. [[<strong>]]
43 .. translate("The currently installed 'privoxy' package is not supported by LuCI application.")
45 .. translate("Please update to the current version!")
46 .. [[</strong>]] .. [[</h3>]]