Minor interface cleanup #2

Open
Ghost wants to merge 3 commits from <deleted>:main into main

@ -7,11 +7,11 @@ local btcpayserver_model = require "luci.model.btcpayserver"
local m, s, o local m, s, o
m = taskd.docker_map("btcpayserver", "btcpayserver", "/usr/libexec/apps/btcpayserver/btcpayserver.sh", m = taskd.docker_map("btcpayserver", "btcpayserver", "/usr/libexec/apps/btcpayserver/btcpayserver.sh",
translate("btcpayserver"), translate("BTCPay Server"),
translate("BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It's secure, private, censorship-resistant and free.") translate("BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It's secure, private, censorship-resistant and free.")
.. translate("Official website:") .. ' <a href=\"https://docs.linuxserver.io/images/docker-btcpayserver\" target=\"_blank\">hhttps://docs.linuxserver.io/images/docker-btcpayserver/</a>') .. "<br/>" .. translate("Official website:") .. ' <a href=\"https://docs.linuxserver.io/images/docker-btcpayserver\" target=\"_blank\">https://docs.linuxserver.io/images/docker-btcpayserver/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("btcpayserver status:")) s = m:section(SimpleSection, translate("Container Status"))
s:append(Template("btcpayserver/status")) s:append(Template("btcpayserver/status"))
s = m:section(TypedSection, "btcpayserver", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:")) s = m:section(TypedSection, "btcpayserver", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:"))

@ -2,30 +2,19 @@
local util = require "luci.util" local util = require "luci.util"
local container_status = util.trim(util.exec("/usr/libexec/apps/btcpayserver/btcpayserver.sh status")) local container_status = util.trim(util.exec("/usr/libexec/apps/btcpayserver/btcpayserver.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/btcpayserver/btcpayserver.sh port"))
if port == "" then
port = "3000"
end
-%> -%>
<div class="cbi-value"> <div class="cbi-value">
<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"><%= container_status %></button> <button class="cbi-button cbi-button-success" disabled="true"><%= container_status %></button>
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open btcpayserver%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
<% else %> <% else %>
<button class="cbi-button cbi-button-negative" disabled="true"><%= container_status %></button> <button class="cbi-button cbi-button-negative" disabled="true"><%= container_status %></button>
<% end %> <% end %>
</div> </div>
</div> </div>
<%
if container_running then
local port = util.trim(util.exec("/usr/libexec/apps/btcpayserver/btcpayserver.sh port"))
if port == "" then
port = "3000"
end
-%>
<div class="cbi-value cbi-value-last">
<label class="cbi-value-title">&nbsp;</label>
<div class="cbi-value-field">
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open btcpayserver%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
</div>
</div>
<% end %>

Loading…
Cancel
Save