Commit 291221a3 authored by root's avatar root

Updated for startstop in core 0.5.0

parent 9ec5b6b4
......@@ -9,7 +9,7 @@ function status(self)
end
function startstop(self)
return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.model.getstatus, self.clientdata)
return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
end
function editconfig(self)
......
......@@ -367,8 +367,8 @@ end
function startstop_service(action)
local result = modelfunctions.startstop_service(processname, action)
table.insert(result.value.actions.value, "run")
table.insert(result.value.actions.value, "test")
table.insert(result.value.actions.value, "Run")
table.insert(result.value.actions.value, "Test")
if action and (action:lower() == "run" or action:lower() == "test") then
result.value.result.errtxt = nil
local cmd
......
......@@ -14,17 +14,17 @@
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action) %>" method="POST">
<DT>Program control-panel</DT>
<DD>
<input class="submit" type="submit" name="action" value="Start" <% if data.value.status.value== "Running" then io.write("disabled") end %>>
<input class="submit" type="submit" name="action" value="Stop" <% if data.value.status.value== "Stopped" then io.write("disabled") end %>>
<input class="submit" type="submit" name="action" value="Restart" <% if data.value.status.value== "Stopped" then io.write("disabled") end %>>
<input class="submit" type="submit" name="action" value="Start">
<input class="submit" type="submit" name="action" value="Stop">
<input class="submit" type="submit" name="action" value="Restart">
</DD>
<DT>Run once</DT>
<DD>
<input class="submit" type="submit" name="action" value="Run" <% if data.value.status.value== "Running" then io.write("disabled") end %>>
<input class="submit" type="submit" name="action" value="Run">
</DD>
<DT>Test</DT>
<DD>
<input class="submit" type="submit" name="action" value="Test" <% if data.value.status.value== "Running" then io.write("disabled") end %>>
<input class="submit" type="submit" name="action" value="Test">
</DD>
</form>
</DL>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment