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.

32 lines
707 B

  1. -- ------ mwan configuration ------ --
  2. ut = require "luci.util"
  3. mwanConfig = "/etc/config/mwan3"
  4. m5 = SimpleForm("luci", nil)
  5. m5:append(Template("mwan/advanced_mwanconfig")) -- highlight current tab
  6. f = m5:section(SimpleSection, nil,
  7. translate("This section allows you to modify the contents of /etc/config/mwan3"))
  8. t = f:option(TextValue, "lines")
  9. t.rmempty = true
  10. t.rows = 20
  11. function t.cfgvalue()
  12. return nixio.fs.readfile(mwanConfig) or ""
  13. end
  14. function t.write(self, section, data) -- format and write new data to script
  15. return nixio.fs.writefile(mwanConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
  16. end
  17. function f.handle(self, state, data)
  18. return true
  19. end
  20. return m5