parent
f0c707dabe
commit
b426201b16
@ -2,6 +2,7 @@ local api = require "luci.passwall.api"
|
||||
local appname = "passwall"
|
||||
local fs = api.fs
|
||||
local sys = api.sys
|
||||
local uci = api.uci
|
||||
local datatypes = api.datatypes
|
||||
local path = string.format("/usr/share/%s/rules/", appname)
|
||||
local gfwlist_path = "/usr/share/passwall/rules/gfwlist"
|
||||
@ -313,7 +314,10 @@ end
|
||||
|
||||
m:append(Template(appname .. "/rule_list/js"))
|
||||
|
||||
if api.is_finded("geoview") then
|
||||
local geo_dir = (uci:get(appname, "@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/")
|
||||
local geosite_path = geo_dir .. "/geosite.dat"
|
||||
local geoip_path = geo_dir .. "/geoip.dat"
|
||||
if api.is_finded("geoview") and fs.access(geosite_path) and fs.access(geoip_path) then
|
||||
s:tab("geoview", translate("Geo View"))
|
||||
o = s:taboption("geoview", DummyValue, "_geoview_fieldset")
|
||||
o.rawhtml = true
|
||||
|
@ -3,16 +3,16 @@ local api = require "luci.passwall.api"
|
||||
-%>
|
||||
|
||||
<style>
|
||||
.faq-title {
|
||||
color: var(--primary);
|
||||
font-weight: bolder;
|
||||
margin-bottom: 0.5rem;
|
||||
display: inline-block;
|
||||
}
|
||||
.faq-item {
|
||||
margin-bottom: 0.8rem;
|
||||
line-height:1.2rem;
|
||||
}
|
||||
.faq-title {
|
||||
color: var(--primary);
|
||||
font-weight: bolder;
|
||||
margin-bottom: 0.5rem;
|
||||
display: inline-block;
|
||||
}
|
||||
.faq-item {
|
||||
margin-bottom: 0.8rem;
|
||||
line-height:1.2rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="cbi-value">
|
||||
@ -25,25 +25,25 @@ local api = require "luci.passwall.api"
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-passwall-geoview-lookup"><label class="cbi-value-title" for="geoview.lookup"><%:Domain/IP Query%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" class="cbi-textfield" id="geoview.lookup" name="geoview.lookup">
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" id="lookup-view_btn"
|
||||
onclick='do_geoview(this, "lookup", document.getElementById("geoview.lookup").value)'
|
||||
value="<%:Query%>" />
|
||||
<input type="text" class="cbi-textfield" id="geoview.lookup" name="geoview.lookup" />
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" id="lookup-view_btn"
|
||||
onclick='do_geoview(this, "lookup", document.getElementById("geoview.lookup").value)'
|
||||
value="<%:Query%>" />
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Enter a domain or IP to query the Geo rule list they belong to.%>
|
||||
<%:Enter a domain or IP to query the Geo rule list they belong to.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-passwall-geoview-extract"><label class="cbi-value-title" for="geoview.extract"><%:GeoIP/Geosite Query%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" class="cbi-textfield" id="geoview.extract" name="geoview.extract">
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" id="extract-view_btn"
|
||||
onclick='do_geoview(this, "extract", document.getElementById("geoview.extract").value)'
|
||||
value="<%:Query%>" />
|
||||
<input type="text" class="cbi-textfield" id="geoview.extract" name="geoview.extract" />
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" id="extract-view_btn"
|
||||
onclick='do_geoview(this, "extract", document.getElementById("geoview.extract").value)'
|
||||
value="<%:Query%>" />
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Enter a GeoIP or Geosite to extract the domains/IPs they contain. Format: geoip:cn or geosite:gfw%>
|
||||
<%:Enter a GeoIP or Geosite to extract the domains/IPs they contain. Format: geoip:cn or geosite:gfw%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,9 +59,10 @@ local api = require "luci.passwall.api"
|
||||
var QueryingText = '<%:Querying%>';
|
||||
|
||||
function do_geoview(btn,action,value) {
|
||||
value = value.trim();
|
||||
if (!value) {
|
||||
alert("<%:Please enter query content!%>");
|
||||
return;
|
||||
alert("<%:Please enter query content!%>");
|
||||
return;
|
||||
}
|
||||
lookup_btn.disabled = true;
|
||||
extract_btn.disabled = true;
|
||||
@ -78,4 +79,4 @@ local api = require "luci.passwall.api"
|
||||
})
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user