|
|
@ -2,29 +2,21 @@
|
|
|
|
local util = require "luci.util"
|
|
|
|
local util = require "luci.util"
|
|
|
|
local container_status = util.trim(util.exec("/usr/libexec/apps/frigate/frigate.sh status"))
|
|
|
|
local container_status = util.trim(util.exec("/usr/libexec/apps/frigate/frigate.sh status"))
|
|
|
|
local container_running = string.match(string.lower(container_status), "^up%W")
|
|
|
|
local container_running = string.match(string.lower(container_status), "^up%W")
|
|
|
|
|
|
|
|
local port = util.trim(util.exec("/usr/libexec/apps/frigate/frigate.sh port"))
|
|
|
|
-%>
|
|
|
|
-%>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="cbi-value">
|
|
|
|
<div class="cbi-value">
|
|
|
|
<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"><%= container_status %></button>
|
|
|
|
<button class="cbi-button cbi-button-success" disabled="true"><%= container_status %></button>
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
<button class="cbi-button cbi-button-negative" disabled="true"><%= container_status %></button>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%
|
|
|
|
<%
|
|
|
|
if container_running then
|
|
|
|
|
|
|
|
local port = util.trim(util.exec("/usr/libexec/apps/frigate/frigate.sh port"))
|
|
|
|
|
|
|
|
if port == "" then
|
|
|
|
if port == "" then
|
|
|
|
port="5100"
|
|
|
|
port="5100"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-%>
|
|
|
|
-%>
|
|
|
|
<div class="cbi-value cbi-value-last">
|
|
|
|
|
|
|
|
<label class="cbi-value-title"> </label>
|
|
|
|
|
|
|
|
<div class="cbi-value-field">
|
|
|
|
|
|
|
|
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open frigate%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
|
|
|
|
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open frigate%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
<button class="cbi-button cbi-button-negative" disabled="true"><%= container_status %></button>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|