|
|
@ -1,6 +1,6 @@
|
|
|
|
<%
|
|
|
|
<%
|
|
|
|
local util = require "luci.util"
|
|
|
|
local util = require "luci.util"
|
|
|
|
local container_status = util.trim(util.exec("/usr/libexec/apps/simplex/simplex.sh status"))
|
|
|
|
local container_status = util.trim(util.exec("/usr/libexec/apps/lxc-attach/lxc-attach.sh status"))
|
|
|
|
local container_install = (string.len(container_status) > 0)
|
|
|
|
local container_install = (string.len(container_status) > 0)
|
|
|
|
local container_running = container_status == "running"
|
|
|
|
local container_running = container_status == "running"
|
|
|
|
-%>
|
|
|
|
-%>
|
|
|
@ -8,15 +8,15 @@ local container_running = container_status == "running"
|
|
|
|
<label class="cbi-value-title"><%:Status%></label>
|
|
|
|
<label class="cbi-value-title"><%:Status%></label>
|
|
|
|
<div class="cbi-value-field">
|
|
|
|
<div class="cbi-value-field">
|
|
|
|
<% if container_running then %>
|
|
|
|
<% if container_running then %>
|
|
|
|
<button class="cbi-button cbi-button-success" disabled="true"><%:simplex is running%></button>
|
|
|
|
<button class="cbi-button cbi-button-success" disabled="true"><%:lxc-attach is running%></button>
|
|
|
|
<% else %>
|
|
|
|
<% else %>
|
|
|
|
<button class="cbi-button cbi-button-negative" disabled="true"><%:simplex is not running%></button>
|
|
|
|
<button class="cbi-button cbi-button-negative" disabled="true"><%:lxc-attach is not running%></button>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<%
|
|
|
|
<%
|
|
|
|
if container_running then
|
|
|
|
if container_running then
|
|
|
|
local port=util.trim(util.exec("/usr/libexec/apps/simplex/simplex.sh port"))
|
|
|
|
local port=util.trim(util.exec("/usr/libexec/apps/lxc-attach/lxc-attach.sh port"))
|
|
|
|
if port == "" then
|
|
|
|
if port == "" then
|
|
|
|
port="5223"
|
|
|
|
port="5223"
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -25,7 +25,7 @@ if container_running then
|
|
|
|
<label class="cbi-value-title"> </label>
|
|
|
|
<label class="cbi-value-title"> </label>
|
|
|
|
<div class="cbi-value-field">
|
|
|
|
<div class="cbi-value-field">
|
|
|
|
|
|
|
|
|
|
|
|
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open simplex%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
|
|
|
|
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open lxc-attach%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|