summaryrefslogtreecommitdiffstats
path: root/opennhrp-controller.lua
blob: 305898b5bd2790dcaff8c21564c3b4fffa09fca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module(..., package.seeall)

require("controllerfunctions")

default_action = "status"

function status(self)
	return self.model.getstatus()
end

function show(self)
	return self.model.getshowreport()
end

function startstop(self)
	return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
end

function listinterfaces(self)
	return self.model.listinterfaces(self)
end

function editinterface(self)
	return controllerfunctions.handle_form(self, function() return self.model.getinterfacedetails(self.clientdata.interface) end, self.model.updateinterfacedetails, self.clientdata, "Save", "Edit Interface Config", "Interface Configuration Set")
end

function expert (self)
	return controllerfunctions.handle_form(self, function() return self.model:getconfigfile() end, function(value) return self.model:setconfigfile(value) end, self.clientdata, "Save", "Edit Config", "Configuration Set")
end