summaryrefslogtreecommitdiffstats
path: root/qos-controller.lua
blob: c3358e80461c19004364e50b71ee36570612a89f (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
30
module(..., package.seeall)

-- Load libraries
require("controllerfunctions")

default_action = "status"

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

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

function details(self)
	return self.model.listinterfacedetails(self)
end

function enable(self)
	return self:redirect_to_referrer(self.model.enable(self.clientdata.interface))
end

function config(self)
	return controllerfunctions.handle_form(self, function() return self.model.get_config(self.clientdata.DEV) end, self.model.update_config, self.clientdata, "Save", "Edit QOS Config", "Configuration Set")
end

function expert(self)
	return controllerfunctions.handle_form(self, function() return self.model.get_filedetails(self.clientdata.interface) end, self.model.update_filedetails, self.clientdata, "Save", "Edit QOS Config", "Configuration Set")
end