processes.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. -- Copyright 2008 Steven Barth <steven@midlink.org>
  2. -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
  3. -- Licensed to the public under the Apache License 2.0.
  4. f = SimpleForm("processes", translate("Processes"), translate("This list gives an overview over currently running system processes and their status."))
  5. f.reset = false
  6. f.submit = false
  7. t = f:section(Table, luci.sys.process.list())
  8. t:option(DummyValue, "PID", translate("PID"))
  9. t:option(DummyValue, "USER", translate("Owner"))
  10. t:option(DummyValue, "COMMAND", translate("Command"))
  11. t:option(DummyValue, "%CPU", translate("CPU usage (%)"))
  12. t:option(DummyValue, "%MEM", translate("Memory usage (%)"))
  13. hup = t:option(Button, "_hup", translate("Hang Up"))
  14. hup.inputstyle = "reload"
  15. function hup.write(self, section)
  16. null, self.tag_error[section] = luci.sys.process.signal(section, 1)
  17. end
  18. term = t:option(Button, "_term", translate("Terminate"))
  19. term.inputstyle = "remove"
  20. function term.write(self, section)
  21. null, self.tag_error[section] = luci.sys.process.signal(section, 15)
  22. end
  23. kill = t:option(Button, "_kill", translate("Kill"))
  24. kill.inputstyle = "reset"
  25. function kill.write(self, section)
  26. null, self.tag_error[section] = luci.sys.process.signal(section, 9)
  27. end
  28. return f