mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-30 04:45:13 +08:00
update 2026-07-28 01:38:11
This commit is contained in:
1 parent
20b786ab77
commit
25d570431d
6243 files changed
+2850542
No files matched your search
@@ -0,0 +1,56 @@
|
||||
|
||||
<% if self.task_start_failed then %>
|
||||
<div class="alert-message warning"><%:Another task running, try again later.%> <a href="javascript:void(taskd.show_log('<%=self.task_id%>'))"><%:Click here to check running task%></a></div>
|
||||
<% end %>
|
||||
|
||||
<%+cbi/map%>
|
||||
<%
|
||||
local task_running = false
|
||||
local taskd = require "luci.model.tasks"
|
||||
local status = taskd.status(self.task_id)
|
||||
task_running = status.running
|
||||
-%>
|
||||
<div class="cbi-page-actions control-group">
|
||||
<%
|
||||
if not task_running then
|
||||
%>
|
||||
<%
|
||||
local util = require "luci.util"
|
||||
local container_status = util.trim(util.exec(self.script_path.." status"))
|
||||
local container_install = (string.len(container_status) > 0)
|
||||
local container_running = container_status == "running"
|
||||
if container_install then
|
||||
-%>
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" value="<%:Upgrade%>/<%:Apply%>" onclick="cbi_submit(this, 'cbi.apply', 'upgrade')" />
|
||||
<%
|
||||
if container_running then
|
||||
-%>
|
||||
<input class="btn cbi-button cbi-button-remove" type="button" value="<%:Stop%>" onclick="cbi_submit(this, 'cbi.apply', 'stop')" />
|
||||
|
||||
<input class="btn cbi-button cbi-button-reload" type="button" value="<%:Restart%>" onclick="cbi_submit(this, 'cbi.apply', 'restart')" />
|
||||
<% else %>
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" value="<%:Start%>" onclick="cbi_submit(this, 'cbi.apply', 'start')" />
|
||||
|
||||
<input class="btn cbi-button cbi-button-remove" type="button" value="<%:Remove%>" onclick="cbi_submit(this, 'cbi.apply', 'rm')" />
|
||||
<% end
|
||||
else %>
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" value="<%:Install%>" onclick="cbi_submit(this, 'cbi.apply', 'install')" />
|
||||
<% end
|
||||
else
|
||||
%>
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" value="<%:Task Running%>…" onclick="taskd.show_log('<%=self.task_id%>')" />
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
|
||||
<%+tasks/embed%>
|
||||
<%
|
||||
if self.auto_show_task and task_running then
|
||||
-%>
|
||||
<script>
|
||||
taskd.show_log("<%=self.task_id%>");
|
||||
</script>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
Reference in new issue
Block a user