modules/admin-full: make menus work with no dnsmasq or firewall installed
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_system / processes.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15 f = SimpleForm("processes", translate("Processes"), translate("This list gives an overview over currently running system processes and their status."))
16 f.reset = false
17 f.submit = false
18
19 t = f:section(Table, luci.sys.process.list())
20 t:option(DummyValue, "PID", translate("PID"))
21 t:option(DummyValue, "USER", translate("Owner"))
22 t:option(DummyValue, "COMMAND", translate("Command"))
23 t:option(DummyValue, "%CPU", translate("CPU usage (%)"))
24 t:option(DummyValue, "%MEM", translate("Memory usage (%)"))
25
26 hup = t:option(Button, "_hup", translate("Hang Up"))
27 hup.inputstyle = "reload"
28 function hup.write(self, section)
29         null, self.tag_error[section] = luci.sys.process.signal(section, 1)
30 end
31
32 term = t:option(Button, "_term", translate("Terminate"))
33 term.inputstyle = "remove"
34 function term.write(self, section)
35         null, self.tag_error[section] = luci.sys.process.signal(section, 15)
36 end
37
38 kill = t:option(Button, "_kill", translate("Kill"))
39 kill.inputstyle = "reset"
40 function kill.write(self, section)
41         null, self.tag_error[section] = luci.sys.process.signal(section, 9)
42 end
43
44 return f