Browse Source

add hint to gfwlist add or not

rufengsuixing 5 years ago
parent
commit
912817cdb1
2 changed files with 13 additions and 1 deletions
  1. 7 1
      luasrc/model/cbi/AdGuardHome.lua
  2. 6 0
      po/zh-cn/AdGuardHome.po

+ 7 - 1
luasrc/model/cbi/AdGuardHome.lua

@@ -90,7 +90,13 @@ o.datatype    = "string"
 o = s:option(Flag, "verbose", translate("Verbose log"))
 o = s:option(Flag, "verbose", translate("Verbose log"))
 o.default = 0
 o.default = 0
 ---- gfwlist 
 ---- gfwlist 
-o=s:option(Button,"gfwadd",translate("Add gfwlist"))
+local a=luci.sys.call("grep -m 1 -q programadd "..configpath)
+if (a==0) then
+a="Added"
+else
+a="Not added"
+end
+o=s:option(Button,"gfwadd",translate("Add gfwlist"),translate(a))
 o.inputtitle=translate("Add")
 o.inputtitle=translate("Add")
 o.write=function()
 o.write=function()
 luci.sys.exec("sh /usr/share/AdGuardHome/gfw2adg.sh 2>&1")
 luci.sys.exec("sh /usr/share/AdGuardHome/gfw2adg.sh 2>&1")

+ 6 - 0
po/zh-cn/AdGuardHome.po

@@ -76,6 +76,12 @@ msgstr "加入gfw列表"
 msgid "Add"
 msgid "Add"
 msgstr "添加"
 msgstr "添加"
 
 
+msgid "Added"
+msgstr "已添加"
+
+msgid "Not added"
+msgstr "未添加"
+
 msgid "Gfwlist upstream dns server"
 msgid "Gfwlist upstream dns server"
 msgstr "gfw列表上游服务器"
 msgstr "gfw列表上游服务器"