You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.6 KiB

  1. --[[
  2. LuCI - Lua Configuration Interface
  3. Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. $Id$
  9. ]]--
  10. local CTRL = require "luci.controller.privoxy" -- privoxy multiused functions
  11. local DISP = require "luci.dispatcher"
  12. local SYS = require "luci.sys"
  13. -- Build javascript string to be displayed as version information
  14. local VERSION = translate("Version Information")
  15. .. [[\n\nluci-app-privoxy]]
  16. .. [[\n\t]] .. translate("Version") .. [[:\t]] .. CTRL.version_luci_app
  17. .. [[\n\t]] .. translate("Build") .. [[:\t]]
  18. .. SYS.exec([[opkg list-installed ]] .. [[luci_app_privoxy]] .. [[ | awk '{print $3}']])
  19. .. [[\n\nprivoxy ]] .. translate("required") .. [[:]]
  20. .. [[\n\t]] .. translate("Version") .. [[:\t]] .. CTRL.version_required .. [[ ]] .. translate("or greater")
  21. .. [[\n\nprivoxy ]] .. translate("installed") .. [[:]]
  22. .. [[\n\t]] .. translate("Version") .. [[:\t]]
  23. .. SYS.exec([[opkg list-installed ]] .. [[privoxy]] .. [[ | awk '{print $3}']])
  24. .. [[\n\n]]
  25. local HELP = [[<a href="http://www.privoxy.org/user-manual/config.html#%s" target="_blank">%s</a>]]
  26. -- cbi-map -- ##################################################################
  27. local m = Map("privoxy")
  28. m.title = [[</a><a href="javascript:alert(']]
  29. .. VERSION
  30. .. [[')">]]
  31. .. translate("Privoxy WEB proxy")
  32. m.description = translate("Privoxy is a non-caching web proxy with advanced filtering "
  33. .. "capabilities for enhancing privacy, modifying web page data and HTTP headers, "
  34. .. "controlling access, and removing ads and other obnoxious Internet junk.")
  35. -- cbi-section -- ##############################################################
  36. local s = m:section(SimpleSection)
  37. s.title = [[<font color="red">]] .. [[<strong>]]
  38. .. translate("Software update required")
  39. .. [[</strong>]] .. [[</font>]]
  40. -- old privoxy sofware version --------------------------------------------------------------
  41. local v = s:option(DummyValue, "_update_needed")
  42. v.titleref = DISP.build_url("admin", "system", "packages")
  43. v.rawhtml = true
  44. --v.title = [[<h3>]] .. [[<font color="red">]] .. [[<strong>]]
  45. -- .. translate("Software update required")
  46. -- .. [[</strong>]] .. [[</font>]] .. [[</h3>]] .. [[<br />]]
  47. v.value = [[<h3>]] .. [[<strong>]]
  48. .. translate("The currently installed 'privoxy' package is not supported by LuCI application.")
  49. .. [[<br />]]
  50. .. translate("Please update to the current version!")
  51. .. [[</strong>]] .. [[</h3>]]
  52. return m