You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1011 B
HTML

1 year ago
<%
local util = require "luci.util"
local container_status = util.trim(util.exec("/usr/libexec/apps/nodered/nodered.sh status"))
local container_running = string.find(string.lower(container_status), "up") and string.find(string.lower(container_status), "(healthy)")
local port=util.trim(util.exec("/usr/libexec/apps/nodered/nodered.sh port"))
1 year ago
-%>
1 year ago
<div class="cbi-value">
<div class="cbi-value-field">
<% if container_running then %>
<button class="cbi-button cbi-button-success" disabled="true"><%= container_status %></button>
<%
if port == "" then
port="1880"
end
-%>
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open nodered%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
1 year ago
<% else %>
<button class="cbi-button cbi-button-negative" disabled="true"><%= container_status %></button>
1 year ago
<% end %>
</div>
</div>