luci-app-https-dns-proxy: better service control & buttons styling
Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
parent
015712bba0
commit
bdcb760d62
5 changed files with 91 additions and 60 deletions
|
@ -10,7 +10,7 @@ LUCI_TITLE:=DNS Over HTTPS Proxy Web UI
|
||||||
LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy
|
LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy
|
||||||
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +https-dns-proxy
|
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +https-dns-proxy
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
include ../../luci.mk
|
include ../../luci.mk
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,9 @@ else
|
||||||
if not ubusStatus or not ubusStatus[packageName] then
|
if not ubusStatus or not ubusStatus[packageName] then
|
||||||
tmpfsStatusCode = 0
|
tmpfsStatusCode = 0
|
||||||
tmpfsStatus = translate("Stopped")
|
tmpfsStatus = translate("Stopped")
|
||||||
|
if not luci.sys.init.enabled(packageName) then
|
||||||
|
tmpfsStatus = tmpfsStatus .. " (" .. translate("disabled") .. ")"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
tmpfsStatusCode, tmpfsStatus = 1, ""
|
tmpfsStatusCode, tmpfsStatus = 1, ""
|
||||||
for n = 1,1000 do
|
for n = 1,1000 do
|
||||||
|
|
|
@ -1,56 +1,77 @@
|
||||||
<%#
|
<%# Copyright 2020 Stan Grishin <stangri@melmac.net> -%>
|
||||||
Copyright 2019 Stan Grishin <stangri@melmac.net>
|
|
||||||
-%>
|
|
||||||
|
|
||||||
<%-
|
|
||||||
local packageName = "https-dns-proxy"
|
|
||||||
local enabledFlag = luci.sys.init.enabled(packageName)
|
|
||||||
local ubusStatus = luci.util.ubus("service", "list", { name = packageName })
|
|
||||||
|
|
||||||
if not ubusStatus or not ubusStatus[packageName] then
|
|
||||||
tmpfsStatusCode = 0
|
|
||||||
else
|
|
||||||
tmpfsStatusCode = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
if tmpfsStatusCode == 0 then
|
|
||||||
btn_start_style = "cbi-button cbi-button-apply important"
|
|
||||||
btn_action_style = "cbi-button cbi-button-apply important"
|
|
||||||
btn_stop_style = "cbi-button cbi-button-reset -disabled"
|
|
||||||
else
|
|
||||||
btn_start_style = "cbi-button cbi-button-apply -disabled"
|
|
||||||
btn_action_style = "cbi-button cbi-button-apply important"
|
|
||||||
btn_stop_style = "cbi-button cbi-button-reset important"
|
|
||||||
end
|
|
||||||
if not enabledFlag then
|
|
||||||
btn_start_style = "cbi-button cbi-button-apply -disabled"
|
|
||||||
btn_action_style = "cbi-button cbi-button-apply -disabled"
|
|
||||||
btn_enable_style = "cbi-button cbi-button-apply important"
|
|
||||||
btn_disable_style = "cbi-button cbi-button-reset -disabled"
|
|
||||||
else
|
|
||||||
btn_enable_style = "cbi-button cbi-button-apply -disabled"
|
|
||||||
btn_disable_style = "cbi-button cbi-button-reset important"
|
|
||||||
end
|
|
||||||
-%>
|
|
||||||
|
|
||||||
<%+https-dns-proxy/css%>
|
<%+https-dns-proxy/css%>
|
||||||
<%+https-dns-proxy/js%>
|
<%+https-dns-proxy/js%>
|
||||||
|
|
||||||
|
<%-
|
||||||
|
local packageName = "https-dns-proxy"
|
||||||
|
local serviceRunning, serviceEnabled = false, false;
|
||||||
|
|
||||||
|
serviceEnabled = luci.sys.init.enabled(packageName)
|
||||||
|
local ubusStatus = luci.util.ubus("service", "list", { name = packageName })
|
||||||
|
if ubusStatus and ubusStatus[packageName] then
|
||||||
|
serviceRunning = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if serviceEnabled then
|
||||||
|
btn_start_status = true
|
||||||
|
btn_action_status = true
|
||||||
|
btn_stop_status = true
|
||||||
|
btn_enable_status = false
|
||||||
|
btn_disable_status = true
|
||||||
|
else
|
||||||
|
btn_start_status = false
|
||||||
|
btn_action_status = false
|
||||||
|
btn_stop_status = false
|
||||||
|
btn_enable_status = true
|
||||||
|
btn_disable_status = false
|
||||||
|
end
|
||||||
|
if serviceRunning then
|
||||||
|
btn_start_status = false
|
||||||
|
btn_action_status = true
|
||||||
|
btn_stop_status = true
|
||||||
|
else
|
||||||
|
btn_action_status = false
|
||||||
|
btn_stop_status = false
|
||||||
|
end
|
||||||
|
-%>
|
||||||
|
|
||||||
<div class="cbi-value"><label class="cbi-value-title">Service Control</label>
|
<div class="cbi-value"><label class="cbi-value-title">Service Control</label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input type="button" class="<%=btn_start_style%>" id="btn_start" name="start" value="<%:Start%>" onclick="button_action(this)" />
|
<input type="button" class="cbi-button cbi-button-apply" id="btn_start" name="start" value="<%:Start%>"
|
||||||
|
onclick="button_action(this)" />
|
||||||
<span id="btn_start_spinner" class="btn_spinner"></span>
|
<span id="btn_start_spinner" class="btn_spinner"></span>
|
||||||
<input type="button" class="<%=btn_action_style%>" id="btn_action" name="action" value="<%:Reload%>" onclick="button_action(this)" />
|
<input type="button" class="cbi-button cbi-button-apply" id="btn_action" name="action" value="<%:Reload%>"
|
||||||
|
onclick="button_action(this)" />
|
||||||
<span id="btn_action_spinner" class="btn_spinner"></span>
|
<span id="btn_action_spinner" class="btn_spinner"></span>
|
||||||
<input type="button" class="<%=btn_stop_style%>" id="btn_stop" name="stop" value="<%:Stop%>" onclick="button_action(this)" />
|
<input type="button" class="cbi-button cbi-button-reset" id="btn_stop" name="stop" value="<%:Stop%>"
|
||||||
|
onclick="button_action(this)" />
|
||||||
<span id="btn_stop_spinner" class="btn_spinner"></span>
|
<span id="btn_stop_spinner" class="btn_spinner"></span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<input type="button" class="<%=btn_enable_style%>" id="btn_enable" name="enable" value="<%:Enable%>" onclick="button_action(this)" />
|
<input type="button" class="cbi-button cbi-button-apply" id="btn_enable" name="enable" value="<%:Enable%>"
|
||||||
|
onclick="button_action(this)" />
|
||||||
<span id="btn_enable_spinner" class="btn_spinner"></span>
|
<span id="btn_enable_spinner" class="btn_spinner"></span>
|
||||||
<input type="button" class="<%=btn_disable_style%>" id="btn_disable" name="disable" value="<%:Disable%>" onclick="button_action(this)" />
|
<input type="button" class="cbi-button cbi-button-reset" id="btn_disable" name="disable" value="<%:Disable%>"
|
||||||
|
onclick="button_action(this)" />
|
||||||
<span id="btn_disable_spinner" class="btn_spinner"></span>
|
<span id="btn_disable_spinner" class="btn_spinner"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%-if not btn_start_status then%>
|
||||||
|
<script type="text/javascript">document.getElementById("btn_start").disabled = true;</script>
|
||||||
|
<%-end%>
|
||||||
|
<%-if not btn_action_status then%>
|
||||||
|
<script type="text/javascript">document.getElementById("btn_action").disabled = true;</script>
|
||||||
|
<%-end%>
|
||||||
|
<%-if not btn_stop_status then%>
|
||||||
|
<script type="text/javascript">document.getElementById("btn_stop").disabled = true;</script>
|
||||||
|
<%-end%>
|
||||||
|
<%-if not btn_enable_status then%>
|
||||||
|
<script type="text/javascript">document.getElementById("btn_enable").disabled = true;</script>
|
||||||
|
<%-end%>
|
||||||
|
<%-if not btn_disable_status then%>
|
||||||
|
<script type="text/javascript">document.getElementById("btn_disable").disabled = true;</script>
|
||||||
|
<%-end%>
|
||||||
|
|
|
@ -25,7 +25,7 @@ msgstr ""
|
||||||
msgid "Cloudflare"
|
msgid "Cloudflare"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:85
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:88
|
||||||
msgid "DHCP and DNS"
|
msgid "DHCP and DNS"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ msgstr ""
|
||||||
msgid "DNS Over HTTPS Proxy"
|
msgid "DNS Over HTTPS Proxy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:64
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:67
|
||||||
msgid "DNS Over HTTPS Proxy Settings"
|
msgid "DNS Over HTTPS Proxy Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -45,23 +45,23 @@ msgstr ""
|
||||||
msgid "Digitale Gesellschaft"
|
msgid "Digitale Gesellschaft"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:53
|
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:57
|
||||||
msgid "Disable"
|
msgid "Disable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:56
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:59
|
||||||
msgid "DoH"
|
msgid "DoH"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:143
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:146
|
||||||
msgid "EDNS client subnet"
|
msgid "EDNS client subnet"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:51
|
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:54
|
||||||
msgid "Enable"
|
msgid "Enable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:87
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:90
|
||||||
msgid "For more information on different options check"
|
msgid "For more information on different options check"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -69,15 +69,15 @@ msgstr ""
|
||||||
msgid "Google"
|
msgid "Google"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:83
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:86
|
||||||
msgid "Instances"
|
msgid "Instances"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:126
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:129
|
||||||
msgid "Listen address"
|
msgid "Listen address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:139
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:142
|
||||||
msgid "Listen port"
|
msgid "Listen port"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ msgstr ""
|
||||||
msgid "ODVR (nic.cz)"
|
msgid "ODVR (nic.cz)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:146
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:149
|
||||||
msgid "Proxy server"
|
msgid "Proxy server"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -109,20 +109,20 @@ msgstr ""
|
||||||
msgid "Quad 9 (Unsecured)"
|
msgid "Quad 9 (Unsecured)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:43
|
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:44
|
||||||
msgid "Reload"
|
msgid "Reload"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:99
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:102
|
||||||
msgid "Resolver"
|
msgid "Resolver"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:56
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:59
|
||||||
msgid "Running"
|
msgid "Running"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:66
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:69
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:68
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:71
|
||||||
msgid "Service Status"
|
msgid "Service Status"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ msgstr ""
|
||||||
msgid "Start"
|
msgid "Start"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:45
|
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:47
|
||||||
msgid "Stop"
|
msgid "Stop"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -142,20 +142,24 @@ msgstr ""
|
||||||
msgid "Unknown Provider"
|
msgid "Unknown Provider"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:83
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:86
|
||||||
msgid ""
|
msgid ""
|
||||||
"When you add/remove any instances below, they will be used to override the "
|
"When you add/remove any instances below, they will be used to override the "
|
||||||
"'DNS forwardings' section of"
|
"'DNS forwardings' section of"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:91
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:94
|
||||||
msgid "and"
|
msgid "and"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:56
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:59
|
||||||
msgid "at"
|
msgid "at"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:39
|
||||||
|
msgid "disabled"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:32
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:32
|
||||||
msgid "is not installed or not found"
|
msgid "is not installed or not found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache;
|
||||||
|
exit 0
|
Loading…
Reference in a new issue