updated status polling behavior and minor GUI updates

pull/1/head
riley 1 year ago
parent cdadc0b03f
commit 70925b47fb

@ -11,7 +11,7 @@ m = taskd.docker_map("whoogle", "whoogle", "/usr/libexec/apps/whoogle/whoogle.sh
translate("Whoogle is a free open-source self-hosted metasearch engine that allows you to search and get your Google results without ads, JavaScript trackers, or AMP links. It also ignores cookies, and does not perform any IP address tracking.")
.. translate("Official website:") .. ' <a href=\"https://hub.docker.com/r/benbusby/whoogle-search/\" target=\"_blank\">https://hub.docker.com/r/benbusby/whoogle-search/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("whoogle status:"))
s = m:section(SimpleSection, translate("Service Status"))
s:append(Template("whoogle/status"))
s = m:section(TypedSection, "whoogle", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:"))

@ -1,16 +1,14 @@
<%
local util = require "luci.util"
local container_status = util.trim(util.exec("/usr/libexec/apps/whoogle/whoogle.sh status"))
local container_install = (string.len(container_status) > 0)
local container_running = container_status == "running"
local container_running = string.match(string.lower(container_status), "^up%W")
-%>
<div class="cbi-value">
<label class="cbi-value-title"><%:Status%></label>
<div class="cbi-value-field">
<% if container_running then %>
<button class="cbi-button cbi-button-success" disabled="true"><%:whoogle is running%></button>
<button class="cbi-button cbi-button-success" disabled="true"><%=container_status%></button>
<% else %>
<button class="cbi-button cbi-button-negative" disabled="true"><%:whoogle is not running%></button>
<button class="cbi-button cbi-button-negative" disabled="true"><%=container_status%></button>
<% end %>
</div>
</div>
@ -24,8 +22,7 @@ if container_running then
<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 whoogle%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open Whoogle%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
</div>
</div>
<% end %>
<% end %>
Loading…
Cancel
Save