🚀 Sync 2026-03-18 20:29:42

This commit is contained in:
github-actions[bot] 2026-03-18 20:29:42 +08:00
parent 4e0eb61db3
commit 5cf447534d
212 changed files with 6047 additions and 30308 deletions

View File

@ -1,15 +1,14 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2025-10-27 15:04+0000\n"
"Last-Translator: 109247019824 "
"<109247019824@users.noreply.hosted.weblate.org>\n"
"PO-Revision-Date: 2026-03-15 08:27+0000\n"
"Last-Translator: Daniel Konstantinov <bgshadow2010@gmail.com>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/bg/>\n"
"Language: bg\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.14.1-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled"
@ -778,12 +777,12 @@ msgstr ""
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:594
msgid "falloc"
msgstr ""
msgstr "falloc"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:592
msgid "prealloc"
msgstr ""
msgstr "prealloc"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:593
msgid "trunc"
msgstr ""
msgstr "trunc"

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2026-01-28 10:51+0000\n"
"PO-Revision-Date: 2026-03-08 17:29+0000\n"
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/cs/>\n"
@ -8,7 +8,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled"
@ -262,7 +262,7 @@ msgstr ""
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:231
msgid "Info"
msgstr "Pro informaci"
msgstr "Info"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:41
msgid "Installed web interface:"

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2026-02-10 18:11+0000\n"
"PO-Revision-Date: 2026-03-09 19:10+0000\n"
"Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\n"
"Language-Team: Irish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/ga/>\n"
@ -9,7 +9,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :"
"(n>6 && n<11) ? 3 : 4;\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled"
@ -265,7 +265,7 @@ msgstr ""
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:231
msgid "Info"
msgstr "Faisnéis"
msgstr "Eolas"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:41
msgid "Installed web interface:"

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2026-02-15 08:21+0000\n"
"PO-Revision-Date: 2026-03-14 19:10+0000\n"
"Last-Translator: Hyeonjeong Lee <h9101654@gmail.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/ko/>\n"
@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled"
msgstr ""
msgstr "<abbr title=\"로컬 피어 탐색(Local Peer Discovery)\">LPD</abbr> 활성화"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:551
msgid "Additional BT tracker"

View File

@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2026-01-20 07:02+0000\n"
"Last-Translator: Nicolas Aigner <nicolas.aigner@gmail.com>\n"
"PO-Revision-Date: 2026-03-10 02:29+0000\n"
"Last-Translator: Volenski <volenski@users.noreply.hosted.weblate.org>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsaria2/pt_BR/>\n"
"Language: pt_BR\n"
@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled"
@ -99,7 +99,7 @@ msgstr "Diretório dos arquivos de configuração"
#: applications/luci-app-aria2/root/usr/share/luci/menu.d/luci-app-aria2.json:15
msgid "Configuration"
msgstr "Configurações"
msgstr "Configuração"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:367
msgid "Connect timeout"
@ -590,8 +590,8 @@ msgid ""
"you can add Cache-Control header with a directive you like using \"Header\" "
"option."
msgstr ""
"Envie os cabeçalhos <code> Cache-Control: no-cache </code> e <code> Pragma: "
"no-cache </code> para evitar a cache de conteúdo. Se desativado, estes "
"Enviar cabeçalho <code>Cache-Control: no-cache</code> e <code>Pragma: no-"
"cache</code> para evitar conteúdo armazenado em cache. Se desativado, estes "
"cabeçalhos não são enviados e você pode adicionar o cabeçalho Cache-Control "
"com uma diretiva que você gosta usando a opção \"Cabeçalho\"."

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2026-03-06 07:15+0000\n"
"PO-Revision-Date: 2026-03-09 19:11+0000\n"
"Last-Translator: nKsyn <e.nksyn@gmail.com>\n"
"Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsaria2/zh_Hans/>\n"
@ -377,7 +377,7 @@ msgstr "无"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:232
msgid "Notice"
msgstr "通知"
msgstr "通知 (Notice)"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:242
msgid "Pause"

View File

@ -3,7 +3,7 @@
#
msgid ""
msgstr ""
"PO-Revision-Date: 2026-02-28 09:35+0000\n"
"PO-Revision-Date: 2026-03-11 18:10+0000\n"
"Last-Translator: EESF-2 <eesf-2@users.noreply.hosted.weblate.org>\n"
"Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsaria2/zh_Hant/>\n"
@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.16.1-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled"
@ -124,7 +124,7 @@ msgstr ""
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:577
msgid "Disk cache"
msgstr "碟快取"
msgstr "碟快取"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:396
msgid "Don't split less than 2*SIZE byte range. Possible values: 1M-1024M."
@ -156,11 +156,11 @@ msgstr "啟用對等點交換擴充。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:579
msgid "Enable disk cache (in bytes), set 0 to disabled."
msgstr "啟用碟快取 (Bytes),設定 0 為停用。"
msgstr "啟用碟快取 (Bytes),設定 0 為停用。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:220
msgid "Enable logging"
msgstr "啟用日誌"
msgstr "啟用紀錄"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:442
msgid "Enable peer exchange"
@ -275,11 +275,11 @@ msgstr "保留在記憶體中"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:31
msgid "Last 50 lines of log file:"
msgstr "日誌檔案最後 50 行:"
msgstr "紀錄檔案最後 50 行:"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:36
msgid "Last 50 lines of syslog:"
msgstr "系統日誌最後 50 行:"
msgstr "系統紀錄最後 50 行:"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:210
msgid "Leave blank to use default user."
@ -303,19 +303,19 @@ msgstr "載入中"
#: applications/luci-app-aria2/root/usr/share/luci/menu.d/luci-app-aria2.json:33
msgid "Log"
msgstr "日誌"
msgstr "紀錄"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:58
msgid "Log Data"
msgstr "日誌資料"
msgstr "紀錄資料"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:223
msgid "Log file"
msgstr "日誌檔案"
msgstr "紀錄檔案"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:228
msgid "Log level"
msgstr "日誌等級"
msgstr "紀錄等級"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:377
msgid "Lowest speed limit"
@ -372,7 +372,7 @@ msgstr "無認證"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:33
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:38
msgid "No log data."
msgstr "無日誌資料。"
msgstr "無紀錄資料。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:591
msgid "None"
@ -408,7 +408,7 @@ msgstr "Peer ID 前綴"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:341
msgid "Private key"
msgstr "私密金鑰"
msgstr "私鑰"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:317
msgid "Proxy password"
@ -440,7 +440,7 @@ msgstr "RPC 連接埠"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:293
msgid "RPC private key"
msgstr "RPC 私密金鑰"
msgstr "RPC 私鑰"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:276
msgid "RPC secure"
@ -476,7 +476,7 @@ msgid ""
"Please use this option with care because it will actually remove files from "
"your disk."
msgstr ""
"BitTorrent 下載完成後刪除未選檔案。請小心使用此選項,因為它實際上會從碟中刪"
"BitTorrent 下載完成後刪除未選檔案。請小心使用此選項,因為它實際上會從碟中刪"
"除檔案。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:514
@ -725,7 +725,7 @@ msgstr "儲存下載檔案的目錄。例如: <code>/mnt/sda1</code>。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:224
msgid "The file name of the log file."
msgstr "日誌檔案名稱。"
msgstr "紀錄檔案名稱。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:386
msgid "The maximum number of connections to one server for each download."
@ -771,9 +771,10 @@ msgid ""
msgstr ""
"RPC 伺服器使用的憑證檔案。憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。<br/"
">PKCS12 檔案必須包含憑證、金鑰以及可選的附加憑證鏈,且該檔案不能有匯入密碼!"
"<br/>使用 PEM 時,您必須同時指定 RPC 私密金鑰。"
"<br/>使用 PEM 時,您必須同時指定 RPC 私鑰。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:335
#, fuzzy
msgid ""
"Use the client certificate in FILE. The certificate must be either in PKCS12 "
"(.p12, .pfx) or in PEM format.<br/>PKCS12 files must contain the "
@ -783,19 +784,20 @@ msgid ""
msgstr ""
"用戶端使用的憑證檔案。憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。<br/>PKCS12 "
"檔案必須包含憑證、金鑰以及可選的附加憑證鏈,且該檔案不能有匯入密碼!<br/>使"
"用 PEM 時,您必須同時指定私密金鑰。"
"用 PEM 時,您必須同時指定私鑰。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:294
msgid ""
"Use the private key in FILE for RPC server. The private key must be "
"decrypted and in PEM format."
msgstr "RPC 伺服器使用的私密金鑰檔案。私密金鑰必須被解密,且格式為 PEM。"
msgstr "RPC 伺服器使用的私鑰檔案。私鑰必須被解密,且格式為 PEM。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:342
#, fuzzy
msgid ""
"Use the private key in FILE. The private key must be decrypted and in PEM "
"format. The behavior when encrypted one is given is undefined."
msgstr "使用的私密金鑰檔案。其必須被解密且為 PEM 格式。"
msgstr "使用的私鑰檔案。其必須被解密且為 PEM 格式。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:408
msgid "User agent"

View File

@ -1,15 +1,14 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2025-10-27 15:04+0000\n"
"Last-Translator: 109247019824 "
"<109247019824@users.noreply.hosted.weblate.org>\n"
"PO-Revision-Date: 2026-03-15 08:27+0000\n"
"Last-Translator: Daniel Konstantinov <bgshadow2010@gmail.com>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/bg/>\n"
"Language: bg\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.14.1-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason."
@ -17,7 +16,7 @@ msgstr "\"../\" не се разрешава в пътя заради сигур
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:763
msgid "A.k.a. the TOKEN at e.g. afraid.org"
msgstr ""
msgstr "Познат още като TOKEN, например на afraid.org"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:458
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:526

View File

@ -2,8 +2,9 @@ msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2025-12-02 19:00+0000\n"
"Last-Translator: Alfonso Montero López <amontero@tinet.org>\n"
"PO-Revision-Date: 2026-03-08 17:33+0000\n"
"Last-Translator: Christopher Picón "
"<ntrpc.tech@users.noreply.hosted.weblate.org>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/ca/>\n"
"Language: ca\n"
@ -11,11 +12,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason."
msgstr ""
msgstr "No es permet «../» a la ruta per motius de seguretat."
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:763
msgid "A.k.a. the TOKEN at e.g. afraid.org"
@ -28,7 +29,7 @@ msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:607
msgid "Advanced Settings"
msgstr "Configuració avançada"
msgstr "Configuració Avançada"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:392
msgid "Allow non-public IPs"
@ -115,7 +116,6 @@ msgid "Custom update script for updating your DDNS Provider."
msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:708
#, fuzzy
msgid "Custom update-URL"
msgstr "URL d'actualització personalitzada"

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2026-01-28 10:51+0000\n"
"PO-Revision-Date: 2026-03-08 17:30+0000\n"
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/cs/>\n"
@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason."
@ -297,7 +297,7 @@ msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:806
msgid "IP address source"
msgstr "Zdrojová IP adresa"
msgstr "Zdroj IP adresy"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:503
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:629
@ -354,7 +354,7 @@ msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:963
msgid "Info"
msgstr "Pro informaci"
msgstr "Info"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:264
msgid "Information"
@ -930,7 +930,7 @@ msgstr "nebo aktualizujte systém na nejnovější verzi OpenWrt"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1000
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1062
msgid "seconds"
msgstr "sekundy/sekund"
msgstr "sekund"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:793
msgid "to run HTTPS without verification of server certificates (insecure)"

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2026-03-05 00:31+0000\n"
"PO-Revision-Date: 2026-03-13 14:10+0000\n"
"Last-Translator: Franco Castillo <castillofrancodamian@gmail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/es/>\n"

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2026-02-05 11:43+0000\n"
"PO-Revision-Date: 2026-03-09 19:11+0000\n"
"Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\n"
"Language-Team: Irish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/ga/>\n"
@ -9,7 +9,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :"
"(n>6 && n<11) ? 3 : 4;\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason."
@ -351,7 +351,7 @@ msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:963
msgid "Info"
msgstr "Faisnéis"
msgstr "Eolas"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:264
msgid "Information"

View File

@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2026-01-20 07:02+0000\n"
"Last-Translator: Nicolas Aigner <nicolas.aigner@gmail.com>\n"
"PO-Revision-Date: 2026-03-09 19:11+0000\n"
"Last-Translator: Volenski <volenski@users.noreply.hosted.weblate.org>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsddns/pt_BR/>\n"
"Language: pt_BR\n"
@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 5.16-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason."
@ -36,7 +36,7 @@ msgstr "Permitir IPs não-públicos"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:606
msgid "Basic Settings"
msgstr "Configurações básicas"
msgstr "Configurações Básicas"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:903
msgid "Bind Network"
@ -88,7 +88,7 @@ msgstr "Verificar a Unidade"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/status/include/70_ddns.js:27
msgid "Configuration"
msgstr "Configurações"
msgstr "Configuração"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:226
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1134
@ -814,7 +814,7 @@ msgstr "Script definido pelo usuário para ler endereço IP do sistema"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:754
msgid "Username"
msgstr "Nome do usuário"
msgstr "Nome de usuário"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:371
msgid "Using specific DNS Server not supported"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2026-03-06 07:15+0000\n"
"PO-Revision-Date: 2026-03-09 19:11+0000\n"
"Last-Translator: nKsyn <e.nksyn@gmail.com>\n"
"Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsddns/zh_Hans/>\n"
@ -498,7 +498,7 @@ msgstr "未在运行"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:964
msgid "Notice"
msgstr "通知"
msgstr "通知 (Notice)"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:429
msgid "Number of last lines stored in log files"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2026-02-20 00:33+0000\n"
"PO-Revision-Date: 2026-03-09 19:12+0000\n"
"Last-Translator: EESF-2 <eesf-2@users.noreply.hosted.weblate.org>\n"
"Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsddns/zh_Hant/>\n"
@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.16.1-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason."
@ -96,7 +96,7 @@ msgstr "配置錯誤"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:417
msgid "Contains Log files for each running section."
msgstr "包含每個執行區域的日誌檔案。"
msgstr "包含每個執行區域的紀錄檔案。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:411
msgid "Contains PID and other status information for each running section."
@ -389,15 +389,15 @@ msgstr "最後更新"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:609
msgid "Log File Viewer"
msgstr "日誌檔案檢視器"
msgstr "紀錄檔案檢視器"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:416
msgid "Log directory"
msgstr "日誌目錄"
msgstr "紀錄目錄"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:428
msgid "Log length"
msgstr "日誌長度"
msgstr "紀錄長度"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:969
msgid "Log to file"
@ -405,7 +405,7 @@ msgstr "記錄至檔案"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:957
msgid "Log to syslog"
msgstr "記錄至系統日誌"
msgstr "記錄至系統紀錄"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:621
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1130
@ -482,7 +482,7 @@ msgstr "未找到憑證"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:962
msgid "No logging"
msgstr "無日誌"
msgstr "無紀錄"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:393
msgid "Non-public and by default blocked IPs"
@ -499,7 +499,7 @@ msgstr "注意"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:429
msgid "Number of last lines stored in log files"
msgstr "日誌檔案中儲存的最後行數"
msgstr "紀錄檔案中儲存的最後行數"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:916
msgid "OPTIONAL: Force the usage of pure IPv4/IPv6 only communication."
@ -570,7 +570,7 @@ msgstr "提供更新指令碼或更新 URL"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1069
msgid "Read / Reread log file"
msgstr "讀取 / 重讀日誌檔案"
msgstr "讀取 / 重讀紀錄檔案"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:693
msgid "Really switch service?"
@ -722,7 +722,7 @@ msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1085
msgid "This is the current content of the log file in %h for this service."
msgstr "這是此服務在 %h 中日誌檔案的當前內容。"
msgstr "這是此服務在 %h 中紀錄檔案的當前內容。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:210
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:277
@ -817,13 +817,13 @@ msgstr "重試計數器使用的時間單位。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:974
msgid ""
"Writes detailed messages to log file. File will be truncated automatically."
msgstr "將詳細訊息寫入日誌檔案。檔案會自動截斷。"
msgstr "將詳細訊息寫入紀錄檔案。檔案會自動截斷。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:958
msgid ""
"Writes log messages to syslog. Critical Errors will always be written to "
"syslog."
msgstr "將日誌訊息寫入系統日誌。嚴重錯誤將始終寫入系統日誌。"
msgstr "將紀錄訊息寫入系統紀錄。嚴重錯誤將始終寫入系統紀錄。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:375
msgid ""

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2026-03-05 17:52+0000\n"
"Last-Translator: Nikolay Tsanov <nick.tsanov@gmail.com>\n"
"PO-Revision-Date: 2026-03-15 08:27+0000\n"
"Last-Translator: Daniel Konstantinov <bgshadow2010@gmail.com>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsksmbd/bg/>\n"
"Language: bg\n"
@ -17,7 +17,7 @@ msgstr ""
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:57
msgid "Allow guest on IPC$."
msgstr ""
msgstr "Разреши гост достъп до IPC$."
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:103
msgid "Allow guests"
@ -25,13 +25,15 @@ msgstr "Разрешаване на гости"
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:60
msgid "Allow legacy (insecure) protocols/authentication."
msgstr ""
msgstr "Разреши стари (несигурни) протоколи/автентикация."
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:61
msgid ""
"Allow legacy smb(v1)/Lanman connections, needed for older devices without "
"smb(v2.1/3) support."
msgstr ""
"Разреши стари smb(v1)/Lanman връзки, необходими за по-стари устройства без "
"поддръжка на smb(v2.1/3)."
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:100
msgid "Allowed users"

View File

@ -1,14 +1,15 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2022-07-25 17:15+0000\n"
"Last-Translator: dtalens <databio@gmail.com>\n"
"PO-Revision-Date: 2026-03-08 17:32+0000\n"
"Last-Translator: Christopher Picón "
"<ntrpc.tech@users.noreply.hosted.weblate.org>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsksmbd/ca/>\n"
"Language: ca\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.14-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:58
msgid "Add optional guest access to IPC$ share, disabled by default"
@ -20,7 +21,7 @@ msgstr ""
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:103
msgid "Allow guests"
msgstr ""
msgstr "Permet convidats"
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:60
msgid "Allow legacy (insecure) protocols/authentication."

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08 13:02+0000\n"
"PO-Revision-Date: 2026-03-08 17:30+0000\n"
"Last-Translator: hmzs <hmzs@1szer1.hu>\n"
"Language-Team: Hungarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsksmbd/hu/>\n"
@ -8,7 +8,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.12-dev\n"
"X-Generator: Weblate 5.17-dev\n"
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:58
msgid "Add optional guest access to IPC$ share, disabled by default"

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.47.055
PKG_RELEASE:=1
PKG_VERSION:=0.47.071
PKG_RELEASE:=2
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@ -33,7 +33,6 @@ define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/config
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/rule_provider
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/proxy_provider
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/backup
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/core
mkdir -p $(PKG_BUILD_DIR)/root/usr/share/openclash/backup/overwrite
cp -f "$(PKG_BUILD_DIR)/root/etc/config/openclash" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash" >/dev/null 2>&1
@ -83,8 +82,6 @@ endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
uci -q set openclash.config.enable=0
uci -q commit openclash
[ -n "$(pidof clash)" ] && /etc/init.d/openclash stop 2>/dev/null
if [ -f "/etc/config/openclash" ] && [ ! -f "/tmp/openclash.bak" ]; then
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
@ -110,17 +107,12 @@ define Package/$(PKG_NAME)/postrm
rm -rf /tmp/openclash_start.log >/dev/null 2>&1
rm -rf /tmp/openclash_last_version >/dev/null 2>&1
rm -rf /tmp/openclash.change >/dev/null 2>&1
rm -rf /tmp/Proxy_Group >/dev/null 2>&1
rm -rf /tmp/rules_name >/dev/null 2>&1
rm -rf /tmp/rule_providers_name >/dev/null 2>&1
rm -rf /tmp/clash_last_version >/dev/null 2>&1
rm -rf /usr/share/openclash >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_custom_domain.conf >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute_pass.conf >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute6_pass.conf >/dev/null 2>&1
rm -rf /tmp/dler* >/dev/null 2>&1
rm -rf /tmp/etc/openclash >/dev/null 2>&1
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
rm -rf /tmp/openclash_announcement >/dev/null 2>&1
rm -rf /www/luci-static/resources/openclash >/dev/null 2>&1
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1

View File

@ -42,11 +42,6 @@ function index()
entry({"admin", "services", "openclash", "one_key_update_check"}, call("action_one_key_update_check"))
entry({"admin", "services", "openclash", "switch_mode"}, call("action_switch_mode"))
entry({"admin", "services", "openclash", "op_mode"}, call("action_op_mode"))
entry({"admin", "services", "openclash", "dler_info"}, call("action_dler_info"))
entry({"admin", "services", "openclash", "dler_checkin"}, call("action_dler_checkin"))
entry({"admin", "services", "openclash", "dler_logout"}, call("action_dler_logout"))
entry({"admin", "services", "openclash", "dler_login"}, call("action_dler_login"))
entry({"admin", "services", "openclash", "dler_login_info_save"}, call("action_dler_login_info_save"))
entry({"admin", "services", "openclash", "sub_info_get"}, call("sub_info_get"))
entry({"admin", "services", "openclash", "config_name"}, call("action_config_name"))
entry({"admin", "services", "openclash", "switch_config"}, call("action_switch_config"))
@ -75,22 +70,17 @@ function index()
entry({"admin", "services", "openclash", "announcement"}, call("action_announcement"))
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Plugin Settings"), 30).leaf = true
entry({"admin", "services", "openclash", "config-overwrite"},cbi("openclash/config-overwrite"),_("Overwrite Settings"), 40).leaf = true
entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),_("Onekey Create"), 50).leaf = true
entry({"admin", "services", "openclash", "config-subscribe"},cbi("openclash/config-subscribe"),_("Config Subscribe"), 60).leaf = true
entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),nil).leaf = true
entry({"admin", "services", "openclash", "other-rules-edit"},cbi("openclash/other-rules-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "custom-dns-edit"},cbi("openclash/custom-dns-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "other-file-edit"},cbi("openclash/other-file-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-settings"},cbi("openclash/rule-providers-settings"),_("Rule Providers Append"), 60).leaf = true
entry({"admin", "services", "openclash", "game-rules-manage"},form("openclash/game-rules-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-manage"},form("openclash/rule-providers-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "proxy-provider-file-manage"},form("openclash/proxy-provider-file-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-file-manage"},form("openclash/rule-providers-file-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "game-rules-file-manage"},form("openclash/game-rules-file-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "config-subscribe"},cbi("openclash/config-subscribe"),_("Config Subscribe"), 70).leaf = true
entry({"admin", "services", "openclash", "config-subscribe-edit"},cbi("openclash/config-subscribe-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "servers-config"},cbi("openclash/servers-config"), nil).leaf = true
entry({"admin", "services", "openclash", "groups-config"},cbi("openclash/groups-config"), nil).leaf = true
entry({"admin", "services", "openclash", "proxy-provider-config"},cbi("openclash/proxy-provider-config"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-config"},cbi("openclash/rule-providers-config"), nil).leaf = true
entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Config Manage"), 80).leaf = true
entry({"admin", "services", "openclash", "log"},cbi("openclash/log"),_("Server Logs"), 90).leaf = true
entry({"admin", "services", "openclash", "myip_check"}, call("action_myip_check"))
@ -177,19 +167,13 @@ end
local function startlog()
local info = ""
local line_trans = ""
if fs.access("/tmp/openclash_start.log") then
info = luci.sys.exec("sed -n '$p' /tmp/openclash_start.log 2>/dev/null")
line_trans = info
if string.len(info) > 0 then
if not string.find (info, "") or not string.find (info, "") then
line_trans = trans_line_nolabel(info)
else
line_trans = trans_line(info)
end
end
info = trans_line(info)
end
end
return line_trans
return info
end
local function pkg_type()
@ -234,23 +218,19 @@ local function coremetacv()
end
local function corelv()
local status = process_status("/usr/share/openclash/clash_version.sh")
local core_meta_lv = ""
local core_smart_enable = fs.uci_get_config("config", "smart_enable") or "0"
if not status then
if fs.access("/tmp/clash_last_version") and tonumber(os.time() - fs.mtime("/tmp/clash_last_version")) < 1800 then
if core_smart_enable == "1" then
core_meta_lv = luci.sys.exec("sed -n 2p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
else
core_meta_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
end
if fs.access("/tmp/clash_last_version") then
if core_smart_enable == "1" then
core_meta_lv = luci.sys.exec("sed -n 2p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
else
action_get_last_version()
core_meta_lv = "loading..."
core_meta_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
end
else
core_meta_lv = "loading..."
end
action_get_last_version()
return core_meta_lv
end
@ -274,23 +254,19 @@ local function opcv()
end
local function oplv()
local status = process_status("/usr/share/openclash/openclash_version.sh")
local oplv = ""
if not status then
if fs.access("/tmp/openclash_last_version") and tonumber(os.time() - fs.mtime("/tmp/openclash_last_version")) < 1800 then
oplv = luci.sys.exec("sed -n 1p /tmp/openclash_last_version 2>/dev/null |tr -d '\n'")
else
action_get_last_version()
oplv = "loading..."
end
if fs.access("/tmp/openclash_last_version") then
oplv = luci.sys.exec("sed -n 1p /tmp/openclash_last_version 2>/dev/null |tr -d '\n'")
else
oplv = "loading..."
end
action_get_last_version()
return oplv
end
local function opup()
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_version.sh >/dev/null 2>&1")
return luci.sys.call("bash /usr/share/openclash/openclash_update.sh >/dev/null 2>&1 &")
end
@ -298,7 +274,6 @@ local function coreup()
uci:set("openclash", "config", "enable", "1")
uci:commit("openclash")
local type = luci.http.formvalue("core_type")
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
return luci.sys.call(string.format("/usr/share/openclash/openclash_core.sh '%s' >/dev/null 2>&1 &", type))
end
@ -346,21 +321,13 @@ end
function core_download()
local cdn_url = luci.http.formvalue("url")
if cdn_url then
luci.sys.call(string.format("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh '%s' >/dev/null 2>&1", cdn_url))
luci.sys.call(string.format("bash /usr/share/openclash/openclash_core.sh 'Meta' '%s' >/dev/null 2>&1 &", cdn_url))
else
luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &")
end
end
function download_rule()
local filename = luci.http.formvalue("filename")
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_rule_list.sh "%s" >/dev/null 2>&1',filename))
return state
end
function action_flush_dns_cache()
local state = 0
if is_running() then
@ -368,8 +335,8 @@ function action_flush_dns_cache()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
fake_ip_state = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/fakeip/flush', dase, daip, cn_port))
dns_state = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/dns/flush', dase, daip, cn_port))
fake_ip_state = luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/fakeip/flush', dase, daip, cn_port))
dns_state = luci.sys.exec(string.format('curl -sL -m 3 --retry 2-H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/dns/flush', dase, daip, cn_port))
end
luci.http.prepare_content("application/json")
luci.http.write_json({
@ -384,7 +351,7 @@ function action_flush_smart_cache()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
flush_state = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/smart/flush', dase, daip, cn_port))
flush_state = luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/smart/flush', dase, daip, cn_port))
end
luci.http.prepare_content("application/json")
luci.http.write_json({
@ -393,13 +360,8 @@ function action_flush_smart_cache()
end
function action_update_config()
-- filename or config_file is basename
-- filename is basename
local filename = luci.http.formvalue("filename")
local config_file = luci.http.formvalue("config_file")
if not filename and config_file then
filename = config_file
end
luci.http.prepare_content("application/json")
@ -450,195 +412,9 @@ end
function action_one_key_update()
local cdn_url = luci.http.formvalue("url")
if cdn_url then
return luci.sys.call(string.format("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_update.sh 'one_key_update' '%s' >/dev/null 2>&1 &", cdn_url))
return luci.sys.call(string.format("bash /usr/share/openclash/openclash_update.sh 'one_key_update' '%s' >/dev/null 2>&1 &", cdn_url))
else
return luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_update.sh 'one_key_update' >/dev/null 2>&1 &")
end
end
local function dler_login_info_save()
uci:set("openclash", "config", "dler_email", luci.http.formvalue("email"))
uci:set("openclash", "config", "dler_passwd", luci.http.formvalue("passwd"))
uci:set("openclash", "config", "dler_checkin", luci.http.formvalue("checkin"))
uci:set("openclash", "config", "dler_checkin_interval", luci.http.formvalue("interval"))
if tonumber(luci.http.formvalue("multiple")) > 100 then
uci:set("openclash", "config", "dler_checkin_multiple", "100")
elseif tonumber(luci.http.formvalue("multiple")) < 1 or not tonumber(luci.http.formvalue("multiple")) then
uci:set("openclash", "config", "dler_checkin_multiple", "1")
else
uci:set("openclash", "config", "dler_checkin_multiple", luci.http.formvalue("multiple"))
end
uci:commit("openclash")
return "success"
end
local function dler_login()
local info, token, get_sub, sub_info, sub_key, sub_match, sub_convert, sid
local sub_path = "/tmp/dler_sub"
local email = fs.uci_get_config("config", "dler_email")
local passwd = fs.uci_get_config("config", "dler_passwd")
if email and passwd then
info = luci.sys.exec(string.format("curl -sL -H 'Content-Type: application/json' -d '{\"email\":\"%s\", \"passwd\":\"%s\", \"token_expire\":\"365\" }' -X POST https://dler.cloud/api/v1/login", email, passwd))
if info then
info = json.parse(info)
end
if info and info.ret == 200 then
token = info.data.token
uci:set("openclash", "config", "dler_token", token)
uci:commit("openclash")
get_sub = string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/managed/clash -o %s", token, sub_path)
luci.sys.exec(get_sub)
sub_info = fs.readfile(sub_path)
if sub_info then
sub_info = json.parse(sub_info)
end
if sub_info and sub_info.ret == 200 then
sub_key = {"smart","ss","vmess","trojan"}
for _,v in ipairs(sub_key) do
while true do
sub_match = false
sub_convert = false
uci:foreach("openclash", "config_subscribe",
function(s)
if s.name == "Dler Cloud - " .. v and s.address == sub_info[v] then
sub_match = true
end
if s.name == "Dler Cloud - " .. v and s.address ~= sub_info[v] then
sub_convert = true
sid = s['.name']
end
end)
if sub_match then break end
if sub_convert then
uci:set("openclash", sid, "address", sub_info[v])
else
sid = uci:add("openclash", "config_subscribe")
uci:set("openclash", sid, "name", "Dler Cloud - " .. v)
uci:set("openclash", sid, "address", sub_info[v])
end
uci:commit("openclash")
break
end
luci.sys.exec(string.format('curl -sL -m 3 --retry 2 --user-agent "clash" "%s" -o "/etc/openclash/config/Dler Cloud - %s.yaml" >/dev/null 2>&1', sub_info[v], v))
end
end
return info.ret
else
uci:delete("openclash", "config", "dler_token")
uci:commit("openclash")
fs.unlink(sub_path)
fs.unlink("/tmp/dler_checkin")
fs.unlink("/tmp/dler_info")
if info and info.msg then
return info.msg
else
return "login faild"
end
end
else
uci:delete("openclash", "config", "dler_token")
uci:commit("openclash")
fs.unlink(sub_path)
fs.unlink("/tmp/dler_checkin")
fs.unlink("/tmp/dler_info")
return "email or passwd is wrong"
end
end
local function dler_logout()
local info, token
local token = fs.uci_get_config("config", "dler_token")
if token then
info = luci.sys.exec(string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/logout", token))
if info then
info = json.parse(info)
end
if info and info.ret == 200 then
uci:delete("openclash", "config", "dler_token")
uci:delete("openclash", "config", "dler_checkin")
uci:delete("openclash", "config", "dler_checkin_interval")
uci:delete("openclash", "config", "dler_checkin_multiple")
uci:commit("openclash")
fs.unlink("/tmp/dler_sub")
fs.unlink("/tmp/dler_checkin")
fs.unlink("/tmp/dler_info")
return info.ret
else
if info and info.msg then
return info.msg
else
return "logout faild"
end
end
else
return "logout faild"
end
end
local function dler_info()
local info, path, get_info
local token = fs.uci_get_config("config", "dler_token")
path = "/tmp/dler_info"
if token then
get_info = string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/information -o %s", token, path)
if not fs.access(path) then
luci.sys.exec(get_info)
else
if fs.readfile(path) == "" or not fs.readfile(path) then
luci.sys.exec(get_info)
else
if (os.time() - fs.mtime(path) > 900) then
luci.sys.exec(get_info)
end
end
end
info = fs.readfile(path)
if info then
info = json.parse(info)
end
if info and info.ret == 200 and info.data then
return info.data
elseif info and info.msg and info.msg ~= "api error, ignore" then
luci.sys.exec(string.format("echo -e %s Dler Cloud Account Login Failed, The Error Info is【%s】 >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S"), info.msg))
info.msg = "api error, ignore"
fs.writefile(path, json.stringify(info))
elseif info and info.msg and info.msg == "api error, ignore" then
return "error"
else
fs.unlink(path)
luci.sys.exec(string.format("echo -e %s Dler Cloud Account Login Failed! Please Check And Try Again... >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S")))
end
return "error"
else
return "error"
end
end
local function dler_checkin()
local info
local path = "/tmp/dler_checkin"
local token = fs.uci_get_config("config", "dler_token")
local multiple = fs.uci_get_config("config", "dler_checkin_multiple") or 1
if token then
info = luci.sys.exec(string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\", \"multiple\":\"%s\"}' -X POST https://dler.cloud/api/v1/checkin", token, multiple))
if info then
info = json.parse(info)
end
if info and info.ret == 200 then
fs.unlink("/tmp/dler_info")
fs.writefile(path, info)
luci.sys.exec(string.format("echo -e %s Dler Cloud Checkin Successful, Result:【%s】 >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S"), info.data.checkin))
return info
else
if info and info.msg then
luci.sys.exec(string.format("echo -e %s Dler Cloud Checkin Failed, Result:【%s】 >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S"), info.msg))
else
luci.sys.exec(string.format("echo -e %s Dler Cloud Checkin Failed! Please Check And Try Again... >> /tmp/openclash.log",os.date("%Y-%m-%d %H:%M:%S")))
end
return info
end
else
return "error"
return luci.sys.call("bash /usr/share/openclash/openclash_update.sh 'one_key_update' >/dev/null 2>&1 &")
end
end
@ -761,10 +537,10 @@ function fetch_sub_info(sub_url, sub_ua)
local info, upload, download, total, day_expire, http_code
local used, expire, day_left, percent, surplus
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 -w 'http_code=%%{http_code}' -H 'User-Agent: %s' '%s'", sub_ua, sub_url))
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 --retry 2 -w 'http_code=%%{http_code}' -H 'User-Agent: %s' '%s'", sub_ua, sub_url))
local http_match = string.match(info, "http_code=(%d+)")
if not info or not http_match or tonumber(http_match) ~= 200 then
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 -w 'http_code=%%{http_code}' -H 'User-Agent: Quantumultx' '%s'", sub_url))
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 --retry 2 -w 'http_code=%%{http_code}' -H 'User-Agent: Quantumultx' '%s'", sub_url))
http_match = string.match(info, "http_code=(%d+)")
end
@ -972,7 +748,7 @@ function get_sub_url(filename)
end
function sub_info_get()
local sub_ua, filename, sub_info
local sub_ua, filename, sub_info, url_result
local providers_data = {}
filename = luci.http.formvalue("filename")
@ -988,7 +764,7 @@ function sub_info_get()
)
if filename and not is_start() then
local url_result = get_sub_url(filename)
url_result = get_sub_url(filename)
if not url_result then
sub_info = "No Sub Info Found"
@ -1021,7 +797,8 @@ function sub_info_get()
luci.http.write_json({
sub_info = sub_info,
providers = providers_data,
get_time = os.time()
get_time = os.time(),
url_result = url_result
})
end
@ -1032,7 +809,7 @@ function action_rule_mode()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
if info then
mode = info["mode"]
else
@ -1061,7 +838,7 @@ function action_switch_rule_mode()
if is_running() then
if not daip or not cn_port then luci.http.status(500, "Switch Faild") return end
info = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"mode\": \"%s\"}\'', dase, daip, cn_port, mode))
info = luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"mode\": \"%s\"}\'', dase, daip, cn_port, mode))
if info ~= "" then
luci.http.status(500, "Switch Faild")
end
@ -1111,7 +888,7 @@ function action_log_level()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
if info then
level = info["log-level"]
else
@ -1126,27 +903,6 @@ function action_log_level()
})
end
function action_switch_log()
local level, info
if is_running() then
local daip = daip()
local dase = dase() or ""
local cn_port = cn_port()
level = luci.http.formvalue("log_level")
if not daip or not cn_port or not level then luci.http.status(500, "Switch Faild") return end
info = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"log-level\": \"%s\"}\'', dase, daip, cn_port, level))
if info ~= "" then
luci.http.status(500, "Switch Faild")
end
else
luci.http.status(500, "Switch Faild")
end
luci.http.prepare_content("application/json")
luci.http.write_json({
info = info;
})
end
local function s(e)
local t=0
local a={' B/S',' KB/S',' MB/S',' GB/S',' TB/S',' PB/S'}
@ -1208,8 +964,8 @@ function action_toolbar_show()
local cn_port = cn_port()
if not daip or not cn_port then return end
traffic = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/traffic', dase, daip, cn_port)))
connections = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', dase, daip, cn_port)))
traffic = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/traffic', dase, daip, cn_port)))
connections = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', dase, daip, cn_port)))
if traffic and connections and connections.connections then
connection = #(connections.connections)
@ -1283,41 +1039,6 @@ function action_save_corever_branch()
})
end
function action_dler_login_info_save()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_login_info_save = dler_login_info_save();
})
end
function action_dler_info()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_info = dler_info();
})
end
function action_dler_checkin()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_checkin = dler_checkin();
})
end
function action_dler_logout()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_logout = dler_logout();
})
end
function action_dler_login()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_login = dler_login();
})
end
function action_one_key_update_check()
luci.http.prepare_content("application/json")
luci.http.write_json({
@ -1366,7 +1087,7 @@ function action_switch_dashboard()
local switch_name = luci.http.formvalue("name")
local switch_type = luci.http.formvalue("type")
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_dashboard.sh "%s" "%s" >/dev/null 2>&1', switch_name, switch_type))
if switch_name == "Dashboard" and tonumber(state) == 1 then
if switch_name == "Dashboard" and tonumber(state) == 0 then
if switch_type == "Official" then
uci:set("openclash", "config", "dashboard_type", "Official")
uci:commit("openclash")
@ -1374,7 +1095,7 @@ function action_switch_dashboard()
uci:set("openclash", "config", "dashboard_type", "Meta")
uci:commit("openclash")
end
elseif switch_name == "Yacd" and tonumber(state) == 1 then
elseif switch_name == "Yacd" and tonumber(state) == 0 then
if switch_type == "Official" then
uci:set("openclash", "config", "yacd_type", "Official")
uci:commit("openclash")
@ -1492,10 +1213,14 @@ end
function action_get_last_version()
if not process_status("/usr/share/openclash/clash_version.sh") then
luci.sys.call("bash /usr/share/openclash/clash_version.sh &")
if tonumber(os.time() - (fs.mtime("/tmp/clash_last_version") or 0)) > 1800 then
luci.sys.call("bash /usr/share/openclash/clash_version.sh &")
end
end
if not process_status("/usr/share/openclash/openclash_version.sh") then
luci.sys.call("bash /usr/share/openclash/openclash_version.sh &")
if tonumber(os.time() - (fs.mtime("/tmp/openclash_last_version") or 0)) > 1800 then
luci.sys.call("bash /usr/share/openclash/openclash_version.sh &")
end
end
end
@ -1570,6 +1295,7 @@ function action_refresh_log()
luci.http.prepare_content("application/json")
local logfile = "/tmp/openclash.log"
local log_len = tonumber(luci.http.formvalue("log_len")) or 0
local core_refresh = luci.http.formvalue("core_refresh") == "true"
if not fs.access(logfile) then
luci.http.write_json({
@ -1594,54 +1320,54 @@ function action_refresh_log()
end
local exclude_pattern = "UDP%-Receive%-Buffer%-Size|^Sec%-Fetch%-Mode|^User%-Agent|^Access%-Control|^Accept|^Origin|^Referer|^Connection|^Pragma|^Cache%-"
local core_pattern = " DBG | INF |level=| WRN | ERR | FTL "
local core_pattern = "level=|^time="
local limit = 1000
local start_line = (log_len > 0 and total_lines > log_len) and (log_len + 1) or 1
local core_cmd, oc_cmd, core_raw, oc_raw
local core_logs = {}
local oc_logs = {}
local core_cmd = string.format(
core_cmd = string.format(
"tail -n +%d '%s' | grep -v -E '%s' | grep -E '%s' | tail -n %d",
start_line, logfile, exclude_pattern, core_pattern, limit
)
local core_raw = luci.sys.exec(core_cmd)
local oc_cmd = string.format(
oc_cmd = string.format(
"tail -n +%d '%s' | grep -v -E '%s' | grep -v -E '%s' | tail -n %d",
start_line, logfile, exclude_pattern, core_pattern, limit
)
local oc_raw = luci.sys.exec(oc_cmd)
local core_log = ""
if core_refresh then
core_raw = luci.sys.exec(core_cmd)
end
oc_raw = luci.sys.exec(oc_cmd)
if core_raw and core_raw ~= "" then
local core_logs = {}
for line in core_raw:gmatch("[^\n]+") do
local line_trans = line
if string.match(string.sub(line, 0, 8), "%d%d:%d%d:%d%d") then
line_trans = '"'..os.date("%Y-%m-%d", os.time()).. " "..os.date("%H:%M:%S", tonumber(string.sub(line, 0, 8)))..'"'..string.sub(line, 9, -1)
end
table.insert(core_logs, line_trans)
end
if #core_logs > 0 then
core_log = table.concat(core_logs, "\n")
table.insert(core_logs, line)
end
end
local oc_log = ""
if oc_raw and oc_raw ~= "" then
local oc_logs = {}
for line in oc_raw:gmatch("[^\n]+") do
local line_trans
if not string.find(line, "") or not string.find(line, "") then
line_trans = trans_line_nolabel(line)
else
line_trans = trans_line(line)
if not string.match(string.sub(line, 1, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line = os.date("%Y-%m-%d %H:%M:%S") .. ' [Fatal] ' .. line
end
table.insert(oc_logs, line_trans)
end
if #oc_logs > 0 then
oc_log = table.concat(oc_logs, "\n")
table.insert(oc_logs, trans_line(line))
end
end
if #core_logs > limit then
core_logs = {table.unpack(core_logs, #core_logs - limit + 1)}
end
if #oc_logs > limit then
oc_logs = {table.unpack(oc_logs, #oc_logs - limit + 1)}
end
local core_log = #core_logs > 0 and table.concat(core_logs, "\n") or ""
local oc_log = #oc_logs > 0 and table.concat(oc_logs, "\n") or ""
luci.http.write_json({
len = total_lines,
update = true,
@ -1872,8 +1598,6 @@ function rename_file()
local new_file_path = file_path .. new_file_name
local old_run_file_path = "/etc/openclash/" .. old_file_name
local new_run_file_path = "/etc/openclash/" .. new_file_name
local old_backup_file_path = "/etc/openclash/backup/" .. old_file_name
local new_backup_file_path = "/etc/openclash/backup/" .. new_file_name
if fs.rename(old_file_path, new_file_path) then
if file_path == "/etc/openclash/config/" then
if fs.uci_get_config("config", "config_path") == old_file_path then
@ -1884,10 +1608,6 @@ function rename_file()
fs.rename(old_run_file_path, new_run_file_path)
end
if fs.isfile(old_backup_file_path) then
fs.rename(old_backup_file_path, new_backup_file_path)
end
uci:foreach("openclash", "config_subscribe",
function(s)
if s.name == fs.filename(old_file_name) and fs.filename(new_file_name) ~= new_file_name then
@ -1895,13 +1615,6 @@ function rename_file()
end
end)
uci:foreach("openclash", "other_rules",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:foreach("openclash", "groups",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
@ -1916,13 +1629,6 @@ function rename_file()
end
end)
uci:foreach("openclash", "rule_provider_config",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:foreach("openclash", "servers",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
@ -1930,20 +1636,6 @@ function rename_file()
end
end)
uci:foreach("openclash", "game_config",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:foreach("openclash", "rule_providers",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:commit("openclash")
end
luci.http.status(200, "Rename File Successful")
@ -1956,19 +1648,13 @@ end
function manual_stream_unlock_test()
local type = luci.http.formvalue("type")
local cmd = string.format('/usr/share/openclash/openclash_streaming_unlock.lua "%s"', type)
local line_trans
luci.http.prepare_content("text/plain; charset=utf-8")
local util = io.popen(cmd)
if util and util ~= "" then
while true do
local ln = util:read("*l")
if ln then
if not string.find (ln, "") or not string.find (ln, "") then
line_trans = trans_line_nolabel(ln)
else
line_trans = trans_line(ln)
end
luci.http.write(line_trans)
luci.http.write(trans_line(ln))
luci.http.write("\n")
end
if not process_status("openclash_streaming_unlock.lua "..type) or not process_status("openclash_streaming_unlock.lua ") then
@ -1984,19 +1670,13 @@ end
function all_proxies_stream_test()
local type = luci.http.formvalue("type")
local cmd = string.format('/usr/share/openclash/openclash_streaming_unlock.lua "%s" "%s"', type, "all")
local line_trans
luci.http.prepare_content("text/plain; charset=utf-8")
local util = io.popen(cmd)
if util and util ~= "" then
while true do
local ln = util:read("*l")
if ln then
if not string.find (ln, "") or not string.find (ln, "") then
line_trans = trans_line_nolabel(ln)
else
line_trans = trans_line(ln)
end
luci.http.write(line_trans)
luci.http.write(trans_line(ln))
luci.http.write("\n")
end
if not process_status("openclash_streaming_unlock.lua "..type) or not process_status("openclash_streaming_unlock.lua ") then
@ -2009,95 +1689,70 @@ function all_proxies_stream_test()
luci.http.status(500, "Something Wrong While Testing...")
end
function trans_line_nolabel(data)
if data == nil or data == "" then
return ""
end
local line_trans = ""
if string.len(data) >= 19 and string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20)..luci.i18n.translate(string.sub(data, 21, -1))
else
line_trans = luci.i18n.translate(data)
end
return line_trans
end
function trans_line(data)
if data == nil or data == "" then
return ""
end
local no_trans = {}
local line_trans = ""
local a = string.find(data, "")
if not a then
if string.len(data) >= 19 and string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
return string.sub(data, 0, 20) .. luci.i18n.translate(string.sub(data, 21, -1))
else
return luci.i18n.translate(data)
local has_timestamp = string.len(data) >= 19 and string.match(string.sub(data, 1, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d")
local time_part = ""
local level_part = ""
local content_start = has_timestamp and 21 or 1
if has_timestamp then
time_part = string.sub(data, 1, 20)
local level_start, level_end, level_content = string.find(data, "%[([^%]]+)%]", 21)
if level_start and level_end and level_start == 21 then
level_part = "[" .. luci.i18n.translate(level_content) .. "] "
content_start = level_end + 2
end
end
local b_pos = string.find(data, "")
if not b_pos then
return luci.i18n.translate(data)
end
local segments = {}
local last_pos = content_start
local pos = string.find(data, "", content_start)
local b = b_pos + 2
local c = 21
local d = 0
local v
local x
while pos do
if pos > last_pos then
table.insert(segments, {
type = "trans",
text = string.sub(data, last_pos, pos - 1)
})
end
while true do
table.insert(no_trans, a)
table.insert(no_trans, b)
local next_a = string.find(data, "", b+1)
local next_b = string.find(data, "", b+1)
if next_a and next_b then
a = next_a
b = next_b + 2
else
local close_pos = string.find(data, "", pos + 1)
if not close_pos then
table.insert(segments, {
type = "trans",
text = string.sub(data, pos, -1)
})
break
end
table.insert(segments, {
type = "no_trans",
text = string.sub(data, pos, close_pos + 2)
})
last_pos = close_pos + 3
pos = string.find(data, "", last_pos)
end
if #no_trans % 2 ~= 0 then
table.remove(no_trans)
if last_pos <= string.len(data) then
table.insert(segments, {
type = "trans",
text = string.sub(data, last_pos, -1)
})
end
for k = 1, #no_trans, 2 do
x = no_trans[k]
v = no_trans[k+1]
if x and v then
if x <= 21 or not string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = line_trans .. luci.i18n.translate(string.sub(data, d, x - 1)) .. string.sub(data, x, v)
d = v + 1
elseif v <= string.len(data) then
line_trans = line_trans .. luci.i18n.translate(string.sub(data, c, x - 1)) .. string.sub(data, x, v)
end
c = v + 1
end
end
if c > string.len(data) then
if d == 0 then
if string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20) .. line_trans
end
end
else
if d == 0 then
if string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20) .. line_trans .. luci.i18n.translate(string.sub(data, c, -1))
end
line_trans = time_part .. level_part
for _, seg in ipairs(segments) do
if seg.type == "trans" then
line_trans = line_trans .. luci.i18n.translate(seg.text)
else
line_trans = line_trans .. luci.i18n.translate(string.sub(data, c, -1))
line_trans = line_trans .. seg.text
end
end
@ -2364,7 +2019,7 @@ function action_myip_check()
if result.ipify and result.ipify.ip then
local geo_cmd = string.format(
'curl -sL -m 5 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "https://api-ipv4.ip.sb/geoip/%s" 2>/dev/null',
'curl -sL -m 5 --retry 2 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "https://api-ipv4.ip.sb/geoip/%s" 2>/dev/null',
result.ipify.ip
)
local geo_data = luci.sys.exec(geo_cmd)
@ -2417,7 +2072,7 @@ function action_website_check()
end
local cmd = string.format(
'curl -sL -m 5 --connect-timeout 3 -w "%%{http_code},%%{time_total},%%{time_connect},%%{time_appconnect}" "%s" -o /dev/null 2>/dev/null',
'curl -sL -m 5 --connect-timeout 3 --retry 2 -w "%%{http_code},%%{time_total},%%{time_connect},%%{time_appconnect}" "%s" -o /dev/null 2>/dev/null',
test_url
)
@ -2606,7 +2261,7 @@ function action_switch_oc_setting()
return false
end
local reload_result = luci.sys.exec(string.format('curl -sL -m 5 --connect-timeout 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPUT http://"%s":"%s"/configs?force=true -d \'{"path":"%s"}\' 2>&1', dase, daip, cn_port, runtime_config_path))
local reload_result = luci.sys.exec(string.format('curl -sL -m 5 --connect-timeout 2 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPUT http://"%s":"%s"/configs?force=true -d \'{"path":"%s"}\' 2>&1', dase, daip, cn_port, runtime_config_path))
if reload_result ~= "" then
luci.http.status(500, "Switch Failed")
@ -2839,7 +2494,7 @@ function action_generate_pac()
local mixed_port = fs.uci_get_config("config", "mixed_port") or "7893"
if not proxy_ip then
result.error = "Unable to get proxy IP"
result.error = luci.i18n.translate("Unable to get proxy IP")
luci.http.prepare_content("application/json")
luci.http.write_json(result)
return
@ -2959,7 +2614,7 @@ function action_generate_pac()
luci.sys.call("chmod 644 " .. pac_file_path)
else
result.error = "Failed to write PAC file"
result.error = luci.i18n.translate("Failed to write PAC file")
luci.http.prepare_content("application/json")
luci.http.write_json(result)
return
@ -2972,7 +2627,7 @@ function action_generate_pac()
result.pac_url = pac_url
if not auth_exists then
result.error = "warning: No authentication configured, please be aware of the risk of information leakage!"
result.error = luci.i18n.translate("No authentication configured, please be aware of the risk of information leakage!")
end
luci.http.prepare_content("application/json")
@ -3640,7 +3295,7 @@ function action_add_subscription()
local address = luci.http.formvalue("address")
local sub_ua = luci.http.formvalue("sub_ua") or "clash.meta"
local sub_convert = luci.http.formvalue("sub_convert") or "0"
local convert_address = luci.http.formvalue("convert_address") or "https://api.dler.io/sub"
local convert_address = luci.http.formvalue("convert_address") or ""
local template = luci.http.formvalue("template") or ""
local emoji = luci.http.formvalue("emoji") or "false"
local udp = luci.http.formvalue("udp") or "false"
@ -4129,7 +3784,7 @@ function action_overwrite_subscribe_info()
local overwrite_dir = "/etc/openclash/overwrite/"
local file_path = overwrite_dir .. section_name
if url and url ~= "" then
local cmd = string.format('curl -sL --connect-timeout 5 -m 15 "%s" -o "%s"', url, file_path)
local cmd = string.format('curl -sL --connect-timeout 5 -m 15 --retry 2 "%s" -o "%s"', url, file_path)
local ret = luci.sys.call(cmd)
if not fs.access(file_path) then
fs.writefile(file_path, "")
@ -4259,14 +3914,6 @@ function action_get_subscribe_info_data()
luci.http.status(400, "Bad Request")
return
end
local data = {}
uci:foreach("openclash", "subscribe_info", function(s)
if s.name == filename then
data = s
end
end)
luci.http.prepare_content("application/json")
luci.http.write_json(data)
luci.http.write_json(get_sub_url(filename))
end

View File

@ -8,14 +8,11 @@ local fs = require "luci.openclash"
local uci = require("luci.model.uci").cursor()
m = SimpleForm("openclash",translate("OpenClash"))
m.description = translate("A Clash Client For OpenWrt")
m.description = translate("A Mihomo(Clash) Client For OpenWrt")
m.reset = false
m.submit = false
m:section(SimpleSection).template = "openclash/status"
if fs.uci_get_config("config", "dler_token") then
m:append(Template("openclash/dlercloud"))
end
m:append(Template("openclash/myip"))
m:append(Template("openclash/developer"))

View File

@ -56,7 +56,6 @@ s:tab("dns", "DNS "..translate("Settings"))
s:tab("meta", translate("Meta Settings"))
s:tab("smart", translate("Smart Settings"))
s:tab("rules", translate("Rules Setting"))
s:tab("developer", translate("Developer Settings"))
----- General Settings
o = s:taboption("settings", ListValue, "interface_name", translate("Bind Network Interface"))
@ -444,10 +443,6 @@ o = s:taboption("smart", DummyValue, "flush_smart_cache", translate("Flush Smart
o.template = "openclash/flush_smart_cache"
---- Rules Settings
o = s:taboption("rules", Flag, "rule_source", translate("Enable Other Rules"))
o.description = translate("Use Other Rules")
o.default = 0
o = s:taboption("rules", Flag, "enable_rule_proxy", translate("Rule Match Proxy Mode"))
o.description = translate("Append Some Rules to Config, Allow Only Traffic Proxies that Match the Rule, Prevent BT/P2P Passing")
o.default = 0
@ -496,36 +491,20 @@ function custom_rules_2.write(self, section, value)
end
end
---- developer
o = s:taboption("developer", Value, "ymchange_custom")
o.template = "cbi/tvalue"
o.description = translate("Custom Config Overwrite Scripts Which Will Run After Plugin Own Completely, Please Be Careful, The Wrong Changes May Lead to Exceptions")
o.rows = 30
o.wrap = "off"
function o.cfgvalue(self, section)
return NXFS.readfile("/etc/openclash/custom/openclash_custom_overwrite.sh") or ""
end
function o.write(self, section, value)
if value then
value = value:gsub("\r\n?", "\n")
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_overwrite.sh")
if value ~= old_value then
NXFS.writefile("/etc/openclash/custom/openclash_custom_overwrite.sh", value)
end
end
end
-- [[ Edit Custom DNS ]] --
ds = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)"))
ds.anonymous = true
ds.addremove = true
ds.sortable = true
ds.template = "openclash/tblsection_dns"
ds.template = "openclash/tblsection"
ds.extedit = luci.dispatcher.build_url("admin/services/openclash/custom-dns-edit/%s")
function ds.create(...)
local sid = TypedSection.create(...)
function ds.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "group", name)
end
luci.http.redirect(ds.extedit % sid)
return
end
@ -541,9 +520,9 @@ end
---- group
o = ds:option(ListValue, "group", translate("DNS Server Group"))
o:value("nameserver", translate("NameServer "))
o:value("fallback", translate("FallBack "))
o:value("default", translate("Default-NameServer"))
o:value("nameserver", translate("nameserver "))
o:value("fallback", translate("fallback "))
o:value("default", translate("default-nameserver"))
o.default = "nameserver"
o.rempty = false
@ -573,53 +552,6 @@ o = ds:option(Flag, "disable_ipv6", translate("Disable-IPv6"))
o.rmempty = false
o.default = o.disbled
-- [[ Other Rules Manage ]]--
ss = m:section(TypedSection, "other_rules", translate("Other Rules Edit")..translate("(Take Effect After Choose Above)"))
ss.anonymous = true
ss.addremove = true
ss.sortable = true
ss.template = "cbi/tblsection"
ss.extedit = luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s")
function ss.create(...)
local sid = TypedSection.create(...)
if sid then
luci.http.redirect(ss.extedit % sid)
return
end
end
ss.render = function(self, ...)
Map.render(self, ...)
if type(optimize_cbi_ui) == "function" then
optimize_cbi_ui()
end
end
o = ss:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = ss:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = ss:option(DummyValue, "rule_name", translate("Other Rules Name"))
function o.cfgvalue(...)
if Value.cfgvalue(...) == "lhie1" then
return translate("lhie1 Rules")
else
return translate("None")
end
end
o = ss:option(DummyValue, "Note", translate("Note"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
-- [[ Edit Authentication ]] --
s = m:section(TypedSection, "authentication", translate("Set Authentication of SOCKS5/HTTP(S)"))
s.anonymous = true

View File

@ -17,8 +17,6 @@ m = Map(openclash, translate("Config Subscribe Edit"))
m.pageaction = false
m.description=translate("Convert Subscribe function of Online is Supported By subconverter Written By tindy X") ..
"<br/>"..
"<br/>"..translate("API By tindy X & lhie1")..
"<br/>"..
"<br/>"..translate("Subconverter external configuration (subscription conversion template) Description: https://github.com/tindy2013/subconverter#external-configuration-file")..
"<br/>"..
"<br/>"..translate("If you need to customize the external configuration file (subscription conversion template), please write it according to the instructions, upload it to the accessible location of the external network, and fill in the address correctly when using it")..
@ -57,32 +55,6 @@ function o.validate(self, value)
return value
end
local sub_path = "/tmp/dler_sub"
local info, token, get_sub, sub_info
local token = fs.uci_get_config("config", "dler_token")
if token then
get_sub = string.format("curl -sL -H 'Content-Type: application/json' --connect-timeout 2 -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/managed/clash -o %s", token, sub_path)
if not nixio.fs.access(sub_path) then
luci.sys.exec(get_sub)
else
if fs.readfile(sub_path) == "" or not fs.readfile(sub_path) then
luci.sys.exec(get_sub)
end
end
sub_info = fs.readfile(sub_path)
if sub_info then
sub_info = json.parse(sub_info)
end
if sub_info and sub_info.ret == 200 then
o:value(sub_info.smart)
o:value(sub_info.ss)
o:value(sub_info.vmess)
o:value(sub_info.trojan)
else
fs.unlink(sub_path)
end
end
---- UA
o = s:option(Value, "sub_ua", "User-Agent")
o.description = font_red..bold_on..translate("Used for Downloading Subscriptions, Defaults to Clash")..bold_off..font_off
@ -102,11 +74,10 @@ o = s:option(Value, "convert_address", translate("Convert Address"))
o.rmempty = true
o.description = font_red..bold_on..translate("Note: There is A Risk of Privacy Leakage in Online Convert")..bold_off..font_off
o:depends("sub_convert", "1")
o:value("https://api.dler.io/sub", translate("api.dler.io")..translate("(Default)"))
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
o:value("https://api.asailor.org/sub", translate("api.asailor.org"))
o.default = "https://api.dler.io/sub"
o.placeholder = "https://api.dler.io/sub"
o.default = "https://api.wcc.best/sub"
o.placeholder = "https://api.wcc.best/sub"
---- Template
o = s:option(ListValue, "template", translate("Template Name"))
@ -196,10 +167,10 @@ o.rmempty = true
---- de_exkey
o = s:option(MultiValue, "de_ex_keyword", font_red..bold_on..translate("Exclude Keyword Match Default")..bold_off..font_off)
o.rmempty = true
o:value("过期时间")
o:value("剩余流量")
o:value("TG群")
o:value("官网")
o:value(translate("Expire"))
o:value(translate("Traffic"))
o:value(translate("Plan"))
o:value(translate("Official"))
local t = {
{Commit, Back}

View File

@ -149,7 +149,6 @@ o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:commit("openclash")
end
@ -157,18 +156,8 @@ o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Update Config")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash")
uci:foreach("openclash", "config_subscribe",
function(s)
if s.name ~= "" and s.name ~= nil and s.enabled == "1" then
local back_cfg_path_yaml="/etc/openclash/backup/" .. s.name .. ".yaml"
local back_cfg_path_yml="/etc/openclash/backup/" .. s.name .. ".yml"
fs.unlink(back_cfg_path_yaml)
fs.unlink(back_cfg_path_yml)
end
end)
SYS.call("/usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end

View File

@ -57,16 +57,11 @@ um = sul:option(DummyValue, "", nil)
um.template = "openclash/dvalue"
local dir, fd, clash
clash = "/etc/openclash/clash"
dir = "/etc/openclash/config/"
bakck_dir="/etc/openclash/backup"
proxy_pro_dir="/etc/openclash/proxy_provider/"
rule_pro_dir="/etc/openclash/rule_provider/"
core_dir="/etc/openclash/core/core/"
backup_dir="/tmp/"
create_bakck_dir=fs.mkdir(bakck_dir)
create_proxy_pro_dir=fs.mkdir(proxy_pro_dir)
create_rule_pro_dir=fs.mkdir(rule_pro_dir)
HTTP.setfilehandler(
function(meta, chunk, eof)
@ -101,15 +96,11 @@ HTTP.setfilehandler(
if fp == "config" then
CHIF = "1"
if IsYamlFile(meta.file) then
local yamlbackup="/etc/openclash/backup/" .. meta.file
local c=fs.copy(dir .. meta.file,yamlbackup)
default_config_set(meta.file)
end
if IsYmlFile(meta.file) then
local ymlname=string.lower(string.sub(meta.file,0,-5))
local ymlbackup="/etc/openclash/backup/".. ymlname .. ".yaml"
local c=fs.rename(dir .. meta.file,"/etc/openclash/config/".. ymlname .. ".yaml")
local c=fs.copy("/etc/openclash/config/".. ymlname .. ".yaml",ymlbackup)
local yamlname=ymlname .. ".yaml"
default_config_set(yamlname)
end
@ -160,7 +151,6 @@ HTTP.setfilehandler(
fs.unlink(backup_dir .. meta.file)
um.value = translate("Backup File Restore Successful!")
end
fs.unlink("/tmp/Proxy_Group")
end
end
)
@ -177,12 +167,7 @@ a=fs.stat(o)
if a then
e[t]={}
e[t].name=fs.basename(o)
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
if fs.mtime(BACKUP_FILE) then
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
else
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
end
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
if fs.uci_get_config("config", "config_path") and string.sub(fs.uci_get_config("config", "config_path"), 23, -1) == e[t].name then
e[t].state=translate("Enabled")
else
@ -206,22 +191,27 @@ st.template="openclash/cfg_check"
sb.template="openclash/sub_info_show"
btnis=tb:option(Button,"switch",translate("SwiTch"))
btnis.template="openclash/other_button"
btnis.render=function(o,t,a)
if not e[t] then return false end
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
a.display=""
else
a.display="none"
end
o.inputstyle="apply"
Button.render(o,t,a)
if not e[t] then return false end
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
a.display=""
else
a.display="none"
end
o.inputstyle="apply"
Button.render(o,t,a)
end
btnis.write=function(a,t)
fs.unlink("/tmp/Proxy_Group")
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
uci:commit("openclash")
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
uci:commit("openclash")
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
end
btned=tb:option(Button,"edit",translate("Edit"))
btned.inputstyle="apply"
btned.write=function(a,t)
local file_path = "etc/openclash/config/" .. fs.basename(e[t].name)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "config", "%s") % file_path)
end
btnrn=tb:option(DummyValue,"/etc/openclash/config/",translate("Rename"))
@ -238,9 +228,9 @@ actions.render = function(self, t, a)
if not e[t] then return end
self.keylist = {}
self.vallist = {}
-- Edit
table.insert(self.keylist, "edit")
table.insert(self.vallist, translate("Edit"))
-- Servers manage
table.insert(self.keylist, "servers_manage")
table.insert(self.vallist, translate("Servers Manage"))
-- Copy
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
@ -271,9 +261,9 @@ btnapply.write = function(self, t)
if not e[t] then return end
local action = self.map:formvalue("cbid." .. self.map.config .. "." .. t .. ".actions")
if action == "edit" then
if action == "servers_manage" then
local file_path = "etc/openclash/config/" .. fs.basename(e[t].name)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "config", "%s") % file_path)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "servers", "%s") % file_path)
elseif action == "copy" then
local num = 1
while true do
@ -325,8 +315,6 @@ btnapply.write = function(self, t)
fd:close()
HTTP.close()
elseif action == "remove" then
fs.unlink("/tmp/Proxy_Group")
fs.unlink("/etc/openclash/backup/"..fs.basename(e[t].name))
fs.unlink("/etc/openclash/history/"..fs.filename(e[t].name)..".db")
fs.unlink("/etc/openclash/"..fs.basename(e[t].name))
local a=fs.unlink("/etc/openclash/config/"..fs.basename(e[t].name))
@ -341,7 +329,7 @@ p.reset = false
p.submit = false
local provider_manage = {
{proxy_mg, rule_mg, game_mg}
{proxy_mg, rule_mg}
}
promg = p:section(Table, provider_manage)
@ -360,13 +348,6 @@ o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
end
o = promg:option(Button, "game_mg", " ")
o.inputtitle = translate("Game Rules File List")
o.inputstyle = "reload"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
end
m = SimpleForm("openclash",translate("Config File Edit"))
m.reset = false
m.submit = false
@ -429,7 +410,6 @@ o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
uci:commit("openclash")
end
@ -442,7 +422,6 @@ o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
uci:set("openclash", "config", "enable", 1)
uci:commit("openclash")
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")

View File

@ -78,6 +78,12 @@ o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("
o.rmempty = false
o.default = o.disbled
---- disable-reuse
o = s:option(Flag, "disable_reuse", translate("Disable Reuse"), translate("Disable Reuse The Connection"))
o:depends("type", "tls")
o.rmempty = false
o.default = o.disbled
---- Force HTTP/3
o = s:option(Flag, "http3", translate("Force HTTP/3"), translate("Force HTTP/3 to connect"))
o:depends("type", "https")

View File

@ -1,123 +0,0 @@
local rule_form
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
local g,h={}
for n,m in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
h=fs.stat(m)
if h then
g[n]={}
g[n].num=string.format(n)
g[n].name=fs.basename(m)
g[n].mtime=os.date("%Y-%m-%d %H:%M:%S",h.mtime)
g[n].size=fs.filesize(h.size)
g[n].remove=0
g[n].enable=false
end
end
rule_form=SimpleForm("game_rules_file_list",translate("Game Rules File List"))
rule_form.reset=false
rule_form.submit=false
tb2=rule_form:section(Table,g)
nu2=tb2:option(DummyValue,"num",translate("Serial Number"))
nm2=tb2:option(DummyValue,"name",translate("File Name"))
mt2=tb2:option(DummyValue,"mtime",translate("Update Time"))
sz2=tb2:option(DummyValue,"size",translate("Size"))
btned1=tb2:option(Button,"edit",translate("Edit"))
btned1.render=function(g,n,h)
g.inputstyle="apply"
Button.render(g,n,h)
end
btned1.write=function(h,n)
local file_path = "etc/openclash/game_rules/" .. fs.basename(g[n].name)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "game-rules-file-manage", "%s") %file_path)
end
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
btndl2.template="openclash/other_button"
btndl2.render=function(m,n,h)
m.inputstyle="remove"
Button.render(m,n,h)
end
btndl2.write = function (h,n)
local sPath, sFile, fd, block
sPath = "/etc/openclash/game_rules/"..g[n].name
sFile = NXFS.basename(sPath)
if fs.isdirectory(sPath) then
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
sFile = sFile .. ".tar.gz"
else
fd = nixio.open(sPath, "r")
end
if not fd then
return
end
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
HTTP.prepare_content("application/octet-stream")
while true do
block = fd:read(nixio.const.buffersize)
if (not block) or (#block ==0) then
break
else
HTTP.write(block)
end
end
fd:close()
HTTP.close()
end
btnrm2=tb2:option(Button,"remove2",translate("Remove"))
btnrm2.render=function(g,n,h)
g.inputstyle="reset"
Button.render(g,n,h)
end
btnrm2.write=function(h,n)
local h=fs.unlink("/etc/openclash/game_rules/"..luci.openclash.basename(g[n].name))
if h then table.remove(g,n)end
return h
end
local t = {
{Refresh, Create, Delete_all, Apply}
}
a = rule_form:section(Table, t)
o = a:option(Button, "Refresh", " ")
o.inputtitle = translate("Refresh Page")
o.inputstyle = "apply"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
end
o = a:option(DummyValue, "Create", " ")
o.rawhtml = true
o.template = "openclash/input_file_name"
o.value = "/etc/openclash/game_rules/"
o = a:option(Button, "Delete_all", " ")
o.inputtitle = translate("Delete All File")
o.inputstyle = "remove"
o.write = function()
luci.sys.call("rm -rf /etc/openclash/game_rules/* >/dev/null 2>&1")
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
end
o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
end
rule_form:append(Template("openclash/toolbar_show"))
return rule_form

View File

@ -1,100 +0,0 @@
local form, m
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
m = SimpleForm("openclash", translate("Game Rules List"))
m.description=translate("Rule Project:").." SSTap-Rule ( https://github.com/FQrabbit/SSTap-Rule )"
m.reset = false
m.submit = false
local t = {
{Refresh, Apply}
}
a = m:section(Table, t)
o = a:option(Button, "Refresh", " ")
o.inputtitle = translate("Refresh Page")
o.inputstyle = "apply"
o.write = function()
SYS.call("rm -rf /tmp/rules_name 2>/dev/null")
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
end
o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
end
if not NXFS.access("/tmp/rules_name") then
SYS.call("awk -F ',' '{print $1}' /usr/share/openclash/res/game_rules.list > /tmp/rules_name 2>/dev/null")
end
file = io.open("/tmp/rules_name", "r");
---- Rules List
local e={},o,t
if NXFS.access("/tmp/rules_name") then
for o in file:lines() do
table.insert(e,o)
end
for t,o in ipairs(e) do
e[t]={}
e[t].num=string.format(t)
e[t].name=o
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $3}' 2>/dev/null",e[t].name)),1,-2)
if e[t].filename == "" then
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null",e[t].name)),1,-2)
end
RULE_FILE="/etc/openclash/game_rules/".. e[t].filename
if fs.mtime(RULE_FILE) then
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
else
e[t].size="/"
e[t].mtime="/"
end
if fs.isfile(RULE_FILE) then
e[t].exist=translate("Exist")
else
e[t].exist=translate("Not Exist")
end
e[t].remove=0
end
end
file:close()
form=SimpleForm("filelist")
form.reset=false
form.submit=false
tb=form:section(Table,e)
nu=tb:option(DummyValue,"num",translate("Serial Number"))
st=tb:option(DummyValue,"exist",translate("State"))
st.template="openclash/cfg_check"
nm=tb:option(DummyValue,"name",translate("Rule Name"))
fm=tb:option(DummyValue,"filename",translate("File Name"))
sz=tb:option(DummyValue,"size",translate("Size"))
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
btnis.template="openclash/download_rule"
btnrm=tb:option(Button,"remove",translate("Remove"))
btnrm.render=function(e,t,a)
e.inputstyle="reset"
Button.render(e,t,a)
end
btnrm.write=function(a,t)
fs.unlink("/etc/openclash/game_rules/"..e[t].filename)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
end
return m, form

View File

@ -5,6 +5,15 @@ local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
local file_path = ""
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
@ -24,7 +33,7 @@ end
m = Map(openclash, translate("Edit Group"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers%s" % file_path)
if m.uci:get(openclash, sid) ~= "groups" then
luci.http.redirect(m.redirect)
return
@ -182,11 +191,11 @@ o = s:option(DynamicList, "other_group", translate("Other Group (Support Regex)"
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'")..bold_off..font_off
o:value("all", translate("All Groups"))
uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") then
o:value(s.name)
end
end)
function(s)
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
@ -194,6 +203,107 @@ o:value("PASS")
o:value("GLOBAL")
o.rmempty = true
local function sync_group_name(section, old_name, new_name)
if old_name == "" or old_name == nil or old_name == new_name then
return
end
local function matches(value, pattern)
if not value or not pattern then
return false
end
local ok, result = pcall(function() return string.match(value, pattern) end)
if ok and result then
return true
end
return value == pattern
end
-- servers 的 groups 列表
uci:foreach(openclash, "servers", function(s)
local groups = uci:get(openclash, s[".name"], "groups")
if groups then
local new_groups = {}
local changed = false
for _, item in ipairs(groups) do
if matches(old_name, item) then
table.insert(new_groups, new_name)
changed = true
else
table.insert(new_groups, item)
end
end
if changed then
uci:delete(openclash, s[".name"], "groups")
uci:set_list(openclash, s[".name"], "groups", new_groups)
end
end
end)
-- proxy-provider 的 groups 列表
uci:foreach(openclash, "proxy-provider", function(s)
local groups = uci:get(openclash, s[".name"], "groups")
if groups then
local new_groups = {}
local changed = false
for _, item in ipairs(groups) do
if matches(old_name, item) then
table.insert(new_groups, new_name)
changed = true
else
table.insert(new_groups, item)
end
end
if changed then
uci:delete(openclash, s[".name"], "groups")
uci:set_list(openclash, s[".name"], "groups", new_groups)
end
end
end)
-- groups 的 other_group 列表
uci:foreach(openclash, "groups", function(s)
if s[".name"] ~= section then
local other_group = uci:get(openclash, s[".name"], "other_group")
if other_group then
local new_other = {}
local changed = false
for _, item in ipairs(other_group) do
if matches(old_name, item) then
table.insert(new_other, new_name)
changed = true
else
table.insert(new_other, item)
end
end
if changed then
uci:delete(openclash, s[".name"], "other_group")
uci:set_list(openclash, s[".name"], "other_group", new_other)
end
end
end
end)
-- dns_servers 的 specific_group 选项
uci:foreach(openclash, "dns_servers", function(s)
local specific_group = uci:get(openclash, s[".name"], "specific_group")
if matches(old_name, specific_group) then
uci:set(openclash, s[".name"], "specific_group", new_name)
end
end)
-- servers 的 dialer_proxy 选项
uci:foreach(openclash, "servers", function(s)
local dialer_proxy = uci:get(openclash, s[".name"], "dialer_proxy")
if matches(old_name, dialer_proxy) then
uci:set(openclash, s[".name"], "dialer_proxy", new_name)
end
end)
uci:commit(openclash)
end
local t = {
{Commit, Back}
}
@ -203,8 +313,11 @@ o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
local old_name = m.uci:get(openclash, sid, "old_name") or ""
local new_name = luci.http.formvalue("cbid.openclash." .. sid .. ".name") or m.uci:get(openclash, sid, "name")
sync_group_name(sid, old_name, new_name)
m.uci:set(openclash, sid, "old_name", new_name)
m.uci:commit(openclash)
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
luci.http.redirect(m.redirect)
end

View File

@ -3,7 +3,6 @@ local SYS = require "luci.sys"
local HTTP = require "luci.http"
local fs = require "luci.openclash"
local file_path = ""
local edit_file_name = "/tmp/openclash_edit_file_name"
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
@ -13,16 +12,6 @@ if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
--re-get file path to save
if NXFS.readfile(edit_file_name) ~= file_path and fs.isfile(file_path) then
NXFS.writefile(edit_file_name, file_path)
else
if not fs.isfile(file_path) and fs.isfile(edit_file_name) then
file_path = NXFS.readfile(edit_file_name)
fs.unlink(edit_file_name)
end
end
m = Map("openclash", translate("File Edit"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/"..arg[1])

View File

@ -1,347 +0,0 @@
local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
font_red = [[<b style=color:red>]]
font_green = [[<b style=color:green>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
function IsYamlFile(e)
e=e or""
local e=string.lower(string.sub(e,-5,-1))
return e == ".yaml"
end
function IsYmlFile(e)
e=e or""
local e=string.lower(string.sub(e,-4,-1))
return e == ".yml"
end
m = Map(openclash, translate("Other Rules Edit"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/config-overwrite")
if m.uci:get(openclash, sid) ~= "other_rules" then
luci.http.redirect(m.redirect)
return
end
-- [[ Other Rules Setting ]]--
s = m:section(NamedSection, sid, "other_rules")
s.anonymous = true
s.addremove = false
o = s:option(Value, "Note", translate("Note"))
o.default = "default"
o.rmempty = false
o = s:option(ListValue, "config", translate("Config File"))
local e,a={}
local groupnames,filename
local group_list = {}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
if e[t].name == m.uci:get(openclash, sid, "config") then
filename = e[t].name
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',f))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
table.insert(group_list, groupname)
end
end
end
end
end
end
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
table.insert(group_list, s.name)
end
end)
table.sort(group_list)
table.insert(group_list, "DIRECT")
table.insert(group_list, "REJECT")
table.insert(group_list, "REJECT-DROP")
table.insert(group_list, "PASS")
table.insert(group_list, "GLOBAL")
o = s:option(Button, translate("Get Group Names"))
o.title = translate("Get Group Names")
o.inputtitle = translate("Get Group Names")
o.description = translate("Get Group Names After Select Config File")
o.inputstyle = "reload"
o.write = function()
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s") % sid)
end
if group_list ~= nil and filename ~= nil then
o = s:option(ListValue, "rule_name", translate("Other Rules Name"))
o.rmempty = true
o:value("lhie1", translate("lhie1 Rules"))
o = s:option(ListValue, "GlobalTV", translate("GlobalTV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AsianTV", translate("AsianTV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "MainlandTV", translate("CN Mainland TV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Proxy", translate("Proxy"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Youtube", translate("Youtube"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Bilibili", translate("Bilibili"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Bahamut", translate("Bahamut"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "HBOMax", translate("HBO Max"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Pornhub", translate("Pornhub"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Apple", translate("Apple"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AppleTV", translate("Apple TV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "GoogleFCM", translate("Google FCM"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Scholar", translate("Scholar"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Microsoft", translate("Microsoft"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AI_Suite", translate("AI Suite"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Netflix", translate("Netflix"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Disney", translate("Disney Plus"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Discovery", translate("Discovery Plus"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "DAZN", translate("DAZN"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Spotify", translate("Spotify"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Steam", translate("Steam"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "TikTok", translate("TikTok"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "miHoYo", translate("miHoYo"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Speedtest", translate("Speedtest"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Telegram", translate("Telegram"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Crypto", translate("Crypto"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Discord", translate("Discord"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "PayPal", translate("PayPal"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AdBlock", translate("AdBlock"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "HTTPDNS", translate("HTTPDNS"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Domestic", translate("Domestic"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Others", translate("Others"))
o:depends("rule_name", "lhie1")
o.rmempty = true
o.description = translate("Choose Proxy Groups, Base On Your Config File").." ( "..font_green..bold_on..filename..bold_off..font_off.." )"
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
end
local t = {
{Commit, Back}
}
a = m:section(Table, t)
o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit(openclash)
--luci.http.redirect(m.redirect)
end
o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
m.uci:revert(openclash, sid)
luci.http.redirect(m.redirect)
end
m:append(Template("openclash/toolbar_show"))
return m

View File

@ -5,6 +5,15 @@ local uci = luci.model.uci.cursor()
local sys = require "luci.sys"
local sid = arg[1]
local fs = require "luci.openclash"
local file_path = ""
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
@ -24,7 +33,7 @@ end
m = Map(openclash, translate("Edit Proxy-Provider"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers%s" % file_path)
if m.uci:get(openclash, sid) ~= "proxy-provider" then
luci.http.redirect(m.redirect)
return
@ -49,11 +58,6 @@ for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
end
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.description = translate("Mark as Custom Node to Prevent Retention config from being Deleted When Enabled")
o = s:option(ListValue, "type", translate("Provider Type"))
o.rmempty = true
o.description = translate("Choose The Provider Type")
@ -158,12 +162,12 @@ function o.validate(self, value)
end
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)"))
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
o.description = font_red..bold_on..translate("The added Proxy Groups Must Exist")..bold_off..font_off
o.rmempty = true
o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
if s.name ~= "" and s.name ~= nil and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)

View File

@ -43,7 +43,6 @@ btned1.write=function(r,x)
end
btndl1 = tb1:option(Button,"download1",translate("Download Config"))
btndl1.template="openclash/other_button"
btndl1.render=function(y,x,r)
y.inputstyle="remove"
Button.render(y,x,r)

View File

@ -1,208 +0,0 @@
local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
function IsYamlFile(e)
e=e or""
local e=string.lower(string.sub(e,-5,-1))
return e == ".yaml"
end
function IsYmlFile(e)
e=e or""
local e=string.lower(string.sub(e,-4,-1))
return e == ".yml"
end
m = Map(openclash, translate("Edit Rule Providers"))
m.pageaction = false
m.description=translate("规则集使用介绍https://wiki.metacubex.one/config/rule-providers/content/")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/rule-providers-settings")
if m.uci:get(openclash, sid) ~= "rule_providers" then
luci.http.redirect(m.redirect)
return
end
-- [[ Rule Providers Setting ]]--
s = m:section(NamedSection, sid, "rule_providers")
s.anonymous = true
s.addremove = false
o = s:option(ListValue, "config", translate("Config File"))
o:value("all", translate("Use For All Config File"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
end
end
o = s:option(Value, "name", translate("Rule Providers Name"))
o.rmempty = false
o.default = "Rule-provider - "..sid
o = s:option(ListValue, "type", translate("Rule Providers Type"))
o.rmempty = true
o.description = translate("Choose The Rule Providers Type")
o:value("http")
o:value("file")
o:value("inline")
o = s:option(ListValue, "format", translate("Rule Format"))
o.rmempty = true
o.description = translate("Choose The Rule File Format, For More Info:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rule-providers/content/\")'>https://wiki.metacubex.one/config/rule-providers/content/</a>"
o:value("yaml")
o:value("text")
o:value("mrs")
o:depends("type", "file")
o:depends("type", "http")
o = s:option(ListValue, "behavior", translate("Rule Behavior"))
o.rmempty = true
o.description = translate("Choose The Rule Behavior")
o:value("domain")
o:value("ipcidr")
o:value("classical", translate("classical").." "..translate("(Not Support mrs Format)"))
o = s:option(ListValue, "path", translate("Rule Providers Path"))
o.description = translate("Update Your Rule Providers File From Config Luci Page")
local p,h={}
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
h=fs.stat(f)
if h then
p[t]={}
p[t].name=fs.basename(f)
o:value("./rule_provider/"..p[t].name)
end
end
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
h=fs.stat(f)
if h then
p[t]={}
p[t].name=fs.basename(f)
o:value("./game_rules/"..p[t].name)
end
end
o.rmempty = false
o:depends("type", "file")
o = s:option(Value, "url", translate("Rule Providers URL"))
o.rmempty = false
o:depends("type", "http")
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
o.default = "86400"
o.rmempty = false
o:depends("type", "http")
o = s:option(ListValue, "position", translate("Append Position"))
o.rmempty = false
o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))
o = s:option(ListValue, "group", translate("Set Proxy Group"))
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'")..bold_off..font_off
o.rmempty = true
local groupnames, filename
local group_list = {}
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
table.insert(group_list, groupname)
end
end
end
end
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
table.insert(group_list, s.name)
end
end)
table.sort(group_list)
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")
-- [[ other-setting ]]--
o = s:option(Value, "other_parameters", translate("Other Parameters"))
o.template = "cbi/tvalue"
o.rows = 20
o.wrap = "off"
o.description = font_red..bold_on..translate("Edit Your Other Parameters Here")..bold_off..font_off
o.rmempty = true
function o.cfgvalue(self, section)
if self.map:get(section, "other_parameters") == nil then
return "# Example:\n"..
"# Only support YAML, four spaces need to be reserved at the beginning of each line to maintain formatting alignment\n"..
"# 示例:\n"..
"# 仅支持 YAML, 每行行首需要多保留四个空格以使脚本处理后能够与上方配置保持格式对齐\n"..
"# inline Example:\n"..
"# payload:\n"..
"# - '.blogger.com'\n"..
"# - '*.*.microsoft.com'\n"..
"# - 'books.itunes.apple.com'\n"
else
return Value.cfgvalue(self, section)
end
end
function o.validate(self, value)
if value then
value = value:gsub("\r\n?", "\n")
value = value:gsub("%c*$", "")
end
return value
end
local t = {
{Commit, Back}
}
a = m:section(Table, t)
o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit(openclash)
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
luci.http.redirect(m.redirect)
end
o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
m.uci:revert(openclash, sid)
luci.http.redirect(m.redirect)
end
m:append(Template("openclash/toolbar_show"))
m:append(Template("openclash/config_editor"))
return m

View File

@ -43,7 +43,6 @@ btned1.write=function(h,n)
end
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
btndl2.template="openclash/other_button"
btndl2.render=function(m,n,h)
m.inputstyle="remove"
Button.render(m,n,h)

View File

@ -1,106 +0,0 @@
local form, m
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
m = SimpleForm("openclash", translate("Other Rule Providers List"))
m.description=translate("Rule Project:").." lhie1 ( https://github.com/dler-io/Rules )<br/>"..
translate("Rule Project:").." ACL4SSR ( https://github.com/ACL4SSR/ACL4SSR/tree/master )"
m.reset = false
m.submit = false
local t = {
{Apply}
}
a = m:section(Table, t)
o = a:option(Button, "Refresh", " ")
o.inputtitle = translate("Refresh Page")
o.inputstyle = "apply"
o.write = function()
SYS.call("rm -rf /tmp/rule_providers_name 2>/dev/null")
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
end
o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
end
if not NXFS.access("/tmp/rule_providers_name") then
SYS.call("awk -v d=',' -F ',' '{print $4d$5}' /usr/share/openclash/res/rule_providers.list > /tmp/rule_providers_name 2>/dev/null")
end
file = io.open("/tmp/rule_providers_name", "r");
---- Rules List
local e={},o,t
if NXFS.access("/tmp/rule_providers_name") then
for o in file:lines() do
table.insert(e,o)
end
for t,o in ipairs(e) do
e[t]={}
e[t].num=string.format(t)
e[t].name=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2)
if e[t].lfilename == "" then
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $5}' 2>/dev/null",o)),1,-2)
end
e[t].filename=o
e[t].author=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2)
RULE_FILE="/etc/openclash/rule_provider/".. e[t].lfilename
if fs.mtime(RULE_FILE) then
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
else
e[t].size="/"
e[t].mtime="/"
end
if fs.isfile(RULE_FILE) then
e[t].exist=translate("Exist")
else
e[t].exist=translate("Not Exist")
end
e[t].remove=0
end
end
file:close()
form=SimpleForm("filelist")
form.reset=false
form.submit=false
tb=form:section(Table,e)
nu=tb:option(DummyValue,"num",translate("Serial Number"))
st=tb:option(DummyValue,"exist",translate("State"))
st.template="openclash/cfg_check"
tp=tb:option(DummyValue,"rule_type",translate("Rule Type"))
nm=tb:option(DummyValue,"name",translate("Rule Name"))
au=tb:option(DummyValue,"author",translate("Rule Author"))
fm=tb:option(DummyValue,"lfilename",translate("File Name"))
sz=tb:option(DummyValue,"size",translate("Size"))
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
btnis.template="openclash/download_rule"
btnrm=tb:option(Button,"remove",translate("Remove"))
btnrm.render=function(e,t,a)
e.inputstyle="reset"
Button.render(e,t,a)
end
btnrm.write=function(a,t)
fs.unlink("/etc/openclash/rule_provider/"..e[t].lfilename)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
end
return m, form

View File

@ -1,286 +0,0 @@
local m, s, o
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
m = Map(openclash, translate("Rule Providers Append"))
m.pageaction = false
m.description=translate("Attention:")..
"<br/>"..translate("The game proxy is a test function and does not guarantee the availability of rules")..
"<br/>"..translate("Preparation steps:")..
"<br/>"..translate("1. Check the policy group and node you are going to use, Policy group type suggestion: fallback, game nodes must be support UDP and not a Vmess")..
"<br/>"..translate("2. Click the <manage third party game rules> or <manage third party rule set> button to enter the rule list and download the rules you want to use")..
"<br/>"..translate("3. On this page, set the corresponding configuration file and policy group of the rule you have downloaded, and save the settings")..
"<br/>"..
"<br/>"..translate("When setting this page, if the groups is empty, please go to the <Onekey Create> page to add")..
"<br/>"..
"<br/>"..translate("Introduction to rule set usage:").." <a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rule-providers/content/\")'>"..translate("https://wiki.metacubex.one/config/rule-providers/content/").."</a>"
function IsRuleFile(e)
e=e or""
local e=string.lower(string.sub(e,-6,-1))
return e==".rules"
end
function IsYamlFile(e)
e=e or""
local e=string.lower(string.sub(e,-5,-1))
return e == ".yaml"
end
function IsYmlFile(e)
e=e or""
local e=string.lower(string.sub(e,-4,-1))
return e == ".yml"
end
local groupnames, filename
local group_list = {}
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
table.insert(group_list, groupname)
end
end
end
end
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
table.insert(group_list, s.name)
end
end)
table.sort(group_list)
table.insert(group_list, "DIRECT")
table.insert(group_list, "REJECT")
table.insert(group_list, "REJECT-DROP")
table.insert(group_list, "PASS")
table.insert(group_list, "GLOBAL")
-- [[ Edit Game Rule ]] --
s = m:section(TypedSection, "game_config", translate("Game Rules Append"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.rmempty = false
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
---- config
o = s:option(ListValue, "config", translate("Config File"))
o:value("all", translate("Use For All Config File"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
end
end
---- rule name
o = s:option(DynamicList, "rule_name", translate("Game Rule's Name"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].filename=fs.basename(f)
if IsRuleFile(e[t].filename) then
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
if e[t].name ~= "" and e[t].name ~= nil then
o:value(e[t].name)
end
end
end
end
o.rmempty = true
---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
-- [[ Edit Other Rule Provider ]] --
s = m:section(TypedSection, "rule_provider_config", translate("Other Rule Providers Append"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.rmempty = false
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
---- config
o = s:option(ListValue, "config", translate("Config File"))
o:value("all", translate("Use For All Config File"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
end
end
---- rule name
o = s:option(DynamicList, "rule_name", translate("Rule Provider's Name"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].filename=fs.basename(f)
if IsYamlFile(e[t].filename) or IsYmlFile(e[t].filename) then
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
if e[t].name ~= "" and e[t].name ~= nil then
o:value(e[t].name)
end
end
end
end
o.rmempty = true
---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
o.default = "86400"
o.rmempty = false
---- position
o = s:option(ListValue, "position", translate("Append Position"))
o.rmempty = false
o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))
-- [[ Edit Custom Rule Provider ]] --
s = m:section(TypedSection, "rule_providers", translate("Custom Rule Providers Append"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/rule-providers-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
if sid then
luci.http.redirect(s.extedit % sid)
return
end
end
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "name", translate("Rule Providers Name"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "position", translate("Append Position"))
o.rmempty = false
o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))
local rm = {
{rule_mg, pro_mg}
}
rmg = m:section(Table, rm)
o = rmg:option(Button, "rule_mg", " ")
o.inputtitle = translate("Game Rules Manage")
o.inputstyle = "reload"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
end
o = rmg:option(Button, "pro_mg", " ")
o.inputtitle = translate("Other Rule Provider Manage")
o.inputstyle = "reload"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
end
local t = {
{Commit, Apply}
}
ss = m:section(Table, t)
o = ss:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("openclash")
end
o = ss:option(Button, "Apply", " ")
o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash")
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end
m:append(Template("openclash/toolbar_show"))
return m

View File

@ -6,6 +6,15 @@ local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
local file_path = ""
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
@ -99,7 +108,7 @@ local obfs = {
m = Map(openclash, translate("Edit Server"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers%s" % file_path)
if m.uci:get(openclash, sid) ~= "servers" then
luci.http.redirect(m.redirect)
@ -130,11 +139,6 @@ for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
end
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.description = translate("Mark as Custom Node to Prevent Retention config from being Deleted When Enabled")
o = s:option(ListValue, "type", translate("Server Node Type"))
o:value("ss", translate("Shadowsocks"))
o:value("ssr", translate("ShadowsocksR"))
@ -1174,18 +1178,18 @@ o.rmempty = true
o.description = font_red..bold_on..translate("The added Dialer Proxy or Group Must Exist")..bold_off..font_off
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
if s.name ~= "" and s.name ~= nil and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)"))
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
o.description = font_red..bold_on..translate("The added Proxy Groups Must Exist")..bold_off..font_off
o.rmempty = true
o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
if s.name ~= "" and s.name ~= nil and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)

View File

@ -3,13 +3,17 @@ local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local file_path = ""
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
for i = 1, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
m = Map(openclash, translate("Onekey Create (Servers&Groups manage)"))
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
m = Map(openclash, translate("Servers & Groups manage"))
m.pageaction = false
m.description=translate("Attention:")..
"<br/>"..translate("1. Before modifying the configuration file, please click the button below to read the configuration file")..
@ -18,175 +22,142 @@ m.description=translate("Attention:")..
"<br/>"..translate("Introduction to proxy usage:").." <a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/proxies/\")'>"..translate("https://wiki.metacubex.one/config/proxies/").."</a>"..
"<br/>"..translate("Introduction to proxy-provider usage:").." <a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/proxy-providers/\")'>"..translate("https://wiki.metacubex.one/config/proxy-providers/").."</a>"
s = m:section(TypedSection, "openclash")
s.anonymous = true
o = s:option(Flag, "create_config", translate("Create Config"))
o.description = font_red .. bold_on .. translate("Create Config By One-Click Only Need Proxies") .. bold_off .. font_off
o.default = 0
o = s:option(ListValue, "rule_sources", translate("Choose Template For Create Config"))
o.description = translate("Use Other Rules To Create Config")
o:depends("create_config", 1)
o:value("lhie1", translate("lhie1 Rules"))
o = s:option(Flag, "mix_proxies", translate("Mix Proxies"))
o.description = font_red .. bold_on .. translate("Mix This Page's Proxies") .. bold_off .. font_off
o:depends("create_config", 1)
o.default = 0
o = s:option(Flag, "servers_update", translate("Keep Settings"))
o.description = font_red .. bold_on .. translate("Only Update Servers Below When Subscription") .. bold_off .. font_off
o.default = 0
o = s:option(DynamicList, "new_servers_group", translate("New Servers Group (Support Regex)"))
o.description = translate("Set The New Subscribe Server's Default Proxy Groups")
o.rmempty = true
o:depends("servers_update", 1)
o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups",
function(s)
o:value(s.name)
end)
-- [[ Groups Manage ]]--
s = m:section(TypedSection, "groups", translate("Proxy Groups(No Need Set when Config Create)"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
gs = m:section(TypedSection, "groups", translate("Proxy Groups"))
gs.anonymous = true
gs.addremove = true
gs.sortable = true
gs.template = "openclash/tblsection"
gs.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s"..file_path)
function gs.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
luci.http.redirect(s.extedit % sid)
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "config", name)
end
luci.http.redirect(gs.extedit % sid)
return
end
end
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o = gs:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(DummyValue, "config", translate("Config File"))
o = gs:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "type", translate("Group Type"))
o = gs:option(DummyValue, "type", translate("Group Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "name", translate("Group Name"))
o = gs:option(DummyValue, "name", translate("Group Name"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
-- [[ Proxy-Provider Manage ]]--
s = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
ps = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
ps.anonymous = true
ps.addremove = true
ps.sortable = true
ps.template = "openclash/tblsection"
ps.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s"..file_path)
function ps.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
luci.http.redirect(s.extedit % sid)
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "config", name)
end
luci.http.redirect(ps.extedit % sid)
return
end
end
o = s:option(Flag, "enabled", translate("Enable"))
o = ps:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
o = s:option(DummyValue, "config", translate("Config File"))
o = ps:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "type", translate("Provider Type"))
o = ps:option(DummyValue, "type", translate("Provider Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "name", translate("Provider Name"))
o = ps:option(DummyValue, "name", translate("Provider Name"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
-- [[ Servers Manage ]]--
s = m:section(TypedSection, "servers", translate("Proxies"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
ss = m:section(TypedSection, "servers", translate("Proxies"))
ss.anonymous = true
ss.addremove = true
ss.sortable = true
ss.template = "openclash/tblsection"
ss.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s"..file_path)
function ss.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
luci.http.redirect(s.extedit % sid)
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "config", name)
end
luci.http.redirect(ss.extedit % sid)
return
end
end
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o = ss:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
o = s:option(DummyValue, "config", translate("Config File"))
o = ss:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "type", translate("Type"))
o = ss:option(DummyValue, "type", translate("Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "name", translate("Server Alias"))
o = ss:option(DummyValue, "name", translate("Server Alias"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "server", translate("Server Address"))
o = ss:option(DummyValue, "server", translate("Server Address"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "port", translate("Server Port"))
o = ss:option(DummyValue, "port", translate("Server Port"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "udp", translate("UDP Support"))
o = ss:option(DummyValue, "udp", translate("UDP Support"))
function o.cfgvalue(...)
if Value.cfgvalue(...) == "true" then
return translate("Enable")
@ -207,8 +178,13 @@ o = b:option(Button,"Delete_Unused_Servers", " ")
o.inputtitle = translate("Delete Unused Servers")
o.inputstyle = "reset"
o.write = function()
luci.sys.call("sh /usr/share/openclash/cfg_unused_servers_del.sh 2>/dev/null")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
m.uci:foreach("openclash", "servers",
function(s)
if s.enabled ~= "1" then
m.uci:delete("openclash", s[".name"])
end
end)
m.uci:commit("openclash")
end
o = b:option(Button,"Delete_Servers", " ")
@ -217,7 +193,6 @@ o.inputstyle = "reset"
o.write = function()
m.uci:delete_all("openclash", "servers", function(s) return true end)
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end
o = b:option(Button,"Delete_Proxy_Provider", " ")
@ -226,7 +201,6 @@ o.inputstyle = "reset"
o.write = function()
m.uci:delete_all("openclash", "proxy-provider", function(s) return true end)
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end
o = b:option(Button,"Delete_Groups", " ")
@ -235,11 +209,10 @@ o.inputstyle = "reset"
o.write = function()
m.uci:delete_all("openclash", "groups", function(s) return true end)
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end
local t = {
{Load_Config, Commit, Apply}
{Load_Config, Commit, Apply, Back}
}
a = m:section(Table, t)
@ -249,15 +222,13 @@ o.inputtitle = translate("Read Config")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("openclash")
luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
luci.sys.call("/usr/share/openclash/yml_groups_get.sh \"%s\" 2>/dev/null" % file_path)
end
o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:commit("openclash")
end
@ -266,9 +237,14 @@ o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("openclash")
fs.unlink("/tmp/Proxy_Group")
luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
luci.sys.call("/usr/share/openclash/yml_groups_set.sh \"%s\" >/dev/null 2>&1 &" % file_path)
end
o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "apply"
o.write = function()
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
end
m:append(Template("openclash/toolbar_show"))

View File

@ -8,6 +8,13 @@ local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
local json = require "luci.jsonc"
local datatype = require "luci.cbi.datatypes"
local net = require "luci.model.network".init()
local devices = {}
for _, iface in ipairs(net:get_interfaces()) do
if iface:name() then
table.insert(devices, {name = iface:name()})
end
end
-- 优化 CBI UI新版 LuCI 专用)
local function optimize_cbi_ui()
@ -72,7 +79,6 @@ s:tab("auto_restart", translate("Auto Restart"))
s:tab("version_update", translate("Version Update"))
s:tab("developer", translate("Developer Settings"))
s:tab("debug", translate("Debug Logs"))
s:tab("dlercloud", translate("Dler Cloud"))
o = s:taboption("op_mode", ListValue, "en_mode", font_red..bold_on..translate("Select Mode")..bold_off..font_off)
o.description = translate("Select Mode For OpenClash Work, Try Flush DNS Cache If Network Error")
@ -218,6 +224,10 @@ o = s:taboption("lan_ac", DynamicList, "wan_ac_black_ips", translate("WAN Bypass
o.datatype = "ipmask"
o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported, Please Setting Fake-IP-Filter First If You Need Domain Type Requests")
o = s:taboption("lan_ac", DynamicList, "wan_ac_black_ports", translate("WAN Bypassed Port List"))
o.datatype = "or(port, portrange)"
o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported, Please Setting Fake-IP-Filter First If You Need Domain Type Requests")
s2 = m:section(TypedSection, "lan_ac_traffic", translate("Lan Traffic Access List"),
"1. "..translate("The Traffic From The Local Specified Port Will Not Pass The Core, Try To Set When The Bypass Gateway Forwarding Fails").."; ".."2. "..translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported, Please Setting Fake-IP-Filter First If You Need Domain Type Requests"))
@ -268,6 +278,42 @@ o:value("both", translate("Both"))
o.default = "tcp"
o.rmempty = false
o = s2:option(ListValue, "interface", translate("Interface"))
o:value("")
o.default = ""
for _, dev in ipairs(devices) do
o:value(dev.name)
end
o.rmempty = true
o = s2:option(ListValue, "user", translate("User"))
o:value("")
o.default = ""
local passwd_content = NXFS.readfile("/etc/passwd")
local users = ""
if passwd_content then
for line in string.gmatch(passwd_content, "[^\n]+") do
if line:match("^[^#]") and line:match(":") then
local fields = {}
for field in string.gmatch(line, "([^:]+)") do
table.insert(fields, field)
end
if #fields >= 3 then
local username = fields[1]
local uid_str = fields[3]
local uid = tonumber(uid_str)
if uid and uid >= 0 then
users = users .. uid .. ":" .. username .. "\n"
end
end
end
end
end
for uid, username in string.gmatch(users, "(%d+):(%S+)") do
o:value(uid, username)
end
o.rmempty = true
o = s2:option(Value, "dscp", translate("DSCP"))
o.datatype = "range(0,63)"
o.rmempty = true
@ -417,17 +463,16 @@ o.default = 1
o = s:taboption("traffic_control", DynamicList, "intranet_allowed_wan_name", translate("WAN Interface Name"))
o.description = translate("Select WAN Interface Name For The Intranet Allowed")
o:depends("intranet_allowed", "1")
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
for interface in string.gmatch(interfaces, "%S+") do
o:value(interface)
for _, dev in ipairs(devices) do
o:value(dev.name)
end
o = s:taboption("traffic_control", ListValue, "lan_interface_name", translate("LAN Interface Name"))
o.description = translate("Select LAN Interface Name")
o:value("0", translate("Disable"))
o.default = "0"
for interface in string.gmatch(interfaces, "%S+") do
o:value(interface)
for _, dev in ipairs(devices) do
o:value(dev.name)
end
o = s:taboption("traffic_control", Value, "local_network_pass", translate("Local IPv4 Network Bypassed List"))
@ -841,42 +886,6 @@ o.value = "OpenAI"
o:depends("stream_auto_select_openai", "1")
---- update Settings
o = s:taboption("rules_update", Flag, "other_rule_auto_update", translate("Auto Update"))
o.description = font_red..bold_on..translate("Auto Update Other Rules")..bold_off..font_off
o.default = 0
o = s:taboption("rules_update", ListValue, "other_rule_update_week_time", translate("Update Time (Every Week)"))
o:depends("other_rule_auto_update", "1")
o:value("*", translate("Every Day"))
o:value("1", translate("Every Monday"))
o:value("2", translate("Every Tuesday"))
o:value("3", translate("Every Wednesday"))
o:value("4", translate("Every Thursday"))
o:value("5", translate("Every Friday"))
o:value("6", translate("Every Saturday"))
o:value("0", translate("Every Sunday"))
o.default = "1"
o = s:taboption("rules_update", ListValue, "other_rule_update_day_time", translate("Update time (every day)"))
o:depends("other_rule_auto_update", "1")
for t = 0,23 do
o:value(t, t..":00")
end
o.default = "0"
o = s:taboption("rules_update", Button, translate("Other Rules Update"))
o:depends("other_rule_auto_update", "1")
o.title = translate("Update Other Rules")
o.inputtitle = translate("Check And Update")
o.description = translate("Other Rules Update(Only in Use)")..", "..translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/usr/share/openclash/res/lhie1.yaml"))..bold_off..font_off
o.inputstyle = "reload"
o.write = function()
m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash")
SYS.call("/usr/share/openclash/openclash_rule.sh >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end
o = s:taboption("geo_update", Flag, "geo_auto_update", font_red..bold_on..translate("Auto Update GeoIP MMDB")..bold_off..font_off)
o.default = 0
@ -911,7 +920,7 @@ o:depends("geo_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOIP Update"))
o.title = translate("Update GeoIP MMDB")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/Country.mmdb"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/Country.mmdb")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@ -954,7 +963,7 @@ o:depends("geoip_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOIP Dat Update"))
o.title = translate("Update GeoIP Dat")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/GeoIP.dat"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/GeoIP.dat")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@ -997,7 +1006,7 @@ o:depends("geosite_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOSITE Update"))
o.title = translate("Update GeoSite Database")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/GeoSite.dat"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/GeoSite.dat")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@ -1040,7 +1049,7 @@ o:depends("geoasn_auto_update", "1")
o = s:taboption("geo_update", Button, translate("ASN Update"))
o.title = translate("Update Geo ASN Database")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/ASN.mmdb"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/ASN.mmdb")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@ -1090,6 +1099,7 @@ o.default = "https://ispip.clang.cn/all_cn_ipv6.txt"
o = s:taboption("chnr_update", Button, translate("Chnroute Lists Update"))
o.title = translate("Update Chnroute Lists")
o.description = translate("Current Version:").." "..font_green..bold_on.. "IPv4 ("..fs.get_resourse_mtime("/etc/openclash/china_ip_route.ipset")..")"..bold_off..font_off.." "..font_green..bold_on.. "& IPv6 ("..fs.get_resourse_mtime("/etc/openclash/china_ip6_route.ipset")..")"..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@ -1298,54 +1308,6 @@ end
o = s:taboption("debug", DummyValue, "", nil)
o.template = "openclash/debug"
---- dlercloud
o = s:taboption("dlercloud", Value, "dler_email")
o.title = translate("Account Email Address")
o.rmempty = true
o = s:taboption("dlercloud", Value, "dler_passwd")
o.title = translate("Account Password")
o.password = true
o.rmempty = true
if fs.uci_get_config("config", "dler_token") then
o = s:taboption("dlercloud", Flag, "dler_checkin")
o.title = translate("Checkin")
o.default = 0
o.rmempty = true
end
o = s:taboption("dlercloud", Value, "dler_checkin_interval")
o.title = translate("Checkin Interval (hour)")
o:depends("dler_checkin", "1")
o.default = "1"
o.rmempty = true
o = s:taboption("dlercloud", Value, "dler_checkin_multiple")
o.title = translate("Checkin Multiple")
o.datatype = "uinteger"
o.default = "1"
o:depends("dler_checkin", "1")
o.rmempty = true
o.description = font_green..bold_on..translate("Multiple Must Be a Positive Integer and No More Than 100")..bold_off..font_off
function o.validate(self, value)
if tonumber(value) < 1 then
return "1"
end
if tonumber(value) > 100 then
return "100"
end
return value
end
o = s:taboption("dlercloud", DummyValue, "dler_login", translate("Account Login"))
o.template = "openclash/dler_login"
if fs.uci_get_config("config", "dler_token") then
o.value = font_green..bold_on..translate("Account logged in")..bold_off..font_off
else
o.value = font_red..bold_on..translate("Account not logged in")..bold_off..font_off
end
local t = {
{Commit, Apply}
}

View File

@ -315,12 +315,15 @@ function get_resourse_mtime(path)
end
end
local file = fs.readlink(real_path) or real_path
local model_version = os.date("%Y-%m-%d %H:%M:%S", mtime(real_path))
if model_version and model_version ~= "" then
return model_version
else
return "Unknown"
end
local resourse_etag_version = SYS.exec(string.format("source /usr/share/openclash/openclash_etag.sh && GET_ETAG_TIMESTAMP_BY_PATH '%s'", real_path))
if resourse_etag_version and resourse_etag_version ~= "" then
return resourse_etag_version
end
local resourse_version = os.date("%Y-%m-%d %H:%M:%S", mtime(real_path))
if resourse_version and resourse_version ~= "" then
return resourse_version
end
return "Unknown"
end
function uci_get_config(section, key)

View File

@ -1,4 +1,8 @@
<style>
@font-face {
font-family: 'Twemoji Mozilla';
src: url('/luci-static/resources/openclash/fonts/TwemojiMozilla-flags-B12sb_Bp.woff2') format('woff2');
}
.oc[data-darkmode="true"] .config-editor-model .CodeMirror {
background: var(--bg-white);
color: var(--text-primary);
@ -308,6 +312,12 @@
.oc .config-editor-model .CodeMirror.zoom-125 { font-size: 17.5px; }
.oc .config-editor-model .CodeMirror.zoom-150 { font-size: 21px; }
.oc .config-editor-model .CodeMirror.zoom-200 { font-size: 28px; }
.oc .config-editor-model .CodeMirror, .oc .config-editor-model .CodeMirror-line {
font-family: 'Twemoji Mozilla', "Microsoft Yahei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB" !important;
}
.oc .config-editor-model .CodeMirror-hints.log {
font-family: 'Twemoji Mozilla', "Open Sans", "PingFangSC-Regular", "Microsoft Yahei", "WenQuanYi Micro Hei", "Helvetica Neue", "Helvetica", "Hiragino Sans GB", "sans-serif" !important;
}
#config-mergeview-container .CodeMirror-merge,
#config-mergeview-container .CodeMirror-merge-pane,
#config-mergeview-container .CodeMirror,
@ -611,7 +621,6 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css">
<script src="/luci-static/resources/openclash/lib/codemirror.js"></script>
<script src="/luci-static/resources/openclash/mode/yaml/yaml.js"></script>
<script src="/luci-static/resources/openclash/mode/lua/lua.js"></script>
<script src="/luci-static/resources/openclash/mode/shell/shell.js"></script>
<script src="/luci-static/resources/openclash/mode/properties/properties.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
@ -635,6 +644,16 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/merge/merge.css">
<script type="text/javascript">
var levelTranslations = {
'info': '<%:Info%>',
'warning': '<%:Warning%>',
'error': '<%:Error%>',
'debug': '<%:Debug%>',
'tip': '<%:Tip%>',
'watchdog': '<%:Watchdog%>',
'fatal': '<%:Fatal%>'
};
var ConfigEditor = {
overlay: null,
model: null,

View File

@ -9,7 +9,7 @@
border: none !important;
}
.CodeMirror-merge-r-chunk {
background: #0095ff2e !important;
background: #0095ff2e !important;
}
.CodeMirror-merge-2pane .CodeMirror-merge-gap {
height: 700px !important;
@ -28,15 +28,22 @@
box-sizing: border-box;
word-break: break-all !important;
overflow-wrap: break-word !important;
font-family: 'Twemoji Mozilla', "Microsoft Yahei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB" !important;
}
.CodeMirror-hints.log {
font-family: 'Twemoji Mozilla', "Open Sans", "PingFangSC-Regular", "Microsoft Yahei", "WenQuanYi Micro Hei", "Helvetica Neue", "Helvetica", "Hiragino Sans GB", "sans-serif" !important;
}
:root[data-darkmode="true"] .CodeMirror-merge-gap {
background: #d0cfcf !important;
}
@font-face {
font-family: 'Twemoji Mozilla';
src: url('/luci-static/resources/openclash/fonts/TwemojiMozilla-flags-B12sb_Bp.woff2') format('woff2');
}
</style>
<link rel="stylesheet" href="/luci-static/resources/openclash/lib/codemirror.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material-log.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/idea.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/log.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/fold/foldgutter.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/lint/lint.css">
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/display/fullscreen.css">
@ -44,7 +51,7 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css">
<script src="/luci-static/resources/openclash/lib/codemirror.js"></script>
<script src="/luci-static/resources/openclash/mode/yaml/yaml.js"></script>
<script src="/luci-static/resources/openclash/mode/lua/lua.js"></script>
<script src="/luci-static/resources/openclash/mode/log/log.js"></script>
<script src="/luci-static/resources/openclash/mode/shell/shell.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldgutter.js"></script>
@ -72,14 +79,16 @@ local fs = require "luci.openclash"
local conf = fs.uci_get_config("config", "config_path")
if not conf then conf = "/etc/openclash/config/config.yaml" end
local conf_name = fs.basename(conf)
if not conf_name then conf_name = "config.yaml" end
if not conf_name then conf_name = "config.yaml" end
local sconf = "/etc/openclash/"..conf_name
local path_info = os.getenv("PATH_INFO") or ""
local sid = path_info:match("(cfg[0-9a-f]+)") or ""
-%>
<table id="my_editor_div" style="width: 100%; text-align: center; display: none;">
<tr>
<td style="width: 50%; overflow: hidden;"><%:Modify Your Config file:%> <b style=color:green><%=conf_name%></b> <%:Here, Except The Settings That Were Taken Over%></td>
<%-
if fs.isfile(sconf) then
-%>
@ -95,6 +104,15 @@ local sconf = "/etc/openclash/"..conf_name
</table>
<script type="text/javascript">//<![CDATA[
var levelTranslations = {
'info': '<%:Info%>',
'warning': '<%:Warning%>',
'error': '<%:Error%>',
'debug': '<%:Debug%>',
'tip': '<%:Tip%>',
'watchdog': '<%:Watchdog%>',
'fatal': '<%:Fatal%>'
};
function isDarkBackground(element) {
var cachedTheme = localStorage.getItem('oc-theme');
@ -209,8 +227,8 @@ function merge_editor(id, id2, target, target2, readOnly, readOnly2, wid, height
});
merge_editor.edit.on("change", function(cm) {
id.value = cm.getValue();
});
id.value = cm.getValue();
});
if (wid && height) {
merge_editor.editor().setSize(wid, height);
@ -233,27 +251,27 @@ function editor(id, readOnly, wid, height)
lint: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
});
if (readOnly == "true") {
if (readOnly) {
editor.setOption("readOnly","true");
};
if (wid && height) {
editor.setSize(wid, height);
};
@ -272,21 +290,21 @@ function shell_editor(id, readOnly, wid, height)
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
});
if (wid && height) {
@ -297,7 +315,7 @@ function shell_editor(id, readOnly, wid, height)
function other_editor(id, readOnly, wid, height)
{
var editor = CodeMirror.fromTextArea(id, {
mode: "lua",
mode: "text/yaml",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
@ -307,21 +325,21 @@ function other_editor(id, readOnly, wid, height)
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
});
if (wid && height) {
@ -329,52 +347,56 @@ function other_editor(id, readOnly, wid, height)
};
};
function other_log_area(id, readOnly, wid, height)
function log_editor(id, name, readOnly, wid, height)
{
var other_log_area = CodeMirror.fromTextArea(id, {
mode: "lua",
window['editor_' + name] = CodeMirror.fromTextArea(id, {
mode: "log",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
theme: "idea",
theme: "log",
lineWrapping: true,
matchBrackets: true,
matchBrackets: false,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
if (readOnly == "true") {
other_log_area.setOption("readOnly","true");
if (readOnly) {
window['editor_' + name].setOption("readOnly","true");
};
if (wid && height) {
other_log_area.setSize(wid, height);
window['editor_' + name].setSize(wid, height);
};
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
other_log_area.markText({line:0,ch:0},{line:9999,ch:9999}, {css: 'font-size:13px'});
};
var custom_cfg_value = document.getElementById("cbid.openclash." + window.location.pathname.split("/")[window.location.pathname.split("/").length - 1] + ".other_parameters");
var core_log = document.getElementById("core_log");
var oc_log = document.getElementById("cbid.openclash.config.clog");
if (core_log && oc_log) {
log_editor(oc_log, 'oc', true, '100%', '540px');
log_editor(core_log, 'core', true, '100%', '540px');
};
var custom_cfg_value = document.getElementById("cbid.openclash.<%=sid%>.other_parameters");
if (custom_cfg_value) {
editor(custom_cfg_value, 'false', '100%', '300px');
editor(custom_cfg_value, false, '100%', '300px');
};
var custom_firewall = document.getElementById("cbid.openclash.config.firewall_custom");
var custom_ymchange = document.getElementById("cbid.openclash.config.ymchange_custom");
if (custom_firewall) {
shell_editor(custom_firewall, 'false', "100%", '300px');
};
if (custom_ymchange) {
shell_editor(custom_ymchange, 'false', "100%", '300px');
shell_editor(custom_firewall, false, "100%", '300px');
};
var myEditor_use = document.getElementById("cbid.table.1.user");
@ -383,7 +405,7 @@ var myEditor_def = document.getElementById("cbid.table.1.default");
if (myEditor_use && myEditor_def) {
var myEditor_div_use = document.getElementById("cbi-table-1-user");
var myEditor_div_def = document.getElementById("cbi-table-1-default");
myEditor_div_def.parentNode.parentNode.style.cssText="text-align: left !important"
myEditor_div_def.parentNode.className='cbi-value';
myEditor_div_def.parentNode.style.display="revert"
@ -392,7 +414,7 @@ if (myEditor_use && myEditor_def) {
myEditor_div_use.parentNode.className='cbi-value';
myEditor_div_use.parentNode.style.display="revert"
myEditor_div_use.parentNode.style.width="100%"
merge_editor(myEditor_use, myEditor_def, myEditor_div_use, myEditor_div_def, 'true', 'false', 'auto', '700px');
merge_editor(myEditor_use, myEditor_def, myEditor_div_use, myEditor_div_def, true, false, 'auto', '700px');
};
var myEditor_hosts = document.getElementById("cbid.openclash.config.custom_hosts");
@ -407,98 +429,44 @@ var myEditor_custom_sniffer = document.getElementById("cbid.openclash.config.sni
var myEditor_proxy_name_pol = document.getElementById("cbid.openclash.config.custom_proxy_server_dns_policy");
if (myEditor_hosts) {
editor(myEditor_hosts, 'false', '100%', '300px');
editor(myEditor_hosts, false, '100%', '300px');
};
if (myEditor_edit_file) {
editor(myEditor_edit_file, 'false', '100%', '700px');
editor(myEditor_edit_file, false, '100%', '700px');
};
if (myEditor_fall_fil) {
editor(myEditor_fall_fil, 'false', '100%', '300px');
editor(myEditor_fall_fil, false, '100%', '300px');
};
if (myEditor_name_pol) {
editor(myEditor_name_pol, 'false', '100%', '300px');
editor(myEditor_name_pol, false, '100%', '300px');
};
if (myEditor_proxy_name_pol) {
editor(myEditor_proxy_name_pol, 'false', '100%', '300px');
editor(myEditor_proxy_name_pol, false, '100%', '300px');
};
if (myEditor_name_cus_r1) {
editor(myEditor_name_cus_r1, 'false', '100%', '300px');
editor(myEditor_name_cus_r2, 'false', '100%', '300px');
editor(myEditor_name_cus_r1, false, '100%', '300px');
editor(myEditor_name_cus_r2, false, '100%', '300px');
};
if (myEditor_fake_filter) {
other_editor(myEditor_fake_filter, 'false', '100%', '300px');
other_editor(myEditor_fake_filter, false, '100%', '300px');
};
if (myEditor_custom_domain_dns) {
other_editor(myEditor_custom_domain_dns, 'false', '100%', '300px');
other_editor(myEditor_custom_domain_dns, false, '100%', '300px');
};
if (myEditor_custom_sniffer) {
other_editor(myEditor_custom_sniffer, 'false', '100%', '300px');
};
var core_log = document.getElementById("core_log");
var oc_log = document.getElementById("cbid.openclash.config.clog");
if (core_log && oc_log) {
var core_editor = CodeMirror.fromTextArea(core_log, {
mode: "lua",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
theme: "idea",
lineWrapping: true,
matchBrackets: true,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
var oc_editor = CodeMirror.fromTextArea(oc_log, {
mode: "lua",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
theme: "idea",
lineWrapping: true,
matchBrackets: true,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
core_editor.setSize("100%", "540px");
core_editor.setOption("readOnly","true");
oc_editor.setSize("100%", "540px");
oc_editor.setOption("readOnly","true");
if (isDarkBackground(document.body)) {
core_editor.setOption('theme', 'material-log');
oc_editor.setOption('theme', 'material-log');
document.documentElement.setAttribute('data-darkmode', 'true');
};
other_editor(myEditor_custom_sniffer, false, '100%', '300px');
};
var proxy_mg = document.getElementById('cbi-table-1-proxy_mg');
var rule_mg = document.getElementById('cbi-table-1-rule_mg');
var game_mg = document.getElementById('cbi-table-1-game_mg');
var Commit = document.getElementById('cbi-table-1-Commit');
var Apply = document.getElementById('cbi-table-1-Apply');
var Create = document.getElementById('cbi-table-1-Create');
@ -506,7 +474,6 @@ var Create = document.getElementById('cbi-table-1-Create');
if (proxy_mg) {
proxy_mg.style.textAlign="center";
rule_mg.style.textAlign="center";
game_mg.style.textAlign="center";
Commit.style.textAlign="center";
Apply.style.textAlign="center";
Create.style.textAlign="center";

View File

@ -785,7 +785,6 @@
<label for="convert-address-input"><%:Convert Address%>:</label>
<div class="form-select-wrapper">
<select id="convert-address-input" class="form-select">
<option value="https://api.dler.io/sub">api.dler.io (<%:Default%>)</option>
<option value="https://api.wcc.best/sub">api.wcc.best</option>
<option value="https://api.asailor.org/sub">api.asailor.org</option>
<option value="custom"><%:Custom%></option>
@ -901,24 +900,24 @@
<label for="exclude-default-select"><%:Exclude Keyword Match Default%>:</label>
<div class="form-checkbox-group">
<label class="form-checkbox">
<input type="checkbox" id="exclude-expire" value="过期时间">
<input type="checkbox" id="exclude-expire" value="<%:Expire%>">
<span class="checkmark"></span>
<%:Expire Time%>
<%:Expire%>
</label>
<label class="form-checkbox">
<input type="checkbox" id="exclude-traffic" value="剩余流量">
<input type="checkbox" id="exclude-traffic" value="<%:Traffic%>">
<span class="checkmark"></span>
<%:Remaining Traffic%>
<%:Traffic%>
</label>
<label class="form-checkbox">
<input type="checkbox" id="exclude-tg" value="TG群">
<input type="checkbox" id="exclude-plan" value="<%:Plan%>">
<span class="checkmark"></span>
<%:TG Group%>
<%:Plan%>
</label>
<label class="form-checkbox">
<input type="checkbox" id="exclude-website" value="官网">
<input type="checkbox" id="exclude-website" value="<%:Official%>">
<span class="checkmark"></span>
<%:Official Website%>
<%:Official%>
</label>
</div>
</div>
@ -1160,7 +1159,7 @@ var ConfigUploader = {
resetAdvancedOptions: function() {
document.getElementById('sub-convert-enable').checked = false;
document.getElementById('sub-convert-options').style.display = 'none';
document.getElementById('convert-address-input').value = 'https://api.dler.io/sub';
document.getElementById('convert-address-input').selectedIndex = 0;
document.getElementById('convert-address-custom').style.display = 'none';
document.getElementById('convert-address-custom').value = '';
@ -1184,7 +1183,7 @@ var ConfigUploader = {
document.getElementById('exclude-keyword-input').value = '';
document.getElementById('exclude-expire').checked = false;
document.getElementById('exclude-traffic').checked = false;
document.getElementById('exclude-tg').checked = false;
document.getElementById('exclude-plan').checked = false;
document.getElementById('exclude-website').checked = false;
},
@ -1249,7 +1248,7 @@ var ConfigUploader = {
document.getElementById('sub-convert-options').style.display = 'block';
if (data.convert_address) {
if (data.convert_address === 'https://api.dler.io/sub' || data.convert_address === 'https://api.wcc.best/sub' || data.convert_address === 'https://api.asailor.org/sub') {
if (data.convert_address === 'https://api.wcc.best/sub' || data.convert_address === 'https://api.asailor.org/sub') {
document.getElementById('convert-address-input').value = data.convert_address;
if (data.convert_address === 'custom') {
document.getElementById('convert-address-custom').style.display = 'block';
@ -1303,10 +1302,10 @@ var ConfigUploader = {
}
if (data.de_ex_keyword) {
var defaults = data.de_ex_keyword.split(' ');
document.getElementById('exclude-expire').checked = defaults.indexOf('过期时间') !== -1;
document.getElementById('exclude-traffic').checked = defaults.indexOf('剩余流量') !== -1;
document.getElementById('exclude-tg').checked = defaults.indexOf('TG群') !== -1;
document.getElementById('exclude-website').checked = defaults.indexOf('官网') !== -1;
document.getElementById('exclude-expire').checked = defaults.indexOf(document.getElementById('exclude-expire').value) !== -1;
document.getElementById('exclude-traffic').checked = defaults.indexOf(document.getElementById('exclude-traffic').value) !== -1;
document.getElementById('exclude-plan').checked = defaults.indexOf(document.getElementById('exclude-plan').value) !== -1;
document.getElementById('exclude-website').checked = defaults.indexOf(document.getElementById('exclude-website').value) !== -1;
}
}
},
@ -1520,7 +1519,7 @@ var ConfigUploader = {
var advancedEnabled = document.getElementById('advanced-options-enable').checked;
var subConvert = advancedEnabled && document.getElementById('sub-convert-enable').checked;
var convertAddress = 'https://api.dler.io/sub';
var convertAddress = '';
var template = '';
var emoji = false;
var udp = false;
@ -1548,13 +1547,13 @@ var ConfigUploader = {
keywords = document.getElementById('keyword-input').value;
excludeKeywords = document.getElementById('exclude-keyword-input').value;
if (document.getElementById('exclude-expire').checked) excludeDefaults.push('过期时间');
if (document.getElementById('exclude-traffic').checked) excludeDefaults.push('剩余流量');
if (document.getElementById('exclude-tg').checked) excludeDefaults.push('TG群');
if (document.getElementById('exclude-website').checked) excludeDefaults.push('官网');
if (document.getElementById('exclude-expire').checked) excludeDefaults.push(document.getElementById('exclude-expire').value);
if (document.getElementById('exclude-traffic').checked) excludeDefaults.push(document.getElementById('exclude-traffic').value);
if (document.getElementById('exclude-plan').checked) excludeDefaults.push(document.getElementById('exclude-plan').value);
if (document.getElementById('exclude-website').checked) excludeDefaults.push(document.getElementById('exclude-website').value);
if (convertAddress === 'custom') {
convertAddress = convertAddressCustom.trim() || 'https://api.dler.io/sub';
convertAddress = convertAddressCustom.trim();
}
if (template === '0') {

View File

@ -10,7 +10,13 @@ local dns_host = "www.instagram.com"
<style>
:root[data-darkmode="true"] .diag-style {
background-color: #404040;
color: #ffffff;
background-color: #404040;
}
:root[data-darkmode="true"] .diag-style select, .diag-style input {
color: #ffffff;
background-color: #404040;
}
:root[data-darkmode="true"] #diag-rc-output > pre {
@ -24,6 +30,12 @@ local dns_host = "www.instagram.com"
}
.diag-style {
color: #000;
background-color: #f5f5f5;
}
.diag-style select, .diag-style input {
color: #000;
background-color: #f5f5f5;
}
@ -57,12 +69,6 @@ local dns_host = "www.instagram.com"
<script type="text/javascript">//<![CDATA[
setTimeout(function(){
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
}, 300);
function show_diag_info(addr)
{
var addr = addr;

File diff suppressed because one or more lines are too long

View File

@ -1,111 +0,0 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function dler_login(btn,option)
{
btn.disabled = true;
if (option == "dler_login") {
var s = document.getElementById(option+'-status');
var e = document.getElementsByName('cbid.openclash.config.dler_email');
var p = document.getElementsByName('cbid.openclash.config.dler_passwd');
var c = document.getElementsByName('cbid.openclash.config.dler_checkin');
if (!e[0].value || !p[0].value) {
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Error Login Info%>"+"</strong></font>";
return false;
};
if (c[0] && c[0].checked) {
c = "1";
var i = document.getElementsByName('cbid.openclash.config.dler_checkin_interval');
var m = document.getElementsByName('cbid.openclash.config.dler_checkin_multiple');
if (!i[0].value || !(/(^[1-9]\d*$)/.test(i[0].value))) { i = "1"} else {i = i[0].value};
if (!m[0].value || !(/(^[1-9]\d*$)/.test(m[0].value)))
{
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 100%>"+"</strong></font>";
return false;
}
else if (m[0].value < 1)
{
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 100%>"+"</strong></font>";
return false;
}
else if (m[0].value > 100)
{
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 100%>"+"</strong></font>";
return false;
}
else {
m = m[0].value;
};
}
else {
c = "0";
var i = "1";
var m = "1";
};
btn.value = '<%:Login...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login_info_save")%>', {email: e[0].value, passwd : p[0].value, checkin: c, interval: i, multiple: m}, function(x, status) {
if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login")%>', null, function(x, status) {
if (s)
{
if (x && x.status == 200 && status.dler_login == 200) {
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Login Successful%>"+"</strong></font>";
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
}
else {
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Login Faild%>"+"</strong></font>";
if (status.dler_login) {
alert("<%:Dler Cloud Login Faild%>: "+status.dler_login)
}
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
}
}
btn.disabled = false;
btn.value = '<%:Login Account%>';
});
}
});
};
if (option == "dler_logout") {
var s = document.getElementById('dler_login-status');
btn.value = '<%:Logout...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_logout")%>', null, function(x, status) {
if (s)
{
if (x && x.status == 200 && status.dler_logout == 200) {
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Logout Successful%>"+"</strong></font>";
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
}
else {
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Logout Faild%>"+"</strong></font>";
if (status.dler_logout) {
alert("<%:Dler Cloud Logout Faild%>: "+status.dler_logout)
}
}
}
btn.disabled = false;
btn.value = '<%:Logout Account%>';
}
);
};
return false;
}
function web_dler(btn)
{
btn.disabled = true;
url='https://bit.ly/32mrABp';
window.open(url);
btn.disabled = false;
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Login Account%>" onclick="return dler_login(this,'dler_login')" />
<input type="button" class="btn cbi-button cbi-button-remove" value="<%:Logout Account%>" onclick="return dler_login(this,'dler_logout')" />
<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Official Website%>" onclick="return web_dler(this)" />
<span id="<%=self.option%>-status"><%=self.value%></span>
<%+cbi/valuefooter%>

File diff suppressed because one or more lines are too long

View File

@ -1,41 +0,0 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function act_download_rule(btn,filename)
{
btn.disabled = true;
btn.value = '<%:Downloading Rule...%> ';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_rule")%>',
{
filename: filename
},
function(x,status)
{
if ( x && x.status == 200 ) {
if(status.rule_download_status=="0")
{
btn.value = '<%:Download Failed%>';
}
else if (status.rule_download_status=="1")
{
btn.value = '<%:Download Successful%>';
}
else if (status.rule_download_status=="2")
{
btn.value = '<%:Rule No Change%>';
}
}
else {
btn.value = '<%:Download Timeout%>';
}
}
);
btn.disabled = false;
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Click to Update%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />
<%+cbi/valuefooter%>

View File

@ -3,15 +3,15 @@
*{margin: 0;padding: 0;}
ul{
list-style: none;
list-style: none;
}
#tab{
width: 100%;
height: 100%;
border: 1px solid #ddd;
box-shadow: 0 0 2px #ddd;
overflow: hidden;
width: 100%;
height: 100%;
border: 1px solid #ddd;
box-shadow: 0 0 2px #ddd;
overflow: hidden;
}
#tab-header {
@ -120,7 +120,7 @@ ul{
}
#tab-content .dom{
display: none;
display: none;
}
#tab-content .dom ul li{
@ -233,66 +233,66 @@ ul{
}
:root[data-darkmode="true"] {
.radio-button {
background: #374151;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15);
}
.radio-button label {
background: #1f2937;
color: #d1d5db;
border-color: #4b5563;
}
.radio-button label:hover {
color: #3b82f6;
border-color: #3b82f6;
background: #22304a;
}
.radio-button input[type="radio"]:checked + label {
background: #3b82f6;
color: #fff;
border-color: #3b82f6;
box-shadow: 0 1px 2px 0 rgba(59,130,246,0.18);
}
.radio-button {
background: #374151;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15);
}
.radio-button label {
background: #1f2937;
color: #d1d5db;
border-color: #4b5563;
}
.radio-button label:hover {
color: #3b82f6;
border-color: #3b82f6;
background: #22304a;
}
.radio-button input[type="radio"]:checked + label {
background: #3b82f6;
color: #fff;
border-color: #3b82f6;
box-shadow: 0 1px 2px 0 rgba(59,130,246,0.18);
}
}
</style>
<body>
<div id="tab" class="cbi-section">
<div id="tab-header">
<ul class="cbi-tabmenu">
<li name="tab-header" class="cbi-tab"><a href="#"><%:OpenClash Log%></a></li>
<li name="tab-header" class="cbi-tab-disabled"><a href="#"><%:Core Log%></a></li>
</ul>
</div>
<div id="tab-content">
<div class="dom" style="display: block;">
<textarea id="cbid.openclash.config.clog" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
</div>
<div class="dom">
<textarea id="core_log" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
<div class="radio-button">
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
<label for="info">Info</label>
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
<label for="warning">Warning</label>
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
<label for="error">Error</label>
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
<label for="debug">Debug</label>
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
<label for="silent">Silent</label>
</div>
</div>
</div>
</div>
<div id="tab" class="cbi-section">
<div id="tab-header">
<ul class="cbi-tabmenu">
<li name="tab-header" class="cbi-tab"><a href="#"><%:OpenClash Log%></a></li>
<li name="tab-header" class="cbi-tab-disabled"><a href="#"><%:Core Log%></a></li>
</ul>
</div>
<div id="tab-content">
<div class="dom" style="display: block;">
<textarea id="cbid.openclash.config.clog" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
</div>
<div class="dom">
<textarea id="core_log" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
<div class="radio-button">
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
<label for="info"><%:Info%></label>
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
<label for="warning"><%:Warning%></label>
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
<label for="error"><%:Error%></label>
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
<label for="debug"><%:Debug%></label>
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
<label for="silent"><%:Silent%></label>
</div>
</div>
</div>
</div>
<fieldset style="text-align: center; width: 100%" class="cbi-section">
<div class="btn-group">
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh%>" onclick=" return stop_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="start_refresh_button" value="<%:Start Refresh%>" onclick=" return start_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="del_log_button" value="<%:Clean%>" onclick=" return del_log() " />
<input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" onclick=" return download_log() " />
</div>
<div class="btn-group">
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh%>" onclick=" return stop_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="start_refresh_button" value="<%:Start Refresh%>" onclick=" return start_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="del_log_button" value="<%:Clean%>" onclick=" return del_log() " />
<input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" onclick=" return download_log() " />
</div>
</fieldset>
</body>
@ -304,46 +304,60 @@ var lv = document.getElementById('cbid.openclash.config.clog');
var cl = document.getElementById('core_log');
var animatingOC = false;
var animatingCore = false;
var coreWebSocket = null;
var coreLogBuffer = [];
var currentLogLevel = 'info';
var wsRetryDelay = 2000;
var wsRetryTimer = null;
var isPolling = false;
var core_refresh = true;
function setLogTab(log_level) {
var radio = document.getElementsByName("radios");
for (i=0; i<radio.length; i++) {
if (radio[i].value == log_level && ! radio[i].checked) {
radio[i].checked = true;
}
}
};
function get_log_level() {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
if (x && x.status == 200 && status.log_level != "") {
var radio = document.getElementsByName("radios");
for (i=0; i<radio.length; i++) {
if (radio[i].value == status.log_level && ! radio[i].checked) {
radio[i].checked = true;
}
}
}
});
s=setTimeout("get_log_level()",5000);
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
if (x && x.status == 200 && status.log_level != "") {
currentLogLevel = status.log_level;
setLogTab(currentLogLevel);
coreLogWebSocket();
}
});
};
function switch_log_level(value)
{
clearTimeout(s);
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
if (x && x.status == 200) {
alert(' <%:Log Level%>: ' + value + ' <%:switching succeeded!%>');
get_log_level();
}
else {
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
get_log_level();
}
});
if (!coreWebSocket || coreWebSocket.readyState !== WebSocket.OPEN) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
if (!x || x.status != 200) {
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
return
}
});
}
currentLogLevel = value;
setLogTab(currentLogLevel);
coreLogWebSocket();
};
function stop_refresh() {
clearTimeout(r);
return
clearTimeout(r);
coreLogWebSocketStop();
return
};
function start_refresh() {
clearTimeout(r);
r=setTimeout("poll_log()",1000*2);
return
clearTimeout(r);
coreLogWebSocket();
r=setTimeout("poll_log()",1000);
return
};
function createAndDownloadFile(fileName, content) {
@ -360,8 +374,8 @@ function download_log(){
var timestamp = dt.getFullYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+"-"+dt.getHours()+"-"+dt.getMinutes()+"-"+dt.getSeconds();
var oc_content = "";
if (typeof oc_editor !== 'undefined' && oc_editor) {
oc_content = oc_editor.getValue();
if (typeof editor_oc !== 'undefined' && editor_oc) {
oc_content = editor_oc.getValue();
} else if (lv && lv.value) {
oc_content = lv.value;
} else if (lv && lv.innerHTML) {
@ -369,8 +383,8 @@ function download_log(){
}
var core_content = "";
if (typeof core_editor !== 'undefined' && core_editor) {
core_content = core_editor.getValue();
if (typeof editor_core !== 'undefined' && editor_core) {
core_content = editor_core.getValue();
} else if (cl && cl.value) {
core_content = cl.value;
} else if (cl && cl.innerHTML) {
@ -378,7 +392,7 @@ function download_log(){
}
oc_content = oc_content.split('\n').filter(function(line) {
return line.indexOf("】订阅的下载链接为【") === -1 && line.indexOf("】Downloading URL【") === -1;
return line.indexOf("】<%:Downloading URL%>【") === -1;
}).join('\n');
if (!oc_content.trim() && !core_content.trim()) {
@ -398,27 +412,136 @@ function download_log(){
};
function del_log() {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
lv.innerHTML="";
cl.innerHTML="";
log_len = 0;
oc_editor.setValue(lv.value);
core_editor.setValue(cl.value);
core_editor.refresh();
oc_editor.refresh();
});
return
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
lv.innerHTML="";
cl.innerHTML="";
coreLogBuffer = [];
log_len = 0;
editor_oc.setValue(lv.value);
editor_core.setValue(cl.value);
editor_core.refresh();
editor_oc.refresh();
});
return
};
function p(s) {
return s < 10 ? '0' + s: s;
return s < 10 ? '0' + s: s;
};
function getWebSocketConnectionInfo(callback) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
if (x && x.status == 200 && status) {
callback(status);
} else {
callback(null);
}
});
}
function coreLogWebSocketStop() {
if (wsRetryTimer) {
clearTimeout(wsRetryTimer);
wsRetryTimer = null;
}
var ws = coreWebSocket;
coreWebSocket = null;
if (!ws) return;
["onopen", "onmessage", "onerror", "onclose"].forEach(function(event) {
try {
ws[event] = null;
} catch (e) {}
});
try {
if (ws.readyState !== WebSocket.CLOSED && ws.readyState !== WebSocket.CLOSING) {
ws.close();
}
} catch (e) {}
coreLogBuffer = [];
}
function coreLogWebSocketRetry() {
wsRetryTimer = setTimeout(function() {
coreLogWebSocket();
}, wsRetryDelay);
}
function coreLogWebSocket() {
coreLogWebSocketStop();
getWebSocketConnectionInfo(function(status) {
if (!status || !status.daip || !status.cn_port || !status.clash) {
return;
}
var protocol = window.location.protocol === "https:" ? "wss://" : "ws://";
var host, port;
if (status.daip && window.location.hostname === status.daip) {
host = status.daip;
port = status.cn_port;
} else if (status.daip && window.location.hostname !== status.daip &&
status.db_foward_domain && status.db_foward_port) {
host = status.db_foward_domain;
port = status.db_foward_port;
} else {
host = status.daip;
port = status.cn_port;
}
var token = status.dase;
var level = currentLogLevel;
var wsUrl = protocol + host + ":" + port + "/logs?token=" + token + "&level=" + level;
try {
coreWebSocket = new WebSocket(wsUrl);
coreWebSocket.onopen = function() {
coreLogBuffer = [];
};
coreWebSocket.onmessage = function(event) {
if (event.data) {
try {
var msgData = JSON.parse(event.data);
if (msgData && msgData.payload) {
var now = new Date();
var timestamp = now.getFullYear() + "-" + p(now.getMonth() + 1) + "-" + p(now.getDate()) + " " +
p(now.getHours()) + ":" + p(now.getMinutes()) + ":" + p(now.getSeconds());
var type = msgData.type || 'info';
var translatedType = levelTranslations[type] || type;
coreLogBuffer.push(timestamp + " [" + translatedType + "] " + msgData.payload);
}
} catch (e) {
coreLogWebSocketRetry();
}
}
};
coreWebSocket.onerror = function(error) {
coreLogWebSocketRetry();
};
coreWebSocket.onclose = function(event) {
coreWebSocket = null;
if (!event.wasClean) {
coreLogWebSocketRetry();
}
};
} catch (e) {
coreLogWebSocketRetry();
}
});
}
function line_tolocal(str) {
var trans_local = new Array();
var local_count = 0;
str.trim().split('\n').forEach(function(v, i) {
var regex = /(time=)"([^"]*)"/g;
var res = regex.exec(v);
@ -428,13 +551,15 @@ function line_tolocal(str) {
var dt = new Date(res[2]);
if (!isNaN(dt.getTime())) {
if (v.indexOf("level=") != -1) {
var log_info = v.substring(res[2].length + 7);
} else {
var log_info = v.substring(res[2].length + 2);
}
trans_local[local_count] = dt.getFullYear() + "-" + p(dt.getMonth() + 1) + "-" + p(dt.getDate()) + " " +
p(dt.getHours()) + ":" + p(dt.getMinutes()) + ":" + p(dt.getSeconds()) + log_info;
var timestamp = dt.getFullYear() + "-" + p(dt.getMonth() + 1) + "-" + p(dt.getDate()) + " " +
p(dt.getHours()) + ":" + p(dt.getMinutes()) + ":" + p(dt.getSeconds());
var levelMatch = v.match(/level=(\w+)/);
var level = levelMatch ? levelMatch[1] : 'info';
var translatedLevel = levelTranslations[level] || level;
var msgMatch = v.match(/msg="(.*)"/);
var msg = msgMatch ? msgMatch[1] : '';
trans_local[local_count] = timestamp + " [" + translatedLevel + "] " + msg;
local_count++;
} else {
trans_local[local_count] = v;
@ -500,7 +625,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
isAtTop = (target.scrollTop < 20);
}
if ((target === oc_editor && animatingOC) || (target === core_editor && animatingCore) || !isActiveTab) {
if ((target === editor_oc && animatingOC) || (target === editor_core && animatingCore) || !isActiveTab) {
var content = "";
var lines = newLines.slice().reverse();
for (var i = 0; i < lines.length; i++) {
@ -557,7 +682,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
return;
}
if (target === oc_editor || target === lv) {
if (target === editor_oc || target === lv) {
animatingOC = true;
} else {
animatingCore = true;
@ -596,7 +721,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
function displayNextBatch() {
if (currentBatchCount >= logLines.length) {
if (target === oc_editor || target === lv) {
if (target === editor_oc || target === lv) {
animatingOC = false;
} else {
animatingCore = false;
@ -661,7 +786,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
if (currentBatchCount < logLines.length) {
setTimeout(displayNextBatch, interval);
} else {
if (target === oc_editor || target === lv) {
if (target === editor_oc || target === lv) {
animatingOC = false;
} else {
animatingCore = false;
@ -691,15 +816,54 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
}
function poll_log(){
var activeTabId = 0;
var titles = document.getElementsByName('tab-header');
var core_logs = [];
var oc_logs = [];
var currentCoreContent = "";
var currentContent = "";
var bufferToProcess = [];
for(var i=0; i<titles.length; i++){
if(titles[i].className === 'cbi-tab') {
activeTabId = i;
break;
}
}
if (coreWebSocket && coreWebSocket.readyState == WebSocket.OPEN) {
if (coreLogBuffer.length > 0) {
core_refresh = false;
bufferToProcess = coreLogBuffer;
coreLogBuffer = [];
core_logs = line_tolocal(bufferToProcess.join('\n'));
if (editor_core) {
currentCoreContent = editor_core.getValue();
smoothlyDisplayLogs(core_logs, editor_core, true, currentCoreContent, activeTabId === 1);
} else if (cl) {
currentCoreContent = cl.innerHTML;
smoothlyDisplayLogs(core_logs, cl, false, currentCoreContent, activeTabId === 1);
}
}
}
if (isPolling) {
r = setTimeout("poll_log()", 1000);
return;
}
isPolling = true;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "refresh_log")%>',
{
log_len: log_len
log_len: log_len, core_refresh: core_refresh
},
function(x, status) {
if (x && x.status == 200) {
if (status) {
if (!status.update) {
r = setTimeout("poll_log()", 2000);
isPolling = false;
r = setTimeout("poll_log()", 1000);
return;
}
@ -707,45 +871,37 @@ function poll_log(){
log_len = status.len;
}
var activeTabId = 0;
var titles = document.getElementsByName('tab-header');
for(var i=0; i<titles.length; i++){
if(titles[i].className === 'cbi-tab') {
activeTabId = i;
break;
}
}
if (status.oc_log && status.oc_log !== "") {
var oc_logs = line_tolocal(status.oc_log);
oc_logs = line_tolocal(status.oc_log);
if (oc_logs && oc_logs.length > 0) {
if (oc_editor) {
var currentContent = oc_editor.getValue();
smoothlyDisplayLogs(oc_logs, oc_editor, true, currentContent, activeTabId === 0);
if (oc_logs.length > 0) {
if (editor_oc) {
currentContent = editor_oc.getValue();
smoothlyDisplayLogs(oc_logs, editor_oc, true, currentContent, activeTabId === 0);
} else if (lv) {
var currentContent = lv.innerHTML;
currentContent = lv.innerHTML;
smoothlyDisplayLogs(oc_logs, lv, false, currentContent, activeTabId === 0);
}
}
}
if (status.core_log && status.core_log !== "") {
var core_logs = line_tolocal(status.core_log);
core_logs = line_tolocal(status.core_log);
if (core_logs && core_logs.length > 0) {
if (core_editor) {
var currentCoreContent = core_editor.getValue();
smoothlyDisplayLogs(core_logs, core_editor, true, currentCoreContent, activeTabId === 1);
if (core_logs.length > 0) {
if (editor_core) {
currentCoreContent = editor_core.getValue();
smoothlyDisplayLogs(core_logs, editor_core, true, currentCoreContent, activeTabId === 1);
} else if (cl) {
var currentCoreContent = cl.innerHTML;
currentCoreContent = cl.innerHTML;
smoothlyDisplayLogs(core_logs, cl, false, currentCoreContent, activeTabId === 1);
}
}
}
}
}
r = setTimeout("poll_log()", 2000);
isPolling = false;
r = setTimeout("poll_log()", 1000);
}
);
};
@ -767,13 +923,13 @@ window.onload = function(){
tab.className = 'cbi-tab';
divs[tab.id].style.display = 'block';
if(tab.id == 0 && typeof oc_editor !== 'undefined') {
if(tab.id == 0 && typeof editor_oc !== 'undefined') {
setTimeout(function(){
oc_editor.refresh();
editor_oc.refresh();
}, 10);
} else if(tab.id == 1 && typeof core_editor !== 'undefined') {
} else if(tab.id == 1 && typeof editor_core !== 'undefined') {
setTimeout(function(){
core_editor.refresh();
editor_core.refresh();
}, 10);
}
};

View File

@ -1,7 +0,0 @@
<%+cbi/valueheader%>
<% if self:cfgvalue(section) ~= false then %>
<input class="btn cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
<% else %>
-
<% end %>
<%+cbi/valuefooter%>

View File

@ -25,7 +25,7 @@ function act_manual_unlock_test_<%=stream_id_name%>(btn, type)
{
manual_<%=stream_id_name%>_type_legend.style.display = 'none';
manual_<%=stream_id_name%>_type_output.innerHTML = '<textarea id="manual_<%=stream_id_name%>_type_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
other_log_area(document.getElementById("manual_<%=stream_id_name%>_type_output"), 'true', manual_<%=stream_id_name%>_type_output.offsetWidth, '250px');
log_area(document.getElementById("manual_<%=stream_id_name%>_type_output"), 'manual_stream_unlock_test', 'true', manual_<%=stream_id_name%>_type_output.offsetWidth, '250px');
}
else
{
@ -58,7 +58,7 @@ function act_all_proxies_test_<%=stream_id_name%>(btn, type)
{
all_<%=stream_id_name%>_legend.style.display = 'none';
all_<%=stream_id_name%>_output.innerHTML = '<textarea id="all_<%=stream_id_name%>_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
other_log_area(document.getElementById("all_<%=stream_id_name%>_output"), 'true', all_<%=stream_id_name%>_output.offsetWidth, '250px');
log_editor(document.getElementById("all_<%=stream_id_name%>_output"), 'all_proxies_stream_test', true, all_<%=stream_id_name%>_output.offsetWidth, '250px');
}
else
{

View File

@ -14,6 +14,9 @@
--success-dark: #047857;
--warning-color: #f59e0b;
--error-color: #dc2626;
--tip-color: #f9bb51;
--info-color: #2563eb;
--watchdog-color: #b300ff;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--radius-sm: 6px;
@ -40,6 +43,11 @@
--primary-color: #3b82f6;
--success-color: #34d399;
--success-dark: #10b981;
--error-color: #ff7070;
--tip-color: #f9bb51;
--warning-color: #fa41c8;
--watchdog-color: #c147f5;
--info-color: #2563eb;
}
.oc * {
@ -204,8 +212,8 @@
padding: 8px 32px 8px 12px;
border: 1px solid var(--border-light);
border-radius: var(--radius-sm);
background: var(--bg-white);
color: var(--text-primary);
background: var(--bg-white) !important;
color: var(--text-primary) !important;
font-size: 13px;
appearance: none;
cursor: pointer;
@ -640,22 +648,22 @@
var smart_enable_cdn = document.getElementById('SMART_ENABLE_CDN');
function initDarkMode() {
var ocContainer = document.querySelector('.oc');
if (!ocContainer) return;
var ocContainers = document.querySelectorAll('.oc');
if (!ocContainers.length) return;
var shouldUseDark = isDarkBackground(document.body);
if (shouldUseDark) {
ocContainer.setAttribute('data-darkmode', 'true');
} else {
ocContainer.removeAttribute('data-darkmode');
}
ocContainers.forEach(function(ocContainer) {
if (shouldUseDark) {
ocContainer.setAttribute('data-darkmode', 'true');
document.documentElement.setAttribute('data-darkmode', 'true');
} else {
ocContainer.removeAttribute('data-darkmode');
document.documentElement.removeAttribute('data-darkmode');
}
});
}
document.addEventListener('DOMContentLoaded', function() {
initDarkMode();
});
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initDarkMode);
} else {

View File

@ -14,10 +14,11 @@
--primary-color: #3b82f6;
--success-color: #059669;
--success-dark: #047857;
--warning-color: #f59e0b;
--tip-color: #f59e0b;
--error-color: #dc2626;
--warning-log: #ff00bb;
--watch-log: #b300ff;
--warning-color: #ff00bb;
--watchdog-color: #b300ff;
--info-color: #3b82f6;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--radius-sm: 6px;
@ -50,9 +51,10 @@
--success-color: #34d399;
--success-dark: #10b981;
--error-color: #ff7070;
--warning-color: #f9bb51;
--warning-log: #fa41c8;
--watch-log: #c147f5;
--tip-color: #f9bb51;
--warning-color: #fa41c8;
--watchdog-color: #c147f5;
--info-color: #3b82f6;
}
.oc[data-darkmode="true"] .plugin-toggle-slider {
@ -94,7 +96,7 @@
}
.oc[data-darkmode="true"] .subscription-progress-fill.medium {
background: var(--warning-color);
background: var(--tip-color);
}
.oc[data-darkmode="true"] .subscription-progress-fill.low {
@ -942,7 +944,7 @@
}
.oc .subscription-progress-fill.medium {
background: var(--warning-color);
background: var(--tip-color);
}
.oc .subscription-progress-fill.low {
@ -2248,14 +2250,10 @@
DISCONNECTED: 2,
ERROR: 3
},
retryAttempts: {},
maxRetries: 3,
reconnectDelay: 2000,
reconnectDelay: 5000,
heartbeatInterval: 30000,
heartbeatTimers: {},
_ws_connect: false,
_ws_error: false,
_ws_retry: 0,
_allowedCloseCodes: [1000, 1001, 1005, 1006],
isSupported: function() {
@ -2284,8 +2282,6 @@
options: options
};
this.retryAttempts[type] = 0;
if (ws.addEventListener) {
ws.addEventListener('open', this.handleOpen.bind(this, type));
ws.addEventListener('message', this.handleMessage.bind(this, type));
@ -2362,8 +2358,6 @@
this.closeConnection(types[i]);
}
this._ws_connect = false;
this._ws_error = false;
this._ws_retry = 0;
},
handleMessage: function(type, event) {
@ -2389,13 +2383,13 @@
connection.state = this.connectionStates.CONNECTED;
connection.lastActivity = Date.now();
}
this.retryAttempts[type] = 0;
this.startHeartbeat(type);
if (type === 'traffic' || Object.keys(this.connections).length === 3) {
if (Object.keys(this.connections).length === 3) {
this._ws_connect = true;
this._ws_error = false;
this._ws_retry = 0;
if (NetworkStatsManager.isEnabled) {
NetworkStatsManager.stop();
}
}
},
@ -2404,15 +2398,14 @@
if (connection) {
connection.state = this.connectionStates.ERROR;
}
this._ws_error = true;
this.stopHeartbeat(type);
if (type === 'traffic') {
this.enableFallbackMode();
}
this.enableFallbackMode();
},
handleClose: function(type, event) {
// if not connected, start log display because core maybe restart
LogManager.startLogDisplay();
var connection = this.connections[type];
if (connection) {
connection.state = this.connectionStates.DISCONNECTED;
@ -2429,7 +2422,6 @@
if (connection) {
connection.state = this.connectionStates.ERROR;
}
this._ws_error = true;
this.enableFallbackMode();
},
@ -2437,25 +2429,22 @@
var self = this;
var connection = this.connections[type];
if (!connection || this.retryAttempts[type] >= this.maxRetries) {
if (!connection) {
this.enableFallbackMode();
return;
}
this.retryAttempts[type] = (this.retryAttempts[type] || 0) + 1;
var delay = this.reconnectDelay * Math.pow(1.5, this.retryAttempts[type] - 1);
setTimeout(function() {
if (self.connections[type] && self.connections[type].state !== self.connectionStates.CONNECTED) {
self.createConnection(type, connection.url, connection.messageHandler, connection.options);
}
}, delay);
}, this.reconnectDelay);
},
enableFallbackMode: function() {
this._ws_connect = false;
this.closeAll();
if (typeof NetworkStatsManager !== "undefined" && !NetworkStatsManager.isEnabled) {
if (!NetworkStatsManager.isEnabled) {
NetworkStatsManager.start();
}
},
@ -2480,14 +2469,6 @@
}
}
return false;
},
resetRetryCount: function(type) {
if (type) {
this.retryAttempts[type] = 0;
} else {
this.retryAttempts = {};
}
}
};
@ -2575,7 +2556,7 @@
this.updateSubscriptionDisplay(currentConfigFile, currentFileInfo);
if (currentConfigFile && SubscriptionManager.currentConfigFile !== currentConfigFile) {
if (SubscriptionManager.currentConfigFile !== currentConfigFile) {
SubscriptionManager.currentConfigFile = currentConfigFile;
SubscriptionManager.getSubscriptionInfo();
}
@ -2967,7 +2948,7 @@
loadSubscriptionInfo: function() {
var currentConfig = ConfigFileManager.getCurrentConfig() || ConfigFileManager.getSelectedConfig();
if (currentConfig && currentConfig !== this.currentConfigFile) {
if (currentConfig !== this.currentConfigFile) {
this.currentConfigFile = currentConfig;
this.getSubscriptionInfo();
}
@ -3376,7 +3357,6 @@
},
bindEvents: function() {
var self = this;
var textarea = document.getElementById('subscription-url-textarea');
var overlay = document.getElementById('subscription-url-overlay');
@ -3444,24 +3424,38 @@
});
},
handleSubURL: function(urlresult) {
var textarea = document.getElementById('subscription-url-textarea');
if (!textarea) return;
var urls = '';
if (urlresult.type && urlresult.type === "multiple") {
for (var data in urlresult.providers) {
urls += urlresult.providers[data].url + '#name=' + urlresult.providers[data].name + '\n';
}
}
if (urlresult.type && urlresult.type === "single") {
urls = urlresult.url;
}
textarea.value = urls;
},
loadUrls: function() {
var self = this;
var existingData = localStorage.getItem('sub_info_' + this.filename);
if (existingData) {
existingData = JSON.parse(existingData);
if (existingData.url_result) {
this.handleSubURL(existingData.url_result);
return;
}
};
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_subscribe_info_data")%>', {
filename: this.filename
}, function(x, status) {
if (x && x.status == 200 && status) {
var textarea = document.getElementById('subscription-url-textarea');
if (textarea) {
var urls = '';
if (status.url) {
if (typeof status.url === 'string') {
urls = status.url;
} else if (Array.isArray(status.url)) {
urls = status.url.join('\n');
}
}
textarea.value = urls;
}
self.handleSubURL(status);
}
});
}
@ -3489,9 +3483,9 @@
StateManager.clearCache('<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>');
if (DOMCache.oclog) {
if (DOMCache.oclog && initialMessage) {
DOMCache.oclog.style.display = 'inline-flex';
DOMCache.oclog.innerHTML = '<b style="color:var(--warning-color)">' + (initialMessage || '<%:Processing...%>') + '</b>';
DOMCache.oclog.innerHTML = '<b style="color:var(--tip-color)">' + initialMessage + '</b>';
}
this.isPolling = true;
@ -3591,17 +3585,11 @@
checkForErrors: function(log) {
if (!log) return false;
if (log.match(/level=fatal|level=error|FTL \[Config]/)) {
if (log.match(/level=(fatal|error)/)) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
var errorMsg;
if (log.match(/level=(fatal|error)/)) {
var msgParts = log.split('msg=');
errorMsg = msgParts.length > 1 ? msgParts[1].replace(/"/g, '') : log;
} else { // FTL [Config]
var ftlParts = log.split('FTL [Config] ');
errorMsg = ftlParts.length > 1 ? ftlParts[1] : log;
}
var msgParts = log.split('msg=');
var errorMsg = msgParts.length > 1 ? msgParts[1].replace(/"/g, '') : log;
setTimeout(function() {
alert('<%:OpenClash Start Failed%>:\n\n' + errorMsg);
@ -3621,6 +3609,7 @@
var color = this.getLogColor(cleanLog);
var displayText = this.formatLogText(cleanLog);
DOMCache.oclog.style.display = 'inline-flex';
DOMCache.oclog.innerHTML = '<b style="color:' + color + '">' + displayText + '</b>';
},
@ -3629,19 +3618,13 @@
},
getLogColor: function(log) {
if (log.includes("Tip:") || log.includes("提示:")) {
return 'var(--warning-color)';
} else if (log.includes("Error:") || log.includes("错误:") || log.includes("level=error")) {
return 'var(--error-color)';
} else if (log.includes("Warning:") || log.includes("警告:") || log.includes("level=warning")) {
return 'var(--warning-log)';
} else if (log.includes("Watchdog:") || log.includes("守护程序:")) {
return 'var(--watch-log)';
} else if (log.match(/level=info|Success|Started|Ready/)) {
return 'var(--success-color)';
} else {
return 'var(--text-secondary)';
for (var levelKey in window.levelTranslations) {
var translatedText = '[' + window.levelTranslations[levelKey] + ']';
if (log.includes(translatedText)) {
return "var(--" + levelKey + "-color)";
}
}
return "var(--info-color)";
},
formatLogText: function(log) {
@ -3695,12 +3678,12 @@
StateManager.cachedXHRGet('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', function(x, status) {
if (x && x.status == 200 && x.responseText != "") {
self.retryCount = 0;
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--warning-color)" : "var(--error-color)");
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--tip-color)" : "var(--error-color)");
var cpuValue = status.cpu <= 100 ? status.cpu + " %" : "0 %";
document.getElementById("cpu_t").innerHTML = "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>";
var loadValue = parseFloat(status.load_avg) || 0;
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--warning-color)" : "var(--error-color)");
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--tip-color)" : "var(--error-color)");
document.getElementById("load_a").innerHTML = "<font style=\"color:"+loadColor+"\">"+status.load_avg+" %</font>";
} else {
self.handleError();
@ -3782,12 +3765,12 @@
];
if (!SystemStatusManager.isEnabled) {
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--warning-color)" : "var(--error-color)");
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--tip-color)" : "var(--error-color)");
var cpuValue = status.cpu <= 100 ? status.cpu + " %" : "0 %";
updates.push({element: document.getElementById("cpu_t"), content: "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>"});
var loadValue = parseFloat(status.load_avg) || 0;
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--warning-color)" : "var(--error-color)");
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--tip-color)" : "var(--error-color)");
updates.push({element: document.getElementById("load_a"), content: "<font style=\"color:"+loadColor+"\">"+status.load_avg+" %</font>"});
}
@ -4143,19 +4126,13 @@
if (status.clash && status.daip) {
if (!WSManager.hasActiveConnections()) {
if (!WSManager._ws_error || WSManager._ws_retry < 3) {
if (initializeWebSocketConnections(status)) {
WSManager._ws_retry++;
}
} else {
WSManager.enableFallbackMode();
}
initializeWebSocketConnections(status);
} else {
if (NetworkStatsManager && NetworkStatsManager.isEnabled) {
if (NetworkStatsManager.isEnabled) {
NetworkStatsManager.stop();
}
if (SystemStatusManager && !SystemStatusManager.isEnabled) {
if (!SystemStatusManager.isEnabled) {
SystemStatusManager.start();
}
}
@ -4232,14 +4209,14 @@
var isChineseUser = userLang.indexOf('zh') === 0;
var tips = [
'<%:Tip: You can modify the profile on the profile page (for content that is not taken over)%>',
'<%:Tip: do not write configuration files? Try to create one click on the server page%>',
'<%:Tip: some website are abnormal? Try switching modes or using third-party rules%>',
'<%:Tip: using the fake IP mode can get a faster access experience%>',
'<%:Tip: the nameserver group must have at least one server set when using custom DNS%>',
'<%:Tip: after started, please wait patiently until the connection is normal%>',
'<%:Tip: if you don not use IPv6, please turn off the DHCP service of IPv6, otherwise the connection will be abnormal%>',
'<%:Tip: you can update the version in the settings page%>',
'<%:You can modify the profile on the profile page (for content that is not taken over)%>',
'<%:do not write configuration files? Try to create one click on the server page%>',
'<%:some website are abnormal? Try switching modes or using third-party rules%>',
'<%:using the fake IP mode can get a faster access experience%>',
'<%:the nameserver group must have at least one server set when using custom DNS%>',
'<%:after started, please wait patiently until the connection is normal%>',
'<%:if you don not use IPv6, please turn off the DHCP service of IPv6, otherwise the connection will be abnormal%>',
'<%:you can update the version in the settings page%>',
'<%:Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it%>',
'<%:Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off%>',
'<%:Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check%>',
@ -4505,12 +4482,6 @@
}
}
function ws_terror() {
WSManager._ws_error = true;
NetworkStatsManager.start();
}
function ws_tmessage(event) {
var dataObj = event && event.data !== undefined ? event.data : event;
var data;
@ -4938,7 +4909,7 @@
}
});
return false;
}
}
function copySecret() {
var secret = StateManager.current_status.dase || '';
@ -4969,6 +4940,10 @@
var mixPort = StateManager.cached_proxy_info.mixed_port || '7893';
var proxyIp = StateManager.current_status.daip;
var proxyText = proxyIp + ':' + mixPort;
if (StateManager.cached_proxy_info.auth_user && StateManager.cached_proxy_info.auth_pass) {
proxyText = StateManager.cached_proxy_info.auth_user + ':' + StateManager.cached_proxy_info.auth_pass + '@' + proxyText;
}
proxyText = 'http://' + proxyText;
copyToClipboard(proxyText, '<%:Mix proxy address copied:%> ');
} else {
alert('<%:Proxy info not available, please try again later%>');
@ -5062,13 +5037,8 @@
client_href: currentUrl.href
}, function(x, data) {
if (x && x.status == 200 && data.pac_url) {
if (data.error && data.error.indexOf("warning:") === 0) {
var warningMsg = data.error.replace("warning: ", "");
var warningTranslations = {
'No authentication configured, please be aware of the risk of information leakage!': '<%:No authentication configured, please be aware of the risk of information leakage!%>'
};
var translatedWarning = warningTranslations[warningMsg] || warningMsg;
alert('<%:Warning:%> ' + translatedWarning);
if (data.error && data.error !== "") {
alert(data.error);
}
copyToClipboard(data.pac_url, '<%:PAC file URL copied:%> ');
} else if (data.error) {
@ -5392,11 +5362,11 @@
filename: filename
}, function(x, status) {
if (x.status == 200) {
if (typeof ConfigUploader !== 'undefined' && ConfigUploader.showEditSubscribe) {
if (ConfigUploader && ConfigUploader.showEditSubscribe) {
ConfigUploader.showEditSubscribe(status, filename);
} else {
setTimeout(function() {
if (typeof ConfigUploader !== 'undefined' && ConfigUploader.showEditSubscribe) {
if (ConfigUploader && ConfigUploader.showEditSubscribe) {
ConfigUploader.showEditSubscribe(status, filename);
} else {
alert('<%:Config editor not ready, please try again%>');
@ -5418,11 +5388,11 @@
return false;
}
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.show) {
if (ConfigEditor.show) {
ConfigEditor.show(currentConfig);
} else {
setTimeout(function() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.show) {
if (ConfigEditor.show) {
ConfigEditor.show(currentConfig);
} else {
alert('<%:Config editor not ready, please try again%>');
@ -5434,11 +5404,11 @@
}
function editOverwrite() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.showOverwrite) {
if (ConfigEditor.showOverwrite) {
ConfigEditor.showOverwrite();
} else {
setTimeout(function() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.showOverwrite) {
if (ConfigEditor.showOverwrite) {
ConfigEditor.showOverwrite();
} else {
alert('<%:Config editor not ready, please try again%>');

View File

@ -55,15 +55,20 @@
line-height: 0;
flex-shrink: 0;
cursor: pointer;
background-color: unset;
border: unset;
}
.sub_setting img {
.sub_setting svg {
vertical-align: middle;
display: inline-block;
transition: opacity 0.3s ease;
width: 18px;
height: 18px;
color: #414c5c;
padding-left: 2px;
}
.sub_setting:hover img {
.sub_setting:hover svg {
opacity: 0.7;
}
@ -95,14 +100,147 @@
background-color: #ffb9b9;
}
:root[data-darkmode="true"] #icon_wrench {
-webkit-filter: invert(1);
filter: invert(1);
.sub-info-url-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(2px);
}
:root[data-darkmode="true"] #icon_arrow {
-webkit-filter: invert(1);
filter: invert(1);
.sub-info-url-model {
background: var(--bg-white, white);
border-radius: var(--radius-lg, 8px);
box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
width: 90vw;
max-width: 550px;
min-width: 400px;
display: flex;
flex-direction: column;
overflow: hidden;
border: 1px solid var(--border-light, #e5e7eb);
max-height: 85vh;
transition: all var(--transition-fast, 0.2s);
}
.sub-info-url-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
border-bottom: 1px solid var(--border-light, #e5e7eb);
background: var(--bg-gray, #f9fafb);
flex-shrink: 0;
}
.sub-info-url-title {
font-size: 16px;
font-weight: 600;
color: var(--text-primary, #1f2937);
}
.sub-info-url-footer {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 20px;
border-top: 1px solid var(--border-light, #e5e7eb);
background: var(--bg-gray, #f9fafb);
flex-shrink: 0;
gap: 12px;
}
.sub-info-url-content {
padding: 24px;
flex: 1;
overflow-y: auto;
}
.sub-info-url-form-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.sub-info-url-form-group label {
font-size: 14px;
font-weight: 500;
color: var(--text-primary, #1f2937);
}
.sub-info-url-form-textarea {
width: 100%;
min-height: 120px;
padding: 10px 12px;
border: 1px solid var(--border-light, #e5e7eb);
border-radius: var(--radius-sm, 4px);
background: var(--bg-white, white);
color: var(--text-primary, #1f2937);
font-size: 14px;
font-family: inherit;
resize: vertical;
transition: all var(--transition-fast, 0.2s);
box-sizing: border-box;
}
.sub-info-url-form-textarea:focus {
outline: none;
border-color: var(--primary-color, #3b82f6);
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.sub-info-url-form-textarea::placeholder {
color: var(--text-secondary, #6b7280);
}
.sub-info-url-btn {
padding: 8px 16px;
border: 1px solid var(--border-light, #e5e7eb);
border-radius: var(--radius-sm, 4px);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all var(--transition-fast, 0.2s);
white-space: nowrap;
}
.sub-info-url-cancel-btn {
background: var(--bg-white, white);
color: var(--text-secondary, #6b7280);
border-color: var(--border-light, #e5e7eb);
}
.sub-info-url-cancel-btn:hover {
background: var(--hover-bg, #f3f4f6);
color: var(--text-primary, #1f2937);
}
.sub-info-url-submit-btn {
background: var(--primary-color, #3b82f6);
color: white;
border-color: var(--primary-color, #3b82f6);
}
.sub-info-url-submit-btn:hover:not(:disabled) {
background: var(--primary-color, #3b82f6);
opacity: 0.9;
}
.sub-info-url-submit-btn:disabled {
background: var(--bg-gray, #f9fafb);
color: var(--text-secondary, #6b7280);
border-color: var(--border-light, #e5e7eb);
cursor: not-allowed;
}
:root[data-darkmode="true"] .sub_setting svg {
color: #e0e0e0;
}
:root[data-darkmode="true"] .text_show {
@ -127,6 +265,62 @@
background-color: #cc6262;
}
:root[data-darkmode="true"] .sub-info-url-model {
background: var(--bg-white, #1f2937);
border-color: var(--border-light, #374151);
}
:root[data-darkmode="true"] .sub-info-url-header,
:root[data-darkmode="true"] .sub-info-url-footer {
background: var(--bg-gray, #111827);
border-color: var(--border-light, #374151);
}
:root[data-darkmode="true"] .sub-info-url-title {
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-form-group label {
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-form-textarea {
background: var(--bg-gray, #374151);
border-color: var(--border-light, #4b5563);
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-form-textarea:focus {
border-color: var(--primary-color, #60a5fa);
box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
}
:root[data-darkmode="true"] .sub-info-url-form-textarea::placeholder {
color: var(--text-secondary, #9ca3af);
}
:root[data-darkmode="true"] .sub-info-url-cancel-btn {
background: var(--bg-white, #374151);
color: var(--text-secondary, #9ca3af);
border-color: var(--border-light, #4b5563);
}
:root[data-darkmode="true"] .sub-info-url-cancel-btn:hover {
background: var(--hover-bg, #4b5563);
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-submit-btn {
background: var(--primary-color, #3b82f6);
border-color: var(--primary-color, #3b82f6);
}
:root[data-darkmode="true"] .sub-info-url-submit-btn:disabled {
background: var(--bg-gray, #4b5563);
color: var(--text-secondary, #9ca3af);
border-color: var(--border-light, #374151);
}
@media (max-width: 1024px) {
.sub_tab, .sub_tab_show {
font-size: 11px;
@ -152,10 +346,6 @@
min-width: 200px;
}
.sub_setting img {
height: 18px !important;
}
.sub_div {
gap: 4px;
width: calc(100% - 16px);
@ -172,10 +362,6 @@
min-width: 180px !important;
}
.sub_setting img {
height: 16px !important;
}
.sub_div {
gap: 2px;
width: calc(100% - 12px);
@ -192,24 +378,12 @@
min-width: 160px !important;
}
.sub_setting img {
height: 14px !important;
}
.sub_div {
width: calc(100% - 8px);
margin: 0 4px;
}
}
.sub_div * {
flex-shrink: 0;
}
.sub_div > span:first-child {
flex-shrink: 1;
}
/* Multiple providers container */
.sub_providers_container {
display: flex;
@ -272,18 +446,6 @@
border-radius: 5px;
}
.sub_provider_fill.progress_bar_high {
background-color: #9edd9e;
}
.sub_provider_fill.progress_bar_medium {
background-color: #ffc99f;
}
.sub_provider_fill.progress_bar_low {
background-color: #ffb9b9;
}
.sub_provider_name {
position: relative;
z-index: 1;
@ -304,18 +466,6 @@
border-color: #666666;
}
:root[data-darkmode="true"] .sub_provider_fill.progress_bar_high {
background-color: #5da05d;
}
:root[data-darkmode="true"] .sub_provider_fill.progress_bar_medium {
background-color: #cc8550;
}
:root[data-darkmode="true"] .sub_provider_fill.progress_bar_low {
background-color: #cc6262;
}
:root[data-darkmode="true"] .sub_provider_name {
color: #e0e0e0;
}
@ -383,12 +533,20 @@
<div class="sub_div">
<span id='<%=idname%>' class="sub_tab"></span>
<span class="sub_setting">
<img id="icon_arrow" src='/luci-static/resources/openclash/img/arrow-clockwise-light.svg' height="20px" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'>
</span>
<span class="sub_setting">
<img id="icon_wrench" src='/luci-static/resources/openclash/img/wrench-light.svg' height="20px" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'>
</span>
<button type="button" class="sub_setting" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M23 4v6h-6"></path>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
</svg>
</button>
<button type="button" class="sub_setting" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'>
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="4">
<path d="M4 6H44V36H29L24 41L19 36H4V6Z"/>
<path d="M23 21H25.0025" />
<path d="M33.001 21H34.9999"/>
<path d="M13.001 21H14.9999"/>
</svg>
</button>
</div>
<script type="text/javascript">//<![CDATA[
@ -398,10 +556,21 @@ var s_<%=idname%>;
sub_info_get_<%=idname%>();
setTimeout(function(){
initDarkMode();
}, 200);
function initDarkMode() {
if (typeof isDarkBackground === 'undefined') {
setTimeout(function() {
initDarkMode();
}, 100);
return;
}
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
}, 300);
}
}
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
var screenWidth = window.innerWidth || document.documentElement.clientWidth;
@ -588,14 +757,12 @@ function sub_info_refresh_<%=idname%>()
(status.day_left)
);
}
}
else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
} else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
retry_<%=idname%> = 0;
localStorage.setItem("sub_info_<%=filename%>",JSON.stringify(status));
document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
}
else {
} else {
if (document.getElementById('<%=idname%>').innerHTML == "" || retry_<%=idname%> > 2) {
document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>";
@ -603,13 +770,11 @@ function sub_info_refresh_<%=idname%>()
if (retry_<%=idname%> > 2) {
retry_<%=idname%> = 0;
localStorage.removeItem("sub_info_<%=filename%>");
}
else {
} else {
retry_<%=idname%> ++;
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*120);
return
}
};
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*1800);
});
@ -657,29 +822,113 @@ function sub_info_get_<%=idname%>()
};
function set_subinfo_url_<%=idname%>(btn, filename) {
var new_url = prompt("<%:Paste the new url of subscribe infos sources here:%>", "");
if (filename == null || filename == "") {
return false;
}
if (new_url == null) {
return false;
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "set_subinfo_url")%>', {filename: filename, url: new_url}, function(x, status) {
if (x && x.status == 200 && status.info == "Success")
{
sub_info_refresh_<%=idname%>();
alert("<%:Specify subscribe infos sources url successfully!%>");
}
else if (x && x.status == 200 && status.info == "Delete success")
{
sub_info_refresh_<%=idname%>();
alert("<%:Delete Specify Subscribe infos sources url successfully!%>");
}
else
{
alert("<%:Specify subscribe infos sources url failed:%>\n" + status.info);
}
});
if (filename == null || filename == "") {
return false;
}
var dialogDiv = document.createElement('div');
dialogDiv.className = 'sub-info-url-overlay';
var contentDiv = document.createElement('div');
contentDiv.className = 'sub-info-url-model';
var headerDiv = document.createElement('div');
headerDiv.className = 'sub-info-url-header';
var titleDiv = document.createElement('div');
titleDiv.className = 'sub-info-url-title';
titleDiv.innerHTML = '<%:Paste the new url of subscribe infos sources here:%>';
headerDiv.appendChild(titleDiv);
var bodyDiv = document.createElement('div');
bodyDiv.className = 'sub-info-url-content';
var formGroup = document.createElement('div');
formGroup.className = 'sub-info-url-form-group';
var textarea = document.createElement('textarea');
textarea.className = 'sub-info-url-form-textarea';
textarea.placeholder = '<%:Enter URLs, one per line, use #name=example end for specifing display name%> (https://example.com#name=example)';
formGroup.appendChild(textarea);
bodyDiv.appendChild(formGroup);
var footerDiv = document.createElement('div');
footerDiv.className = 'sub-info-url-footer';
var cancelBtn = document.createElement('button');
cancelBtn.className = 'sub-info-url-btn sub-info-url-cancel-btn';
cancelBtn.type = 'button';
cancelBtn.innerHTML = '<%:Cancel%>';
var confirmBtn = document.createElement('button');
confirmBtn.className = 'sub-info-url-btn sub-info-url-submit-btn';
confirmBtn.type = 'button';
confirmBtn.innerHTML = '<%:Submit%>';
confirmBtn.onclick = function() {
var new_url = textarea.value.trim();
document.body.removeChild(dialogDiv);
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "set_subinfo_url")%>', {filename: filename, url: new_url}, function(x, status) {
if (x && x.status == 200 && status.info == "Success") {
sub_info_refresh_<%=idname%>();
alert("<%:Specify subscribe infos sources url successfully!%>");
}
else if (x && x.status == 200 && status.info == "Delete success") {
sub_info_refresh_<%=idname%>();
alert("<%:Delete Specify Subscribe infos sources url successfully!%>");
}
else {
alert("<%:Specify subscribe infos sources url failed:%>\n" + status.info);
}
});
};
cancelBtn.onclick = function() {
document.body.removeChild(dialogDiv);
};
footerDiv.appendChild(cancelBtn);
footerDiv.appendChild(confirmBtn);
contentDiv.appendChild(headerDiv);
contentDiv.appendChild(bodyDiv);
contentDiv.appendChild(footerDiv);
dialogDiv.appendChild(contentDiv);
document.body.appendChild(dialogDiv);
textarea.focus();
var handleSubURL = function(urlresult) {
var urls = '';
if (urlresult.type && urlresult.type === "multiple") {
for (var data in urlresult.providers) {
urls += urlresult.providers[data].url + '#name=' + urlresult.providers[data].name + '\n';
}
}
if (urlresult.type && urlresult.type === "single") {
urls = urlresult.url;
}
textarea.value = urls;
};
var existingData = localStorage.getItem('sub_info_' + filename);
if (existingData) {
existingData = JSON.parse(existingData);
if (existingData.url_result) {
handleSubURL(existingData.url_result);
return;
}
};
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_subscribe_info_data")%>', {
filename: filename
}, function(x, status) {
if (x && x.status == 200 && status) {
handleSubURL(status);
}
});
};
//]]></script>

View File

@ -56,7 +56,7 @@
btn.value = '<%:Downloading File...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_dashboard")%>', {name: name, type : type}, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.download_state == "1" ) {
if ( status.download_state == "0" ) {
if ( type == "Meta" ) {
if ( name == "Dashboard" ) {
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Official Version%>" onclick="return switch_dashboard(this, \'Dashboard\', \'Official\')"/>';

View File

@ -33,23 +33,32 @@ end
local a={}
local e={}
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(o)
if a then
e[t]={}
e[t].name=fs.basename(o)
if self.sectiontype == "dns_servers" then
table.insert(e, {name="nameserver", title="nameserver"})
table.insert(e, {name="fallback", title="fallback"})
table.insert(e, {name="default", title="default-nameserver"})
else
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(o)
if a then
e[t]={}
e[t].name=fs.basename(o)
end
end
if not table_include(e, "all") then
table.insert(e, 1, {name="all"})
end
end
if not table_include(e, "all") then
table.insert(e, 1, {name="all"})
end
local cfg_name
if uci:get("openclash", "config", "config_path") then
if os.getenv("PATH_INFO") then
local cfg_path = string.match(os.getenv("PATH_INFO"), "/config/(.+)$")
cfg_name = cfg_path and string.match(cfg_path, "([^/]+)$") or nil
end
if not cfg_name and uci:get("openclash", "config", "config_path") then
cfg_name = fs.basename(uci:get("openclash", "config", "config_path"))
end
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype"
-%>
@ -96,13 +105,14 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
flex: 1 1 0;
min-width: 120px;
max-width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 0;
height: 40px;
font-size: 12px;
height: 100%;
font-size: 13px;
font-weight: 400;
color: #64748b;
background: transparent;
@ -128,7 +138,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
display: block;
width: 100%;
height: 130%;
height: 100%;
text-align: center;
text-decoration: none;
background: none;
@ -232,9 +242,9 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
<!-- tblsection -->
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title and #self.title > 0 then -%>
<legend><%=self.title%></legend>
<%- end %>
<%- if self.title and #self.title > 0 then -%>
<h3><%=self.title%></h3>
<%- end -%>
<%- if self.sortable then -%>
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%>
@ -243,98 +253,119 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
<ul class="cbi-tabmenu">
<%-
if #e ~= 1 then
for t,o in ipairs(e)do
if o.name == cfg_name and cfg_name then
-%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a><%=o.name%></a></li>
<%- elseif not cfg_name and o.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
<%- elseif o.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>ALL</a></li>
if self.sectiontype == "dns_servers" then
for i, tab in ipairs(e) do
if i == 1 then
-%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.title%></a></li>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a><%=o.name%></a></li>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.title%></a></li>
<%- end -%>
<%- end -%>
<%- elseif #e ~= 1 then
for i, tab in ipairs(e) do
if tab.name == cfg_name and cfg_name then
-%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.name%></a></li>
<%- elseif not cfg_name and tab.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="All">ALL</a></li>
<%- elseif tab.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.name%>"><a title="All">ALL</a></li>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.name%></a></li>
<%- end -%>
<%- end -%>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="all"><a title="All">ALL</a></li>
<%- end -%>
</ul>
</div>
<div id="tab-content">
<%- for t,o in ipairs(e)do
if #e ~= 1 and o.name == cfg_name and cfg_name then
<%- for i, tab in ipairs(e) do
if self.sectiontype == "dns_servers" then
if tab.name == "nameserver" then
-%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
<%- elseif #e ~= 1 and o.name == "all" and not cfg_name then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=tab.name%>">
<%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=tab.name%>">
<%- end -%>
<%- elseif #e ~= 1 and tab.name == cfg_name and cfg_name then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=tab.name%>">
<%- elseif #e ~= 1 and tab.name == "all" and not cfg_name then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=tab.name%>">
<%- elseif #e == 1 then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="all">
<%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>">
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=tab.name%>">
<%- end -%>
<table class="cbi-section-table">
<tr class="cbi-section-table-titles">
<table class="table cbi-section-table">
<tr class="tr cbi-section-table-titles">
<%- if not self.anonymous then -%>
<%- if self.sectionhead then -%>
<th class="cbi-section-table-cell"><%=self.sectionhead%></th>
<th class="th cbi-section-table-cell"><%=self.sectionhead%></th>
<%- else -%>
<th>&#160;</th>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<%- if i == 1 then -%>
<th class="cbi-section-table-cell"><%:Serial Number%></th>
<th class="th cbi-section-table-cell"><%:Serial Number%></th>
<%- end -%>
<th class="cbi-section-table-cell"<%=width(k)%>>
<th class="th cbi-section-table-cell"<%=width(k)%>>
<%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
<%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%>
</th>
<%- count = count + 1; end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"><%:Sort%></th>
<th class="th cbi-section-table-cell"><%:Sort%></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"><%:Edit%></th>
<th class="th cbi-section-table-cell"><%:Edit%></th>
<%- count = count + 1; end -%>
</tr>
<tr class="cbi-section-table-descr">
<tr class="tr cbi-section-table-descr">
<%- if not self.anonymous then -%>
<%- if self.sectiondesc then -%>
<th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
<th class="th cbi-section-table-cell"><%=self.sectiondesc%></th>
<%- else -%>
<th></th>
<th class="th cbi-section-table-cell"></th>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- if i == 1 then -%>
<th class="th cbi-section-table-cell"></th>
<%- end -%>
<th class="th cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"></th>
<th class="th cbi-section-table-cell"></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"></th>
<th class="th cbi-section-table-cell"></th>
<%- end -%>
</tr>
<%- local isempty = true
local num = 1
for i, k in ipairs(self:cfgsections()) do
section = k
while true do
if not uci:get("openclash", section, "config") then
uci:set("openclash", section, "config", "all")
uci:save("openclash")
end
if uci:get("openclash", section, "config") ~= o.name then
break
end
local section = k
local should_render = false
local section_name
if self.sectiontype == "dns_servers" then
section_name = uci:get("openclash", section, "group")
else
section_name = uci:get("openclash", section, "config")
end
if section_name == tab.name then
should_render = true
end
if should_render then
isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
<% if not self.anonymous then -%>
<tr class="tr cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
<%- if not self.anonymous then -%>
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
<%- end %>
<td class="cbi-section-table-cell">
<%- end -%>
<td class="td cbi-section-table-cell">
<p><%=num%></p>
<% num = num + 1 -%>
<%- num = num + 1 -%>
</td>
<%-
for k, node in ipairs(self.children) do
@ -344,14 +375,14 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
end
-%>
<%- if self.sortable then -%>
<td class="cbi-section-table-cell">
<td class="tdcbi-section-table-cell">
<input class="cbi-button cbi-button-up" type="button" value="<%:∧%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" />
<input class="cbi-button cbi-button-down" type="button" value="<%:%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" />
</td>
<%- end -%>
<%- if self.extedit or self.addremove then -%>
<td class="cbi-section-table-cell">
<td class="td cbi-section-table-cell">
<%- if self.extedit then -%>
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
<%- if type(self.extedit) == "string" then
@ -360,51 +391,53 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
%> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- end
%> alt="<%:Edit%>" title="<%:Edit%>" />
<%- end; if self.addremove then %>
<%- end; if self.addremove then -%>
<input class="btn cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section'; return switch_to_tab<%=sectiontype%>()" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" />
<%- end -%>
</td>
<%- end -%>
<%-
break
end
-%>
</tr>
<%- end -%>
<%- if isempty then -%>
<tr class="cbi-section-table-row">
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
</tr>
<tr class="tr cbi-section-table-row placeholder">
<td class="td" colspan="<%=count%>"><em><%:This section contains no values yet%></em></td>
</tr>
<%- end -%>
</table>
<% if self.error then %>
<%- if self.error then -%>
<div class="cbi-section-error">
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
<ul><%- for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
<li><%=pcdata(e):gsub("\n","<br />")%></li>
<%- end end %></ul>
<%- end end -%></ul>
</div>
<% end %>
<%- end -%>
<%- if self.addremove then -%>
<% if self.template_addremove then include(self.template_addremove) else -%>
<%- if self.template_addremove then include(self.template_addremove) else -%>
<div class="cbi-section-create cbi-tblsection-create">
<% if self.anonymous then %>
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('create')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
<% else %>
<%- if self.anonymous then -%>
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('<%=tab.name%>')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
<%- else -%>
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" data-type="uciname" data-optional="true" />
<input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
<input type="submit" class="cbi-button cbi-button-add" onclick="this.form.cbi_state='add-section'; return switch_to_tab<%=sectiontype%>('<%=tab.name%>')" value="<%:Add%>" />
<% if self.invalid_cts then -%>
<br /><%:Invalid%></div>
<%- end %>
<% end %>
<%- end %>
</div>
<%- end %>
<%- end -%>
<%- end -%>
</div>
<%- end -%>
<%- if self.addremove then -%>
<input type="hidden" id="cbi.cts.tagname.<%=self.config%>.<%=self.sectiontype%>" name="cbi.cts.tagname.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%>
</div>
</fieldset>
<!-- /tblsection -->
@ -452,17 +485,20 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
return luminance < 128;
};
function switch_to_tab<%=sectiontype%>(type){
function switch_to_tab<%=sectiontype%>(tab_name){
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if ( type == 'create' ) {
localStorage.setItem("titles<%=sectiontype%>", 0);
} else {
for(var j=0; j < titles<%=sectiontype%>.length; j++){
if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
localStorage.setItem("titles<%=sectiontype%>", j);
break;
}
for(var j=0; j < titles<%=sectiontype%>.length; j++){
if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
localStorage.setItem("titles<%=sectiontype%>", j);
break;
}
}
if (tab_name) {
var name = document.getElementById('cbi.cts.tagname.<%=self.config%>.<%=self.sectiontype%>');
if (name) {
name.value = tab_name;
}
}

View File

@ -1,488 +0,0 @@
<%-
local rowcnt = 1
local uci = require("luci.model.uci").cursor()
local fs = require "luci.openclash"
function rowstyle()
rowcnt = rowcnt + 1
return (rowcnt % 2) + 1
end
function width(o)
if o.width then
if type(o.width) == 'number' then
return ' style="width:%dpx"' % o.width
end
return ' style="width:%s"' % o.width
end
return ''
end
local head_width
local e={}
table.insert(e, {group="nameserver", title="NameServer"})
table.insert(e, {group="fallback", title="FallBack"})
table.insert(e, {group="default", title="Default-NameServer"})
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype"
-%>
<style type="text/css">
*{margin: 0;padding: 0;}
ul{
list-style: none;
}
h3{
margin-top: 0;
}
.cbi-value-field .cbi-dropdown, .cbi-value-field .cbi-input-select, .cbi-value input[type="text"], .cbi-value input[type="password"] {
min-width: auto;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%>{
display: flex;
align-items: center;
justify-content: flex-start;
padding: 16px 20px;
border-bottom: 1px solid var(--border-light, #e2e8f0);
background: var(--bg-gray, #f1f5f9);
min-width: 0;
box-shadow: none;
position: relative;
z-index: 1;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
display: flex;
width: 100%;
background: #f1f5f9;
border-radius: 8px;
border-bottom: none !important;
border: none !important;
gap: 5px;
margin: 0;
padding: 0;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
flex: 1 1 0;
min-width: 120px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 0;
height: 40px;
font-size: 12px;
font-weight: 400;
color: #64748b;
background: transparent;
border: 1px solid #e2e8f0;
border-radius: 8px;
cursor: pointer;
transition: all 0.18s;
margin: 0;
user-select: none;
position: relative;
box-sizing: border-box;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab{
background: #3b82f6;
color: #fff;
font-weight: 600;
z-index: 2;
border-radius: 6px;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.03);
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
display: block;
width: 100%;
height: 130%;
text-align: center;
text-decoration: none;
background: none;
border: none;
outline: none;
font: inherit;
color: inherit;
cursor: inherit;
padding: 5px;
margin: 0;
user-select: none;
transition: color 0.18s;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab > a{
color: #fff !important;
font-weight: 500;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled{
color: #fff;
background: #f9f9f9;
opacity: 0.7;
cursor: pointer;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled a{
color: #000 !important;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover,
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus{
color: #3b82f6;
background: rgba(59,130,246,0.10);
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover a,
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus a{
color: #3b82f6 !important;
}
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%>{
display: none;
}
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%> ul li{
float: left;
margin: 15px 10px;
width: 225px;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%>{
background: #374151;
border-bottom: 1px solid #374151;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
background: #374151;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
background: #1f2937;
color: #a1a1aa;
border-color: #374151;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab{
background: #2563eb;
color: #fff;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab a{
color: #fff !important;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled{
color: #1f2937;
background: #1f2937;
opacity: 0.7;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled a{
color: #fff !important;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover,
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus{
color: #3b82f6;
border-color: #3b82f6;
background: #22304a;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover a,
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus a{
color: #60a5fa !important;
}
</style>
<!-- tblsection -->
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title and #self.title > 0 then -%>
<legend><%=self.title%></legend>
<%- end %>
<%- if self.sortable then -%>
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%>
<div class="cbi-section-descr"><%=self.description%></div>
<%- local count = 0 -%>
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
<ul class="cbi-tabmenu">
<%- for i, tab in ipairs(e) do -%>
<%- if i == 1 then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.group%>"><a><%=tab.title%></a></li>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.group%>"><a><%=tab.title%></a></li>
<%- end -%>
<%- end -%>
</ul>
</div>
<div id="tab-content">
<%- for t,o in ipairs(e)do
if o.group == "nameserver" then
-%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=o.group%>">
<%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=o.group%>">
<%- end -%>
<table class="cbi-section-table">
<tr class="cbi-section-table-titles">
<%- if not self.anonymous then -%>
<%- if self.sectionhead then -%>
<th class="cbi-section-table-cell"><%=self.sectionhead%></th>
<%- else -%>
<th>&#160;</th>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<%- if i == 1 then -%>
<th class="cbi-section-table-cell"><%:Serial Number%></th>
<%- end -%>
<th class="cbi-section-table-cell"<%=width(k)%>>
<%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
<%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%>
</th>
<%- count = count + 1; end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"><%:Sort%></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"><%:Edit%></th>
<%- count = count + 1; end -%>
</tr>
<tr class="cbi-section-table-descr">
<%- if not self.anonymous then -%>
<%- if self.sectiondesc then -%>
<th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
<%- else -%>
<th></th>
<%- end -%>
<%- end; if self.extedit or self.addremove then -%>
<th></th>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"></th>
<%- end -%>
</tr>
<%- local isempty = true
local num = 1
for i, k in ipairs(self:cfgsections()) do
section = k
local section_group = fs.uci_get_config(section, "group")
if section_group == o.group then
isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
<% if not self.anonymous then -%>
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
<%- end %>
<td class="cbi-section-table-cell">
<p><%=num%></p>
<% num = num + 1 -%>
</td>
<%-
for k, node in ipairs(self.children) do
if not node.optional then
node:render(section, scope or {})
end
end
-%>
<%- if self.sortable then -%>
<td class="cbi-section-table-cell">
<input class="cbi-button cbi-button-up" type="button" value="<%:∧%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" />
<input class="cbi-button cbi-button-down" type="button" value="<%:%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" />
</td>
<%- end -%>
<%- if self.extedit or self.addremove then -%>
<td class="cbi-section-table-cell">
<%- if self.extedit then -%>
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
<%- if type(self.extedit) == "string" then
%> onclick="location.href='<%=self.extedit:format(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- elseif type(self.extedit) == "function" then
%> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- end
%> alt="<%:Edit%>" title="<%:Edit%>" />
<%- end; if self.addremove then %>
<input class="btn cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section';return switch_to_tab<%=sectiontype%>()" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" />
<%- end -%>
</td>
<%- end -%>
</tr>
<%- end -%>
<%- end -%>
<%- if isempty then -%>
<tr class="cbi-section-table-row">
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
</tr>
<%- end -%>
</table>
<% if self.error then %>
<div class="cbi-section-error">
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
<li><%=pcdata(e):gsub("\n","<br />")%></li>
<%- end end %></ul>
</div>
<% end %>
<%- if self.addremove then -%>
<% if self.template_addremove then include(self.template_addremove) else -%>
<div class="cbi-section-create cbi-tblsection-create">
<% if self.anonymous then %>
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('create', '<%=o.group%>')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
<% else %>
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=o.group%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=o.group%>" data-type="uciname" data-optional="true" />
<input type="hidden" name="cbi.opt.<%=self.config%>.<%=self.sectiontype%>.group" value="<%=o.group%>" />
<input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
<% if self.invalid_cts then -%>
<br /><%:Invalid%></div>
<%- end %>
<% end %>
</div>
<%- end %>
<%- end -%>
</div>
<%- end -%>
</div>
</fieldset>
<!-- /tblsection -->
<script type="text/javascript">//<![CDATA[
window.addEventListener('load', onload<%=sectiontype%>, false);
var titles<%=sectiontype%> = document.getElementsByName('tab-header-<%=self.config%>-<%=self.sectiontype%>');
var divs<%=sectiontype%> = document.getElementsByClassName('dom-<%=self.config%>-<%=self.sectiontype%>');
function isDarkBackground(element) {
var cachedTheme = localStorage.getItem('oc-theme');
if (cachedTheme === 'dark') {
return true;
} else if (cachedTheme === 'light') {
return false;
}
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
return true;
}
var style = window.getComputedStyle(element);
var bgColor = style.backgroundColor;
let r, g, b;
if (/rgb\(/.test(bgColor)) {
var rgb = bgColor.match(/\d+/g);
r = parseInt(rgb);
g = parseInt(rgb);
b = parseInt(rgb);
} else if (/#/.test(bgColor)) {
if (bgColor.length === 4) {
r = parseInt(bgColor + bgColor, 16);
g = parseInt(bgColor + bgColor, 16);
b = parseInt(bgColor + bgColor, 16);
} else {
r = parseInt(bgColor.slice(1, 3), 16);
g = parseInt(bgColor.slice(3, 5), 16);
b = parseInt(bgColor.slice(5, 7), 16);
}
} else {
return false;
}
var luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
return luminance < 128;
};
function switch_to_tab<%=sectiontype%>(type){
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if ( type == 'create' ) {
localStorage.setItem("titles<%=sectiontype%>", 0);
} else {
for(var j=0; j < titles<%=sectiontype%>.length; j++){
if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
localStorage.setItem("titles<%=sectiontype%>", j);
break;
}
}
}
localStorage.setItem("id<%=sectiontype%>",'cbi-<%=self.config%>-<%=self.sectiontype%>');
return true;
};
function onload<%=sectiontype%>() {
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if (localStorage.getItem("id<%=sectiontype%>")) {
if (document.getElementById(localStorage.getItem("id<%=sectiontype%>"))) {
document.getElementById(localStorage.getItem("id<%=sectiontype%>")).scrollIntoView();
};
localStorage.removeItem("id<%=sectiontype%>");
};
if (localStorage.getItem("titles<%=sectiontype%>")) {
if (titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")]) {
for(var j=0; j < titles<%=sectiontype%>.length; j++){
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
divs<%=sectiontype%>[j].style.display = 'none';
};
titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].className = 'cbi-tab';
divs<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].style.display = 'block';
};
localStorage.removeItem("titles<%=sectiontype%>");
};
for(var i=0; i < titles<%=sectiontype%>.length; i++){
var li<%=sectiontype%> = titles<%=sectiontype%>[i];
li<%=sectiontype%>.id = i;
var a<%=sectiontype%> = li<%=sectiontype%>.querySelector('a');
if (a<%=sectiontype%>) {
if (a<%=sectiontype%>.scrollWidth > a<%=sectiontype%>.clientWidth) {
a<%=sectiontype%>.style.textAlign = 'left';
} else {
a<%=sectiontype%>.style.textAlign = 'center';
}
}
li<%=sectiontype%>.onclick = function(){
for(var j=0; j < titles<%=sectiontype%>.length; j++){
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
divs<%=sectiontype%>[j].style.display = 'none';
};
this.className = 'cbi-tab';
divs<%=sectiontype%>[this.id].style.display = 'block';
localStorage.setItem("titles<%=sectiontype%>",this.id);
};
li<%=sectiontype%>.onTouchStart = function(){
for(var j=0; j < titles<%=sectiontype%>.length; j++){
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
divs<%=sectiontype%>[j].style.display = 'none';
};
this.className = 'cbi-tab';
divs<%=sectiontype%>[this.id].style.display = 'block';
localStorage.setItem("titles<%=sectiontype%>",this.id);
};
};
};
//]]>
</script>

View File

@ -144,7 +144,7 @@
function restore_config(btn)
{
btn.value = '<%:Restore Default Config%>';
btn.value = '<%:Restore Default%>';
btn.disabled = true;
var r = confirm("<%:Are you sure want to restore the default config?%>")
if (r == true) {

View File

@ -1,146 +1,132 @@
<style>
.cbi-input-select {
width: auto !important;
width: auto !important;
}
</style>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="6">
<p align="center" id="update_tip">
<b><%:Note: if the update fails, you can manually download and upload%></b>
</p>
</td></tr>
<tr><td width="16.6%" align="right"><%:Compiled Version%></td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="CORE_VERSION" id="CORE_VERSION">
<option value="linux-386"><%:linux-386%></option>
<option value="linux-amd64-v1"><%:linux-amd64-v1(x86-64)%></option>
<option value="linux-amd64-v2"><%:linux-amd64-v2(x86-64)%></option>
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
<option value="linux-armv5"><%:linux-armv5%></option>
<option value="linux-armv6"><%:linux-armv6%></option>
<option value="linux-armv7"><%:linux-armv7%></option>
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
<option value="linux-riscv64"><%:linux-riscv64%></option>
<option value="linux-s390x"><%:linux-s390x%></option>
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
<option value="linux-mips64"><%:linux-mips64%></option>
<option value="linux-mips64le"><%:linux-mips64le%></option>
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
<option value="0"><%:Not Set%></option>
</select>
</td>
<td width="16.6%" align="right"><%:Release Branch%></td>
<td width="16.6%" align="left"><select class="cbi-input-select" name="RELEASE_BRANCH" id="RELEASE_BRANCH">
<option value="master">Master</option>
<option value="dev">Developer</option>
</select></td>
<td width="16.6%" align="right"><%:Smart Core%> <a href="javascript:void(0);" onclick="window.open('https://github.com/vernesong/mihomo/releases', '_blank');" style="color: #0066cc; text-decoration: none;" title="<%:View core infos that support smart group%>"> (?)</a></td>
<td width="16.6%" align="left"><select class="cbi-input-select" name="SMART_ENABLE" id="SMART_ENABLE">
<option value="0"><%:Disabled%></option>
<option value="1"><%:Enable%></option>
</select></td>
</tr>
<tr>
<td width="100%" colspan="6">
<p align="center" id="update_tip" class="oc" style="background-color: unset;">
<b style="color: var(--info-color);"><%:Note: if the update fails, you can manually download and upload%></b>
</p>
</td>
</tr>
<tr>
<td width="16.6%" align="right"><%:Compiled Version%></td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="CORE_VERSION" id="CORE_VERSION">
<option value="linux-386"><%:linux-386%></option>
<option value="linux-amd64-v1"><%:linux-amd64-v1(x86-64)%></option>
<option value="linux-amd64-v2"><%:linux-amd64-v2(x86-64)%></option>
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
<option value="linux-armv5"><%:linux-armv5%></option>
<option value="linux-armv6"><%:linux-armv6%></option>
<option value="linux-armv7"><%:linux-armv7%></option>
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
<option value="linux-riscv64"><%:linux-riscv64%></option>
<option value="linux-s390x"><%:linux-s390x%></option>
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
<option value="linux-mips64"><%:linux-mips64%></option>
<option value="linux-mips64le"><%:linux-mips64le%></option>
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
<option value="0"><%:Not Set%></option>
</select>
</td>
<td width="16.6%" align="right"><%:Release Branch%></td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="RELEASE_BRANCH" id="RELEASE_BRANCH">
<option value="master">Master</option>
<option value="dev">Developer</option>
</select>
</td>
<td width="16.6%" align="right"><%:Smart Core%>
<a href="javascript:void(0);" onclick="window.open('https://github.com/vernesong/mihomo/releases', '_blank');" style="color: #0066cc; text-decoration: none;" title="<%:View core infos that support smart group%>">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
</a>
</td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="SMART_ENABLE" id="SMART_ENABLE">
<option value="0"><%:Disabled%></option>
<option value="1"><%:Enable%></option>
</select>
</td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Core Update%></b>
</p>
</td></tr>
<tr><td width="100%" colspan="4">
<tr>
<td width="100%" colspan="4">
<p align="center">
<b><%:Core Update%></b>
</p>
</td>
</tr>
<tr>
<td width="25%"><%:CPU Architecture%></td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td>
<td width="25%"><%:Last Check Update%></td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td>
</tr>
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
</p>
</td></tr>
<tr>
<td width="100%" colspan="4">
<p align="center">
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
</p>
</td>
</tr>
<tr><td width="25%">[Meta] <%:Current Core%></td><td width="25%" align="left" id="CORE_META_CV"><%:Collecting data...%></td><td width="25%">[Meta] <%:Latest Core%></td><td width="25%" align="left" id="CORE_META_LV"><%:Collecting data...%></td></tr>
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_meta_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_meta_up"><%:Collecting data...%></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Client Update%></b>
</p>
</td></tr>
<tr><td width="25%"><%:Current Client%></td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td><td width="25%"><%:Latest Client%></td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
<tr><td width="25%"><%:Update Client%></td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Client%></td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr>
<td width="33%">
<p align="center" id="restore">
<%:Collecting data...%>
</p>
</td>
<td width="33%">
<p align="center" id="remove_core">
<%:Collecting data...%>
</p>
</td>
<td width="33%">
<p align="center" id="one_key_update_cdn">
<%:Collecting data...%>
</p>
</td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Backup Section%></b>
</p>
</td></tr>
<tr>
<td width="25%">
<p align="center" id="backup">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_ex_core">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_core_only">
<%:Collecting data...%>
</p>
</td>
<td width="100%" colspan="4">
<p align="center">
<b><%:Client Update%></b>
</p>
</td>
</tr>
<tr><td width="25%"><%:Current Client%></td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td><td width="25%"><%:Latest Client%></td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
<tr><td width="25%"><%:Update Client%></td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Client%></td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr>
<td width="25%">
<p align="center" id="backup_config_only">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_rule_only">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_proxy_only">
<%:Collecting data...%>
</p>
</td>
<td width="25%" align="center">
<div style="display: inline-block; white-space: nowrap;">
<select class="cbi-input-select" name="BACKUP_SELECT" id="BACKUP_SELECT">
<option value="backup"><%:Backup File%></option>
<option value="backup_ex_core"><%:Backup Exclude Cores%></option>
<option value="backup_only_core"><%:Backup Core%></option>
<option value="backup_only_config"><%:Backup Config%></option>
<option value="backup_only_rule"><%:Backup Rule Provider%></option>
<option value="backup_only_proxy"><%:Backup Proxy Provider%></option>
</select>
<span id="backup">
<%:Collecting data...%>
</span>
</div>
</td>
<td width="25%" align="center" id="restore">
<%:Collecting data...%>
</td>
<td width="25%" align="center" id="remove_core">
<%:Collecting data...%>
</td>
<td width="25%" align="center" id="one_key_update_cdn">
<%:Collecting data...%>
</td>
</tr>
</table>
</fieldset>
@ -160,11 +146,7 @@
var ma_op_up = document.getElementById('ma_op_up');
var restore = document.getElementById('restore');
var backup = document.getElementById('backup');
var backup_ex_core = document.getElementById('backup_ex_core');
var backup_core_only = document.getElementById('backup_core_only');
var backup_config_only = document.getElementById('backup_config_only');
var backup_rule_only = document.getElementById('backup_rule_only');
var backup_proxy_only = document.getElementById('backup_proxy_only');
var backup_select = document.getElementById('BACKUP_SELECT');
var one_key_update_cdn = document.getElementById('one_key_update_cdn');
var remove_core = document.getElementById('remove_core');
var release_branch = document.getElementById('RELEASE_BRANCH');
@ -173,29 +155,24 @@
op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return op_update(this)"/>';
ma_core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Meta\')"/>';
ma_op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_op_update(this)"/>';
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default Config%>" onclick="return restore_config(this)"/>';
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default%>" onclick="return restore_config(this)"/>';
one_key_update_cdn.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Check Update%>" onclick="return all_one_key_update_cdn(this)"/>';
remove_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Remove Core%>" onclick="return remove_all_core(this)"/>';
backup.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup OpenClash%>" onclick="return backup_all_file(this)"/>';
backup_ex_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Exclude Cores%>" onclick="return backup_no_core(this)"/>';
backup_core_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Core%>" onclick="return backup_only_core(this)"/>';
backup_config_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Config%>" onclick="return backup_only_config(this)"/>';
backup_rule_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Rule Provider%>" onclick="return backup_only_rule(this)"/>';
backup_proxy_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Proxy Provider%>" onclick="return backup_only_proxy(this)"/>';
backup.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup File%>" onclick="return backup_file(this)"/>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.corever && status.corever != "0" && status.corever != "" ) {
core_version.value = status.corever;
core_version.value = status.corever;
}
else {
core_version.value = "0";
core_version.value = "0";
}
if ( status.release_branch && status.release_branch != "" ) {
release_branch.value = status.release_branch;
release_branch.value = status.release_branch;
}
else {
release_branch.value = "master";
release_branch.value = "master";
}
if ( status.smart_enable && status.smart_enable != "" ) {
smart_enable.value = status.smart_enable;
@ -215,190 +192,169 @@
});
function updateStatus(x, status) {
if ( x && x.status == 200 ) {
cpu_model.innerHTML = status.coremodel ? "<b style=color:green>"+status.coremodel+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
if ( status.upchecktime != "1" ) {
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
}
else {
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
}
if ( status.coremetacv == "0" ) {
core_meta_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
else {
core_meta_cv.innerHTML = "<b style=color:green>"+status.coremetacv+"</b>";
}
var coremetalvis = status.corelv;
if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+" <%:<New>%></b>";
}
else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"</b>";
}
else if (coremetalvis == "loading...") {
core_meta_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
}
else {
core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
var oplv = status.oplv;
op_cv.innerHTML = status.opcv != "0" ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
if (oplv != "" && oplv != "loading..." && status.opcv != "0") {
function compareVersions(v1, v2) {
var ver1 = v1.replace(/^v/, '').split('.');
var ver2 = v2.replace(/^v/, '').split('.');
if ( x && x.status == 200 ) {
cpu_model.innerHTML = status.coremodel ? "<b style=color:green>"+status.coremodel+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
var maxLen = Math.max(ver1.length, ver2.length);
while (ver1.length < maxLen) ver1.push('0');
while (ver2.length < maxLen) ver2.push('0');
if ( status.upchecktime != "1" ) {
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
} else {
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
}
if ( status.coremetacv == "0" ) {
core_meta_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
} else {
core_meta_cv.innerHTML = "<b style=color:green>"+status.coremetacv+"</b>";
}
for (var i = 0; i < maxLen; i++) {
var num1 = parseInt(ver1[i], 10);
var num2 = parseInt(ver2[i], 10);
if (num1 > num2) return 1;
if (num1 < num2) return -1;
}
return 0;
}
var coremetalvis = status.corelv;
if (compareVersions(oplv, status.opcv) > 0) {
op_lv.innerHTML = "<b style=color:green>"+oplv+" <%:<New>%></b>";
} else {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
}
}
else if (oplv != "" && oplv != "loading...") {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
}
else if (oplv == "loading...") {
op_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
}
else {
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
}
}
if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+" <%:<New>%></b>";
} else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"</b>";
} else if (coremetalvis == "loading...") {
core_meta_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
} else {
core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
var oplv = status.oplv;
op_cv.innerHTML = status.opcv != "0" ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
if (oplv != "" && oplv != "loading..." && status.opcv != "0") {
function compareVersions(v1, v2) {
var ver1 = v1.replace(/^v/, '').split('.');
var ver2 = v2.replace(/^v/, '').split('.');
var maxLen = Math.max(ver1.length, ver2.length);
while (ver1.length < maxLen) ver1.push('0');
while (ver2.length < maxLen) ver2.push('0');
for (var i = 0; i < maxLen; i++) {
var num1 = parseInt(ver1[i], 10);
var num2 = parseInt(ver2[i], 10);
if (num1 > num2) return 1;
if (num1 < num2) return -1;
}
return 0;
}
if (compareVersions(oplv, status.opcv) > 0) {
op_lv.innerHTML = "<b style=color:green>"+oplv+" <%:<New>%></b>";
} else {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
}
} else if (oplv != "" && oplv != "loading...") {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
} else if (oplv == "loading...") {
op_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
} else {
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
}
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
function handleStartLog(x, status) {
if ( x && x.status == 200 ) {
if ( status.startlog == "\n" || status.startlog == "" || status.startlog == "##FINISH##\n" ) {
var rdmdl = Math.floor(Math.random()*3)+1;
if(rdmdl == 1) {
update_tip.innerHTML = '<b><font><%:Note: if the update fails, you can manually download and upload%></font></b>';
}
else if(rdmdl == 2) {
update_tip.innerHTML = '<b><font><%:Note: the client may not support update, because the firmware with squashfs format will not release flash space after updating%></font></b>';
}
else if(rdmdl == 3) {
update_tip.innerHTML = '<b><font><%:Note: options will auto-save when you click to update or download%></font></b>';
}
}
else if ( status.startlog.match("level=fatal") || status.startlog.indexOf("FTL [Config]") != "-1" ) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
if ( status.startlog.match("level=fatal") ) {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
}
else {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('FTL [Config] ')[1]);
}
}
else if ( status.startlog != "\n" && status.startlog != "" && status.startlog != "##FINISH##\n" ) {
if ( status.startlog.match("Tip:") || status.startlog.match("提示:")) {
update_tip.innerHTML = '<b style=color:#ff6f00>'+status.startlog+'</b>';
}
else if ( status.startlog.match("Error:") || status.startlog.match("错误:")) {
update_tip.innerHTML = '<b style=color:#FF0000>'+status.startlog+'</b>';
}
else if ( status.startlog.match("Warning:") || status.startlog.match("警告:")) {
update_tip.innerHTML = '<b style=color:#ff00bb>'+status.startlog+'</b>';
}
else if ( status.startlog.match("Watchdog:") || status.startlog.match("守护程序:")) {
update_tip.innerHTML = '<b style=color:#b300ff>'+status.startlog+'</b>';
}
else {
update_tip.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
}
}
}
}
if ( x && x.status == 200 ) {
if ( status.startlog == "\n" || status.startlog == "" || status.startlog == "##FINISH##\n" ) {
var rdmdl = Math.floor(Math.random()*3)+1;
if(rdmdl == 1) {
update_tip.innerHTML = '<b style=color:var(--info-color)><%:Note: if the update fails, you can manually download and upload%></b>';
}
else if(rdmdl == 2) {
update_tip.innerHTML = '<b style=color:var(--info-color)><%:Note: the client may not support update, because the firmware with squashfs format will not release flash space after updating%></b>';
}
else if(rdmdl == 3) {
update_tip.innerHTML = '<b style=color:var(--info-color)><%:Note: options will auto-save when you click to update or download%></b>';
}
} else if ( status.startlog.match("level=fatal")) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
if ( status.startlog.match("level=fatal") ) {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
}
} else if ( status.startlog != "\n" && status.startlog != "" && status.startlog != "##FINISH##\n" ) {
for (var levelKey in window.levelTranslations) {
var translatedText = '[' + window.levelTranslations[levelKey] + ']';
if (status.startlog.match(translatedText)) {
update_tip.innerHTML = '<b style=color:var(--' + levelKey + '-color)>' + status.startlog + '</b>';
return;
}
}
update_tip.innerHTML = '<b style=color:var(--info-color)>' + status.startlog + '</b>';
}
}
}
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, handleStartLog);
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, handleStartLog);
function core_update(btn,type)
{
var v = core_version.value;
var r = release_branch.value;
function core_update(btn,type) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', {core_type: type}, function(x, status) {
btn.value = '<%:Check And Update%>';
btn.value = '<%:Check And Update%>';
btn.disabled = false;
return false;
});
}
});
}
}
function op_update(btn)
{
var v = core_version.value;
var r = release_branch.value;
function op_update(btn) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "opupdate")%>', null, function(x, status) {
btn.value = '<%:Check And Update%>';
btn.value = '<%:Check And Update%>';
btn.disabled = false;
return false;
});
}
});
}
}
function ma_core_update(btn,type)
{
var v = core_version.value;
function ma_core_update(btn,type) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
btn.value = '<%:Download%>';
btn.disabled = false;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.corever != "0" ) {
if (type == "Meta") {
if (s == "1") {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/smart/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
}
else {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
if (x && x.status == 200) {
btn.value = '<%:Download%>';
btn.disabled = false;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.corever != "0" ) {
if (type == "Meta") {
if (s == "1") {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/smart/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
} else {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
}
}
} else {
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
}
}
}
else {
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
}
});
return false;
}
});
return false;
}
});
}
});
}
function ma_op_update(btn)
{
btn.value = '<%:Download%>';
btn.disabled = false;
var v = core_version.value;
function ma_op_update(btn) {
btn.value = '<%:Download%>';
btn.disabled = false;
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
@ -409,108 +365,56 @@
if ( oplv != "" && oplv != "loading..." ) {
if (status.pkg_type == "apk") {
url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash-'+oplv+'.apk';
}
else {
} else {
url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash_'+oplv+'_all.ipk';
}
window.location.href=url2;
}
else {
} else {
alert('<%:Failed to get the latest version. Please try again later!%>')
}
}
});
}
});
return false;
}
});
return false;
}
function remove_all_core(btn)
{
btn.value = '<%:Remove Core%>';
btn.disabled = true;
var r = confirm("<%:Are you sure want to remove all core files?%>")
if (r == true) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "remove_all_core")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
alert('<%:Remove succeeded!%>')
}
else {
alert('<%:Remove failed!%>')
}
});
} else {
}
btn.disabled = false;
return false;
}
function backup_all_file(btn)
{
btn.value = '<%:Backup OpenClash%>';
function remove_all_core(btn) {
btn.value = '<%:Remove Core%>';
btn.disabled = true;
window.location.href='<%="backup"%>';
var r = confirm("<%:Are you sure want to remove all core files?%>")
if (r == true) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "remove_all_core")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
alert('<%:Remove succeeded!%>')
} else {
alert('<%:Remove failed!%>')
}
});
}
btn.disabled = false;
return false;
}
}
function backup_no_core(btn)
{
btn.value = '<%:Backup Exclude Cores%>';
function backup_file(btn) {
btn.value = '<%:Backup File%>';
btn.disabled = true;
window.location.href='<%="backup_ex_core"%>';
window.location.href=backup_select.value;
btn.disabled = false;
return false;
}
}
function backup_only_core(btn)
{
btn.value = '<%:Backup Core%>';
btn.disabled = true;
window.location.href='<%="backup_only_core"%>';
btn.disabled = false;
return false;
}
function backup_only_config(btn)
{
btn.value = '<%:Backup Config%>';
btn.disabled = true;
window.location.href='<%="backup_only_config"%>';
btn.disabled = false;
return false;
}
function backup_only_rule(btn)
{
btn.value = '<%:Backup Rule Provider%>';
btn.disabled = true;
window.location.href='<%="backup_only_rule"%>';
btn.disabled = false;
return false;
}
function backup_only_proxy(btn)
{
btn.value = '<%:Backup Proxy Provider%>';
btn.disabled = true;
window.location.href='<%="backup_only_proxy"%>';
btn.disabled = false;
return false;
}
function all_one_key_update_cdn(btn)
{
var v = core_version.value;
function all_one_key_update_cdn(btn) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
btn.value = '<%:Check Update%>';
btn.value = '<%:Check Update%>';
btn.disabled = false;
return select_git_cdn("one_key_update");
}
});
}
}
//]]></script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,18 +13,14 @@ config openclash 'config'
option auto_update_time '0'
option cn_port '9090'
option dashboard_forward_ssl '0'
option rule_source '0'
option enable_custom_dns '0'
option ipv6_enable '0'
option ipv6_dns '0'
option enable_custom_clash_rules '0'
option other_rule_auto_update '0'
option core_version '0'
option en_mode 'fake-ip'
option enable_redirect_dns '1'
option servers_if_update '0'
option disable_masq_cache '1'
option servers_update '0'
option log_level '0'
option proxy_mode 'rule'
option intranet_allowed '1'

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,6 @@
# This script is called by /etc/init.d/openclash
# Add your custom firewall rules here, they will be added after the end of the OpenClash iptables rules
LOG_OUT "Tip: Start Add Custom Firewall Rules..."
LOG_TIP "Start Add Custom Firewall Rules..."
exit 0

View File

@ -6,7 +6,7 @@
# This script is called by /etc/init.d/openclash
# Add your custom overwrite scripts here, they will be take effict after the OpenClash own srcipts
LOG_OUT "Tip: Start Running Custom Overwrite Scripts..."
LOG_TIP "Start Running Custom Overwrite Scripts..."
LOGTIME=$(echo $(date "+%Y-%m-%d %H:%M:%S"))
LOG_FILE="/tmp/openclash.log"
#Config Path
@ -42,7 +42,7 @@ CONFIG_FILE="$1"
#2--key name
#3--hash
#ruby_merge_hash "$CONFIG_FILE" "['proxy-providers']" "'TW'=>{'type'=>'http', 'path'=>'./proxy_provider/TW.yaml', 'url'=>'https://gist.githubusercontent.com/raw/tw_clash', 'interval'=>3600, 'health-check'=>{'enable'=>true, 'url'=>'http://cp.cloudflare.com/generate_204', 'interval'=>300}}"
#ruby_merge_hash "$CONFIG_FILE" "['rule-providers']" "'Reject'=>{'type'=>'http', 'behavior'=>'classical', 'url'=>'https://testingcf.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Reject.yaml', 'path'=>'./rule_provider/Reject', 'interval'=>86400}"
#ruby_merge_hash "$CONFIG_FILE" "['rule-providers']" "'Reject'=>{'type'=>'http', 'behavior'=>'classical', 'url'=>'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/refs/heads/master/Clash/Apple.list', 'path'=>'./rule_provider/Apple.list', 'interval'=>86400}"
#Array Edit Demo
#1--config path
@ -51,7 +51,7 @@ CONFIG_FILE="$1"
#4--match key value
#5--target key name
#6--target key value
#ruby_arr_edit "$CONFIG_FILE" "['proxy-groups']" "['name']" "Proxy" "['type']" "Smart"
#ruby_arr_edit "$CONFIG_FILE" "['proxy-groups']" "['name']" "Proxy" "['type']" "smart"
#ruby_arr_edit "$CONFIG_FILE" "['dns']['nameserver']" "" "114.114.114.114" "" "119.29.29.29"
#Array Insert Value Demo:
@ -103,7 +103,7 @@ CONFIG_FILE="$1"
# begin
# Value = YAML.load_file('$CONFIG_FILE');
# rescue Exception => e
# puts '${LOGTIME} Error: Load File Failed,【' + e.message + '】';
# puts '${LOGTIME} [error] Load File Failed,【' + e.message + '】';
# end;
#General
@ -117,7 +117,7 @@ CONFIG_FILE="$1"
# }.join;
# rescue Exception => e
# puts '${LOGTIME} Error: Set General Failed,【' + e.message + '】';
# puts '${LOGTIME} [error] Set General Failed,【' + e.message + '】';
# ensure
# File.open('$CONFIG_FILE','w') {|f| YAML.dump(Value, f)};
# end" 2>/dev/null >> $LOG_FILE

View File

@ -1,618 +0,0 @@
payload:
- 1.165.84.0/24
- 1.165.85.0/24
- 1.165.90.0/24
- 5.8.200.0/24
- 5.9.123.0/24
- 13.73.0.0/16
- 13.73.1.0/24
- 13.75.114.0/24
- 13.126.76.0/24
- 14.18.251.72/32
- 18.214.26.0/24
- 24.105.28.0/24
- 27.64.93.0/24
- 34.235.169.0/24
- 35.185.157.0/24
- 35.198.200.0/24
- 36.232.23.0/24
- 36.232.28.0/24
- 36.232.29.0/24
- 37.21.10.0/24
- 37.230.228.0/24
- 42.113.94.0/24
- 42.114.229.0/24
- 43.225.199.0/24
- 43.239.136.0/24
- 43.241.50.0/24
- 43.249.36.0/24
- 45.113.137.0/24
- 45.113.191.0/24
- 45.119.240.0/24
- 45.121.184.0/24
- 45.121.185.0/24
- 45.121.186.0/24
- 45.121.187.0/24
- 47.52.16.0/24
- 47.52.17.0/24
- 47.52.18.0/24
- 47.52.19.0/24
- 47.52.20.0/24
- 47.52.21.0/24
- 47.52.22.0/24
- 47.52.23.0/24
- 47.52.24.0/24
- 47.52.25.0/24
- 47.52.26.0/24
- 47.52.27.0/24
- 47.52.28.0/24
- 47.52.29.0/24
- 47.52.30.0/24
- 47.52.31.0/24
- 47.52.40.0/24
- 47.52.41.0/24
- 47.52.42.0/24
- 47.52.43.0/24
- 47.52.44.0/24
- 47.52.45.0/24
- 47.52.46.0/24
- 47.52.47.0/24
- 47.52.56.0/24
- 47.52.57.0/24
- 47.52.58.0/24
- 47.52.59.0/24
- 47.52.60.0/24
- 47.52.61.0/24
- 47.52.62.0/24
- 47.52.63.0/24
- 47.52.64.0/24
- 47.52.65.0/24
- 47.52.66.0/24
- 47.52.67.0/24
- 47.52.68.0/24
- 47.52.69.0/24
- 47.52.70.0/24
- 47.52.71.0/24
- 47.52.72.0/24
- 47.52.73.0/24
- 47.52.74.0/24
- 47.52.75.0/24
- 47.52.76.0/24
- 47.52.77.0/24
- 47.52.78.0/24
- 47.52.79.0/24
- 47.52.88.0/24
- 47.52.89.0/24
- 47.52.90.0/24
- 47.52.91.0/24
- 47.52.92.0/24
- 47.52.93.0/24
- 47.52.94.0/24
- 47.52.95.0/24
- 47.52.96.0/24
- 47.52.97.0/24
- 47.52.98.0/24
- 47.52.99.0/24
- 47.52.100.0/24
- 47.52.101.0/24
- 47.52.102.0/24
- 47.52.103.0/24
- 47.52.104.0/24
- 47.52.105.0/24
- 47.52.106.0/24
- 47.52.107.0/24
- 47.52.108.0/24
- 47.52.109.0/24
- 47.52.110.0/24
- 47.52.111.0/24
- 47.52.112.0/24
- 47.52.113.0/24
- 47.52.114.0/24
- 47.52.115.0/24
- 47.52.116.0/24
- 47.52.117.0/24
- 47.52.118.0/24
- 47.52.119.0/24
- 47.52.128.0/24
- 47.52.129.0/24
- 47.52.130.0/24
- 47.52.131.0/24
- 47.52.132.0/24
- 47.52.133.0/24
- 47.52.134.0/24
- 47.52.135.0/24
- 47.52.136.0/24
- 47.52.137.0/24
- 47.52.138.0/24
- 47.52.139.0/24
- 47.52.140.0/24
- 47.52.141.0/24
- 47.52.142.0/24
- 47.52.143.0/24
- 47.52.144.0/24
- 47.52.145.0/24
- 47.52.146.0/24
- 47.52.147.0/24
- 47.52.148.0/24
- 47.52.149.0/24
- 47.52.150.0/24
- 47.52.151.0/24
- 47.52.152.0/24
- 47.52.153.0/24
- 47.52.154.0/24
- 47.52.155.0/24
- 47.52.156.0/24
- 47.52.157.0/24
- 47.52.158.0/24
- 47.52.159.0/24
- 47.52.160.0/24
- 47.52.161.0/24
- 47.52.162.0/24
- 47.52.163.0/24
- 47.52.164.0/24
- 47.52.165.0/24
- 47.52.166.0/24
- 47.52.167.0/24
- 47.52.168.0/24
- 47.52.169.0/24
- 47.52.170.0/24
- 47.52.171.0/24
- 47.52.172.0/24
- 47.52.173.0/24
- 47.52.174.0/24
- 47.52.175.0/24
- 47.52.188.0/24
- 47.52.190.0/24
- 47.52.191.0/24
- 47.52.192.0/24
- 47.52.193.0/24
- 47.52.194.0/24
- 47.52.195.0/24
- 47.52.196.0/24
- 47.52.197.0/24
- 47.52.198.0/24
- 47.52.199.0/24
- 47.52.200.0/24
- 47.52.201.0/24
- 47.52.202.0/24
- 47.52.203.0/24
- 47.52.204.0/24
- 47.52.205.0/24
- 47.52.206.0/24
- 47.52.207.0/24
- 47.52.208.0/24
- 47.52.209.0/24
- 47.52.224.0/24
- 47.52.225.0/24
- 47.52.226.0/24
- 47.52.228.0/24
- 47.52.230.0/24
- 47.52.231.0/24
- 47.52.232.0/24
- 47.52.234.0/24
- 47.52.235.0/24
- 47.52.236.0/24
- 47.52.241.0/24
- 47.52.242.0/24
- 47.52.244.0/24
- 47.52.246.0/24
- 47.52.247.0/24
- 47.52.248.0/24
- 47.52.249.0/24
- 47.52.250.0/24
- 47.52.251.0/24
- 47.52.252.0/24
- 47.52.253.0/24
- 47.52.254.0/24
- 47.52.255.0/24
- 47.74.1.0/24
- 47.75.3.0/24
- 47.75.5.0/24
- 47.75.94.0/24
- 47.75.98.0/24
- 47.75.143.0/24
- 47.75.194.0/24
- 47.75.207.0/24
- 47.75.219.0/24
- 47.89.8.0/24
- 47.89.9.0/24
- 47.89.10.0/24
- 47.89.11.0/24
- 47.89.12.0/24
- 47.89.13.0/24
- 47.89.14.0/24
- 47.89.15.0/24
- 47.89.16.0/24
- 47.89.17.0/24
- 47.89.18.0/24
- 47.89.19.0/24
- 47.89.20.0/24
- 47.89.21.0/24
- 47.89.22.0/24
- 47.89.23.0/24
- 47.90.8.0/24
- 47.90.90.0/24
- 47.90.96.0/24
- 47.90.97.0/24
- 47.90.98.0/24
- 47.90.99.0/24
- 47.90.100.0/24
- 47.90.101.0/24
- 47.90.102.0/24
- 47.90.103.0/24
- 47.90.120.0/24
- 47.90.121.0/24
- 47.90.122.0/24
- 47.90.123.0/24
- 47.90.124.0/24
- 47.90.125.0/24
- 47.90.126.0/24
- 47.90.127.0/24
- 47.90.214.0/24
- 47.91.152.0/24
- 47.91.153.0/24
- 47.91.154.0/24
- 47.91.155.0/24
- 47.91.156.0/24
- 47.91.157.0/24
- 47.91.158.0/24
- 47.91.159.0/24
- 47.91.207.0/24
- 47.91.208.0/24
- 47.91.209.0/24
- 47.91.210.0/24
- 47.91.211.0/24
- 47.91.212.0/24
- 47.91.213.0/24
- 47.91.214.0/24
- 47.91.215.0/24
- 47.91.216.0/24
- 47.91.217.0/24
- 47.91.218.0/24
- 47.91.219.0/24
- 47.91.220.0/24
- 47.91.221.0/24
- 47.91.224.0/24
- 47.91.225.0/24
- 47.91.226.0/24
- 47.91.227.0/24
- 47.91.228.0/24
- 47.91.229.0/24
- 47.91.230.0/24
- 47.91.231.0/24
- 47.91.232.0/24
- 47.91.233.0/24
- 47.91.234.0/24
- 47.91.235.0/24
- 47.91.236.0/24
- 47.91.237.0/24
- 47.91.238.0/24
- 47.91.239.0/24
- 47.91.240.0/24
- 47.91.241.0/24
- 47.91.242.0/24
- 47.91.243.0/24
- 47.91.244.0/24
- 47.91.245.0/24
- 47.91.246.0/24
- 47.91.247.0/24
- 47.91.248.0/24
- 47.91.249.0/24
- 47.91.250.0/24
- 47.91.251.0/24
- 47.91.252.0/24
- 47.91.253.0/24
- 47.91.254.0/24
- 47.91.255.0/24
- 47.96.0.0/16
- 47.96.2.0/24
- 47.96.3.0/24
- 47.96.5.0/24
- 47.96.6.0/24
- 47.96.7.0/24
- 47.96.8.0/24
- 47.96.9.0/24
- 47.96.10.0/24
- 47.96.12.0/24
- 47.96.13.0/24
- 47.96.14.0/24
- 47.99.33.0/24
- 47.99.38.0/24
- 47.99.44.0/24
- 47.99.62.0/24
- 47.99.73.0/24
- 47.99.75.0/24
- 47.99.76.0/24
- 47.99.81.0/24
- 47.99.84.0/24
- 47.99.89.0/24
- 47.99.90.0/24
- 47.99.93.0/24
- 47.99.95.0/24
- 47.99.98.0/24
- 47.99.99.0/24
- 47.99.101.0/24
- 47.99.103.0/24
- 47.99.104.0/24
- 47.99.107.0/24
- 47.99.111.0/24
- 47.99.120.0/24
- 47.99.128.0/24
- 47.99.159.0/24
- 47.99.161.0/24
- 47.99.164.0/24
- 47.99.166.0/24
- 47.99.169.0/24
- 47.110.42.0/24
- 47.244.1.0/24
- 47.244.2.0/24
- 47.244.3.0/24
- 47.244.5.0/24
- 47.244.7.0/24
- 47.244.10.0/24
- 47.244.11.0/24
- 47.244.12.0/24
- 47.244.13.0/24
- 47.244.14.0/24
- 47.244.15.0/24
- 47.244.16.0/24
- 47.244.17.0/24
- 47.244.18.0/24
- 47.244.19.0/24
- 47.244.21.0/24
- 47.244.22.0/24
- 47.244.24.0/24
- 47.244.25.0/24
- 47.244.26.0/24
- 47.244.33.0/24
- 47.244.35.0/24
- 47.244.36.0/24
- 47.244.37.0/24
- 47.244.43.0/24
- 47.244.44.0/24
- 47.244.48.0/24
- 47.244.51.0/24
- 47.244.56.0/24
- 52.53.89.0/24
- 52.63.114.0/24
- 52.64.199.0/24
- 52.90.185.0/24
- 52.175.16.0/24
- 52.175.31.0/24
- 52.207.236.0/24
- 52.229.154.0/24
- 52.229.160.0/24
- 52.229.161.0/24
- 54.66.223.0/24
- 54.158.198.0/24
- 54.164.19.0/24
- 54.169.27.0/24
- 54.209.147.0/24
- 58.153.0.0/16
- 58.153.19.0/24
- 58.153.171.0/24
- 58.153.208.0/24
- 58.153.209.0/24
- 58.153.221.0/24
- 58.176.80.0/24
- 58.177.181.0/24
- 58.215.54.0/24
- 58.221.252.0/24
- 59.16.249.0/24
- 59.127.115.0/24
- 59.149.239.0/24
- 60.248.89.0/24
- 61.80.89.0/24
- 61.84.148.0/24
- 61.155.210.0/24
- 61.216.2.0/24
- 61.216.34.0/24
- 61.216.146.0/24
- 61.238.35.0/24
- 61.239.213.0/24
- 61.239.223.0/24
- 74.91.112.0/24
- 74.201.99.0/24
- 87.98.228.0/24
- 88.82.185.0/24
- 90.188.238.0/24
- 94.245.155.0/24
- 95.154.88.0/24
- 95.154.113.0/24
- 95.172.92.0/24
- 95.183.13.0/24
- 103.9.89.0/24
- 103.10.124.0/24
- 103.10.125.0/24
- 103.16.27.0/24
- 103.28.54.0/24
- 103.28.55.0/24
- 103.36.208.0/24
- 103.44.160.0/24
- 103.57.72.0/24
- 103.58.149.0/24
- 103.60.126.0/24
- 103.62.48.0/24
- 103.89.90.0/24
- 103.207.36.0/24
- 103.222.20.0/24
- 103.231.163.0/24
- 103.232.85.0/24
- 103.241.165.0/24
- 103.244.2.0/24
- 103.254.153.0/24
- 104.199.166.0/24
- 104.236.115.0/24
- 107.21.14.0/24
- 110.42.10.0/24
- 110.173.58.0/24
- 111.91.236.0/24
- 111.231.11.0/24
- 111.253.47.0/24
- 111.253.49.0/24
- 111.253.50.0/24
- 111.253.52.0/24
- 111.253.55.0/24
- 112.118.44.0/24
- 112.118.193.0/24
- 113.160.204.0/24
- 113.190.242.0/24
- 114.46.16.0/24
- 114.46.20.0/24
- 114.46.21.0/24
- 114.46.22.0/24
- 114.46.24.0/24
- 114.46.30.0/24
- 114.167.236.0/24
- 115.230.127.0/24
- 115.231.221.0/24
- 115.231.223.0/24
- 116.31.123.0/24
- 116.49.214.0/24
- 116.122.109.0/24
- 116.251.223.0/24
- 118.107.76.0/24
- 119.28.222.0/24
- 119.197.57.0/24
- 119.236.132.0/24
- 119.237.11.0/24
- 120.72.85.0/24
- 123.31.20.0/24
- 123.194.52.0/24
- 124.158.10.0/24
- 124.228.91.0/24
- 125.212.211.0/24
- 125.212.226.0/24
- 125.226.128.0/24
- 125.253.124.0/24
- 128.199.81.0/24
- 132.232.7.0/24
- 132.232.9.0/24
- 132.232.12.0/24
- 132.232.29.0/24
- 132.232.51.0/24
- 132.232.55.0/24
- 132.232.57.0/24
- 132.232.61.0/24
- 132.232.62.0/24
- 132.232.75.0/24
- 132.232.91.0/24
- 132.232.94.0/24
- 132.232.99.0/24
- 132.232.104.0/24
- 133.130.123.0/24
- 138.19.63.0/24
- 139.99.9.0/24
- 139.99.104.0/24
- 139.99.119.0/24
- 139.162.55.0/24
- 146.66.152.0/24
- 146.66.153.0/24
- 146.66.154.0/24
- 146.66.155.0/24
- 146.66.156.0/24
- 146.66.157.0/24
- 146.66.158.0/24
- 146.66.159.0/24
- 150.109.40.0/24
- 151.80.60.0/24
- 151.80.145.0/24
- 152.111.192.0/24
- 153.160.25.0/24
- 153.254.86.0/24
- 155.133.227.0/24
- 155.133.230.0/24
- 155.133.232.0/24
- 155.133.233.0/24
- 155.133.235.0/24
- 155.133.238.0/24
- 155.133.239.0/24
- 155.133.242.0/24
- 155.133.244.0/24
- 155.133.245.0/24
- 155.133.246.0/24
- 155.133.247.0/24
- 155.133.248.0/24
- 155.133.249.0/24
- 155.133.252.0/24
- 155.133.253.0/24
- 155.133.254.0/24
- 159.28.159.0/24
- 161.202.44.0/24
- 162.254.192.0/24
- 162.254.193.0/24
- 162.254.194.0/24
- 162.254.195.0/24
- 162.254.196.0/24
- 162.254.197.0/24
- 162.254.198.0/24
- 162.254.199.0/24
- 163.53.149.0/24
- 169.254.0.0/16
- 169.254.125.95/32
- 169.254.10.218/32
- 175.210.83.0/24
- 176.215.255.0/24
- 180.149.95.0/24
- 180.177.178.0/24
- 182.171.230.0/24
- 182.176.65.0/24
- 183.60.111.0/24
- 183.179.66.0/24
- 185.25.60.0/24
- 185.25.180.0/24
- 185.25.181.0/24
- 185.25.182.0/24
- 185.25.183.0/24
- 185.37.216.0/24
- 185.62.205.0/24
- 185.113.141.0/24
- 190.217.33.0/24
- 192.69.96.0/24
- 192.69.97.0/24
- 193.33.176.0/24
- 195.14.118.0/24
- 195.201.246.0/24
- 196.38.180.0/24
- 197.80.200.0/24
- 198.27.83.0/24
- 202.21.115.0/24
- 203.175.163.0/24
- 203.175.164.0/24
- 203.175.165.0/24
- 203.175.166.0/24
- 203.218.101.0/24
- 205.185.194.0/24
- 205.196.6.0/24
- 208.64.200.0/24
- 208.64.203.0/24
- 208.78.164.0/24
- 208.78.165.0/24
- 208.78.166.0/24
- 209.58.164.0/24
- 209.58.168.0/24
- 209.58.178.0/24
- 209.58.188.0/24
- 210.211.124.0/24
- 211.21.37.0/24
- 211.48.69.0/24
- 211.75.181.0/24
- 212.64.32.0/24
- 216.52.148.0/24
- 217.150.77.0/24
- 218.250.12.0/24
- 218.250.15.0/24
- 218.250.113.0/24
- 218.255.3.0/24
- 220.80.129.0/24
- 220.134.154.0/24
- 220.135.180.0/24
- 220.169.242.0/24
- 220.170.89.0/24
- 221.6.100.0/24
- 222.102.95.0/24
- 222.112.242.0/24
- 222.186.50.0/24
- 222.187.224.0/24
- 224.0.0.0/4
- 240.0.0.0/4

View File

@ -1,294 +0,0 @@
payload:
- 2.16.0.0/16
- 2.17.0.0/16
- 2.18.0.0/16
- 2.19.0.0/16
- 2.20.0.0/16
- 2.21.0.0/16
- 2.22.0.0/16
- 2.23.0.0/16
- 8.7.0.0/16
- 14.21.0.0/16
- 23.0.0.0/4
- 23.1.0.0/16
- 23.2.0.0/16
- 23.3.0.0/16
- 23.4.0.0/16
- 23.5.0.0/16
- 23.7.0.0/16
- 23.8.0.0/16
- 23.9.0.0/16
- 23.11.0.0/16
- 23.12.0.0/16
- 23.13.0.0/16
- 23.14.0.0/16
- 23.15.0.0/16
- 23.32.0.0/16
- 23.33.0.0/16
- 23.34.0.0/16
- 23.35.0.0/16
- 23.36.0.0/16
- 23.37.0.0/16
- 23.38.0.0/16
- 23.39.0.0/16
- 23.40.0.0/16
- 23.41.0.0/16
- 23.42.0.0/16
- 23.44.0.0/16
- 23.45.0.0/16
- 23.46.0.0/16
- 23.48.0.0/16
- 23.49.0.0/16
- 23.50.0.0/16
- 23.51.0.0/16
- 23.52.0.0/16
- 23.53.0.0/16
- 23.54.0.0/16
- 23.55.0.0/16
- 23.56.0.0/16
- 23.57.0.0/16
- 23.58.0.0/16
- 23.59.0.0/16
- 23.60.0.0/16
- 23.61.0.0/16
- 23.62.0.0/16
- 23.63.0.0/16
- 23.64.0.0/16
- 23.65.0.0/16
- 23.67.0.0/16
- 23.72.0.0/16
- 23.73.0.0/16
- 23.74.0.0/16
- 23.75.0.0/16
- 23.76.0.0/16
- 23.77.0.0/16
- 23.78.0.0/16
- 23.79.0.0/16
- 23.192.0.0/16
- 23.193.0.0/16
- 23.194.0.0/16
- 23.196.0.0/16
- 23.197.0.0/16
- 23.198.0.0/16
- 23.199.0.0/16
- 23.200.0.0/16
- 23.201.0.0/16
- 23.202.0.0/16
- 23.203.0.0/16
- 23.204.0.0/16
- 23.205.0.0/16
- 23.206.0.0/16
- 23.207.0.0/16
- 23.208.0.0/16
- 23.209.0.0/16
- 23.210.0.0/16
- 23.211.0.0/16
- 23.212.0.0/16
- 23.213.0.0/16
- 23.214.0.0/16
- 23.215.0.0/16
- 23.216.0.0/16
- 23.217.0.0/16
- 23.218.0.0/16
- 23.219.0.0/16
- 23.220.0.0/16
- 23.221.0.0/16
- 23.222.0.0/16
- 23.223.0.0/16
- 31.0.0.0/4
- 31.13.0.0/16
- 37.10.0.0/16
- 45.121.0.0/16
- 45.121.184.0/24
- 45.121.186.0/24
- 46.0.0.0/4
- 59.0.0.0/4
- 60.254.0.0/16
- 61.213.0.0/16
- 63.146.0.0/16
- 63.219.0.0/16
- 63.243.0.0/16
- 64.0.0.0/4
- 64.124.0.0/16
- 65.152.0.0/16
- 65.158.0.0/16
- 66.0.0.0/4
- 67.0.0.0/4
- 67.131.0.0/16
- 69.0.0.0/4
- 69.16.0.0/16
- 69.63.0.0/16
- 69.171.0.0/16
- 69.192.0.0/16
- 72.165.0.0/16
- 72.246.0.0/16
- 72.247.0.0/16
- 74.0.0.0/4
- 74.86.0.0/16
- 74.201.0.0/16
- 75.0.0.0/4
- 75.126.0.0/16
- 78.16.0.0/16
- 84.53.0.0/16
- 85.190.0.0/16
- 88.0.0.0/4
- 88.221.0.0/16
- 92.122.0.0/16
- 92.123.0.0/16
- 95.100.0.0/16
- 95.101.0.0/16
- 96.0.0.0/4
- 96.6.0.0/16
- 96.16.0.0/16
- 96.17.0.0/16
- 103.10.124.0/24
- 103.28.0.0/16
- 103.28.54.0/24
- 103.74.0.0/16
- 104.0.0.0/4
- 104.65.0.0/16
- 104.66.0.0/16
- 104.67.0.0/16
- 104.68.0.0/16
- 104.70.0.0/16
- 104.71.0.0/16
- 104.72.0.0/16
- 104.73.0.0/16
- 104.75.0.0/16
- 104.76.0.0/16
- 104.77.0.0/16
- 104.79.0.0/16
- 104.80.0.0/16
- 104.81.0.0/16
- 104.82.0.0/16
- 104.83.0.0/16
- 104.84.0.0/16
- 104.85.0.0/16
- 104.86.0.0/16
- 104.87.0.0/16
- 104.89.0.0/16
- 104.90.0.0/16
- 104.91.0.0/16
- 104.92.0.0/16
- 104.94.0.0/16
- 104.95.0.0/16
- 104.97.0.0/16
- 104.98.0.0/16
- 104.100.0.0/16
- 104.101.0.0/16
- 104.102.0.0/16
- 104.103.0.0/16
- 104.104.0.0/16
- 104.105.0.0/16
- 104.106.0.0/16
- 104.107.0.0/16
- 104.108.0.0/16
- 104.109.0.0/16
- 104.110.0.0/16
- 104.111.0.0/16
- 104.112.0.0/16
- 104.113.0.0/16
- 104.115.0.0/16
- 104.116.0.0/16
- 104.117.0.0/16
- 104.118.0.0/16
- 104.119.0.0/16
- 104.120.0.0/16
- 104.121.0.0/16
- 104.122.0.0/16
- 104.123.0.0/16
- 104.124.0.0/16
- 104.126.0.0/16
- 104.127.0.0/16
- 106.15.0.0/16
- 110.45.0.0/16
- 115.223.0.0/16
- 117.103.0.0/16
- 118.155.0.0/16
- 118.214.0.0/16
- 118.215.0.0/16
- 120.24.184.25/32
- 121.156.0.0/16
- 122.252.0.0/16
- 125.56.0.0/16
- 125.252.0.0/16
- 128.241.0.0/16
- 139.175.0.0/16
- 141.0.0.0/4
- 146.66.0.0/16
- 152.199.0.0/16
- 153.254.0.0/16
- 153.254.86.0/24
- 155.133.0.0/16
- 155.133.232.0/24
- 155.133.233.0/24
- 155.133.234.0/24
- 155.133.235.0/24
- 155.133.239.0/24
- 155.133.244.0/24
- 155.133.253.0/24
- 155.133.254.0/24
- 162.254.0.0/16
- 162.254.192.0/24
- 162.254.193.0/24
- 162.254.194.0/24
- 162.254.199.0/24
- 165.254.0.0/16
- 172.0.0.0/4
- 172.224.0.0/16
- 172.226.0.0/16
- 172.227.0.0/16
- 172.228.0.0/16
- 172.229.0.0/16
- 172.230.0.0/16
- 172.231.0.0/16
- 173.0.0.0/4
- 173.197.0.0/16
- 173.205.0.0/16
- 173.222.0.0/16
- 173.223.0.0/16
- 173.252.0.0/16
- 174.36.0.0/16
- 175.99.0.0/16
- 175.139.0.0/16
- 180.101.192.0/24
- 182.162.0.0/16
- 184.0.0.0/4
- 184.24.0.0/16
- 184.25.0.0/16
- 184.26.0.0/16
- 184.29.0.0/16
- 184.30.0.0/16
- 184.31.0.0/16
- 184.50.0.0/16
- 184.51.0.0/16
- 184.84.0.0/16
- 184.85.0.0/16
- 184.87.0.0/16
- 185.25.0.0/16
- 185.27.0.0/16
- 185.88.0.0/16
- 192.69.96.0/24
- 192.81.0.0/16
- 198.87.0.0/16
- 198.172.0.0/16
- 199.0.0.0/4
- 199.239.0.0/16
- 203.69.0.0/16
- 203.80.149.0/24
- 205.186.0.0/16
- 205.196.6.0/24
- 205.197.0.0/16
- 208.0.0.0/4
- 208.64.0.0/16
- 208.64.200.0/24
- 208.78.0.0/16
- 208.78.164.0/24
- 208.78.166.0/24
- 208.78.167.0/24
- 209.170.0.0/16
- 210.61.0.0/16
- 210.201.0.0/16
- 216.3.0.0/16
- 216.156.0.0/16
- 223.119.0.0/16

View File

@ -1,133 +0,0 @@
payload:
- 96.7.54.0/24
- 96.17.68.0/24
- 95.101.58.0/24
- 92.123.234.0/24
- 72.249.197.0/24
- 72.247.118.0/24
- 75.126.208.0/20
- 69.192.4.0/24
- 61.213.189.0/24
- 61.213.168.0/24
- 23.9.186.0/24
- 23.9.179.0/24
- 23.9.117.0/24
- 23.77.27.0/24
- 23.77.18.0/24
- 23.76.210.0/24
- 23.75.104.0/24
- 23.67.53.0/24
- 23.67.189.0/24
- 23.66.135.0/24
- 23.62.226.0/24
- 23.61.244.0/24
- 23.61.195.0/24
- 23.57.66.0/24
- 23.56.108.0/24
- 23.55.56.0/24
- 23.55.47.0/24
- 23.55.37.0/24
- 23.52.74.0/24
- 23.52.171.0/24
- 23.50.232.0/24
- 23.5.229.0/24
- 23.48.201.0/24
- 23.47.143.0/24
- 23.46.16.0/24
- 23.46.147.0/24
- 23.45.51.0/24
- 23.45.127.0/24
- 23.44.51.0/24
- 23.44.172.0/24
- 23.44.17.0/24
- 23.43.49.0/24
- 23.42.74.0/24
- 23.37.126.0/24
- 23.36.111.0/24
- 23.34.96.0/24
- 23.33.178.0/24
- 23.33.151.0/24
- 23.32.255.0/24
- 23.32.248.0/24
- 23.32.241.0/24
- 23.219.172.0/24
- 23.218.94.0/24
- 23.218.5.0/24
- 23.218.24.0/24
- 23.215.188.0/24
- 23.211.136.0/24
- 23.211.117.0/24
- 23.211.108.0/24
- 23.210.215.0/24
- 23.204.57.0/24
- 23.204.147.0/24
- 23.200.74.0/24
- 23.2.16.0/24
- 23.199.34.0/24
- 23.198.137.0/24
- 23.198.136.0/24
- 23.198.103.0/24
- 23.192.168.0/24
- 23.192.119.0/24
- 23.15.4.0/24
- 23.12.40.0/24
- 23.1.237.0/24
- 23.1.236.0/24
- 23.1.234.0/24
- 23.7.208.0/20
- 223.119.50.0/24
- 223.119.248.0/24
- 220.90.198.0/24
- 219.76.10.0/24
- 203.74.140.0/24
- 203.69.141.0/24
- 202.4.185.0/24
- 2.21.98.0/24
- 2.20.27.0/24
- 189.6.45.0/24
- 184.87.133.0/24
- 184.86.250.0/24
- 184.51.198.0/24
- 184.51.183.0/24
- 184.50.26.0/24
- 184.31.165.0/24
- 184.28.223.0/24
- 184.28.218.0/24
- 184.27.20.0/24
- 184.26.194.0/24
- 184.24.58.0/24
- 184.150.58.0/24
- 184.150.154.0/24
- 175.207.14.0/24
- 172.217.0.0/16
- 172.232.19.0/24
- 139.175.236.0/24
- 125.56.201.0/24
- 125.252.224.0/24
- 119.56.4.0/24
- 119.207.66.0/24
- 119.207.64.0/24
- 104.88.23.0/24
- 104.84.150.0/24
- 104.84.160.0/19
- 104.81.21.0/24
- 104.76.86.0/24
- 104.76.172.0/24
- 104.75.169.0/24
- 104.74.47.0/24
- 104.74.30.0/24
- 104.74.214.0/24
- 104.74.209.0/24
- 104.71.139.0/24
- 104.64.155.0/24
- 104.250.32.0/23
- 104.254.123.0/24
- 104.127.4.0/24
- 104.124.248.0/24
- 104.124.233.0/24
- 104.124.232.0/24
- 104.122.6.0/24
- 104.120.11.0/24
- 104.116.243.0/24
- 104.110.72.0/24
- 153.254.86.0/24

View File

@ -1,4 +0,0 @@
payload:
# > ABC
- DOMAIN-SUFFIX,edgedatg.com
- DOMAIN-SUFFIX,go.com

View File

@ -1,40 +0,0 @@
payload:
# > ChatGPT
- DOMAIN-SUFFIX,ai.com
- DOMAIN-SUFFIX,chatgpt.com
- DOMAIN-SUFFIX,openai.com
# > Chat GPT API & CDN
- DOMAIN-SUFFIX,cdn.oaistatic.com
- DOMAIN,chat.openai.com.cdn.cloudflare.net
- DOMAIN,openaiapi-site.azureedge.net
- DOMAIN,openaicom-api-bdcpf8c6d2e9atf6.z01.azurefd.net
- DOMAIN,openaicomproductionae4b.blob.core.windows.net
- DOMAIN,production-openaicom-storage.azureedge.net
- DOMAIN-SUFFIX,oaistatic.com
- DOMAIN-SUFFIX,oaiusercontent.com
- DOMAIN-SUFFIX,o33249.ingest.sentry.io
# > Claude
- DOMAIN-SUFFIX,anthropic.com
- DOMAIN-SUFFIX,claude.ai
# > Copilot
- DOMAIN-SUFFIX,copilot.microsoft.com
# > Gemini
- DOMAIN-SUFFIX,gemini.google.com
- DOMAIN-SUFFIX,generativelanguage.googleapis.com
- DOMAIN-SUFFIX,proactivebackend-pa.googleapis.com
# > Meta AI
- DOMAIN-SUFFIX,meta.ai
# > Perplexity AI
- DOMAIN-SUFFIX,perplexity.ai
# > Siri
- DOMAIN-SUFFIX,apple-relay.apple.com
- DOMAIN,guzzoni.smoot.apple.com

View File

@ -1,10 +0,0 @@
payload:
# > AbemaTV
# - USER-AGENT,AbemaTV*
- PROCESS-NAME,tv.abema
- DOMAIN-SUFFIX,abema.io
- DOMAIN-SUFFIX,abema.tv
- DOMAIN-SUFFIX,akamaized.net
- DOMAIN-SUFFIX,ameba.jp
- DOMAIN-SUFFIX,hayabusa.io
- DOMAIN-KEYWORD,abematv.akamaized.net

View File

@ -1,45 +0,0 @@
payload:
# > Amazon Prime Video
# - USER-AGENT,InstantVideo.US*
# - USER-AGENT,Prime%20Video*
- DOMAIN-KEYWORD,avoddashs
- DOMAIN-SUFFIX,aiv-cdn.net
- DOMAIN-SUFFIX,aiv-delivery.net
- DOMAIN-SUFFIX,amazonprimevideos.com
- DOMAIN-SUFFIX,amazonvideo.cc
- DOMAIN-SUFFIX,amazonvideo.com
- DOMAIN-SUFFIX,amazonvideodirect.cc
- DOMAIN-SUFFIX,atv-ext.amazon.com
- DOMAIN-SUFFIX,atv-ext-eu.amazon.com
- DOMAIN-SUFFIX,atv-ext-fe.amazon.com
- DOMAIN-SUFFIX,atv-ps.amazon.com
- DOMAIN-SUFFIX,atv-ps-eu.amazon.co.uk
- DOMAIN-SUFFIX,atv-ps-eu.amazon.com
- DOMAIN-SUFFIX,atv-ps-fe.amazon.co.jp
- DOMAIN-SUFFIX,atv-ps-fe.amazon.com
- DOMAIN-SUFFIX,fls-na.amazon.com
- DOMAIN-SUFFIX,media-amazon.com
- DOMAIN-SUFFIX,primevideo.cc
- DOMAIN-SUFFIX,primevideo.com
- DOMAIN-SUFFIX,prime-video.com
- DOMAIN-SUFFIX,primevideo.info
- DOMAIN-SUFFIX,primevideo.org
- DOMAIN-SUFFIX,primevideo.tv
- DOMAIN-SUFFIX,pv-cdn.net
- DOMAIN-SUFFIX,video.a2z.com
- DOMAIN,avodmp4s3ww-a.akamaihd.net
- DOMAIN,d1v5ir2lpwr8os.cloudfront.net
- DOMAIN,d1y002tclu9djj.cloudfront.net
- DOMAIN,d22qjgkvxw22r6.cloudfront.net
- DOMAIN,d25xi40x97liuc.cloudfront.net
- DOMAIN,dmqdd6hw24ucf.cloudfront.net
- DOMAIN,d27xxe7juh1us6.cloudfront.net
- DOMAIN,dualstack.pefs-alb-266603904.eu-west-1.elb.amazonaws.com
# // 美区网页版需二选一走代理,如 URL-REGEX 则需 MITM www.amazon.com
# // DOMAIN,www.amazon.com
# URL-REGEX,^https?:\/\/www\.amazon\.com\/(Amazon-Video|gp\/video)\/

View File

@ -1,33 +0,0 @@
payload:
# > Apple API
- DOMAIN-KEYWORD,apple.com.akadns.net
- DOMAIN-KEYWORD,icloud.com.akadns.net
- DOMAIN-SUFFIX,aaplimg.com
- DOMAIN-SUFFIX,apple.co
- DOMAIN-SUFFIX,apple.com
- DOMAIN-SUFFIX,apple-cloudkit.com
- DOMAIN-SUFFIX,apple-mapkit.com
- DOMAIN-SUFFIX,appsto.re
- DOMAIN-SUFFIX,cdn-apple.com
- DOMAIN-SUFFIX,icloud.com
- DOMAIN-SUFFIX,icloud-content.com
- DOMAIN-SUFFIX,itunes.com
- DOMAIN-SUFFIX,me.com
- DOMAIN-SUFFIX,mzstatic.com
- IP-CIDR,17.0.0.0/8,no-resolve
- IP-CIDR,63.92.224.0/19,no-resolve
- IP-CIDR,65.199.22.0/23,no-resolve
- IP-CIDR,139.178.128.0/18,no-resolve
- IP-CIDR,144.178.0.0/19,no-resolve
- IP-CIDR,144.178.36.0/22,no-resolve
- IP-CIDR,144.178.48.0/20,no-resolve
- IP-CIDR,192.35.50.0/24,no-resolve
- IP-CIDR,198.183.17.0/24,no-resolve
- IP-CIDR,205.180.175.0/24,no-resolve
# > Apple News
- DOMAIN-SUFFIX,apple.comscoreresearch.com
- DOMAIN-SUFFIX,apple.news
# > Apple Maps
- PROCESS-NAME,com.apple.geod

View File

@ -1,16 +0,0 @@
payload:
# > Apple Music
# - USER-AGENT,Music*
- PROCESS-NAME,music
- DOMAIN-SUFFIX,applemusic.com
- DOMAIN-SUFFIX,blobstore.apple.com
- DOMAIN-SUFFIX,music.apple.com
- DOMAIN,aod.itunes.apple.com
- DOMAIN,aod-ssl.itunes.apple.com
- DOMAIN,audio.itunes.apple.com
- DOMAIN,audio-ssl.itunes.apple.com
- DOMAIN,mvod.itunes.apple.com
- DOMAIN,streamingaudio.itunes.apple.com
# iCloud Music Library
- DOMAIN-SUFFIX,blobstore.apple.com

View File

@ -1,12 +0,0 @@
payload:
# > Apple News and Apple Map TOMTOM Version
# - USER-AGENT,AppleNews*
# - USER-AGENT,com.apple.news*
- DOMAIN,gspe1-ssl.ls.apple.com
# - USER-AGENT,News*
# - DOMAIN,apple.comscoreresearch.com
# - DOMAIN,gateway.icloud.com
# - DOMAIN,news-client.apple.com
# - DOMAIN,news-edge.apple.com
# - DOMAIN,news-events.apple.com
# - DOMAIN-SUFFIX,apple.news

View File

@ -1,5 +0,0 @@
payload:
# > Apple TV
- DOMAIN,np-edge.itunes.apple.com
- DOMAIN,play-edge.itunes.apple.com
- DOMAIN-SUFFIX,tv.apple.com

View File

@ -1,15 +0,0 @@
payload:
# > BBC iPlayer
- PROCESS-NAME,bbc.iplayer.android
- DOMAIN-KEYWORD,bbcfmt
- DOMAIN,aod-dash-uk-live.akamaized.net
- DOMAIN,aod-hls-uk-live.akamaized.net
- DOMAIN,vod-dash-uk-live.akamaized.net
- DOMAIN,vod-thumb-uk-live.akamaized.net
- DOMAIN-SUFFIX,bbc.co
- DOMAIN-SUFFIX,bbc.co.uk
- DOMAIN-SUFFIX,bbc.com
- DOMAIN-SUFFIX,bbcfmt.hs.llnwd.net
- DOMAIN-SUFFIX,bbci.co
- DOMAIN-SUFFIX,bbci.co.uk
- DOMAIN-SUFFIX,bidi.net.uk

View File

@ -1,8 +0,0 @@
payload:
# > Bahamut
# - USER-AGENT,Anime*
- PROCESS-NAME,tw.com.gamer.android.animad
- DOMAIN-SUFFIX,bahamut.com.tw
- DOMAIN-SUFFIX,gamer.com.tw
- DOMAIN,gamer-cds.cdn.hinet.net
- DOMAIN,gamer2-cds.cdn.hinet.net

View File

@ -1,16 +0,0 @@
payload:
# > Bilibili
# - USER-AGENT,bili*
- DOMAIN-SUFFIX,acg.tv
- DOMAIN-SUFFIX,acgvideo.com
- DOMAIN-SUFFIX,b23.tv
- DOMAIN-SUFFIX,bilibili.com
- DOMAIN-SUFFIX,bilibili.tv
- DOMAIN-SUFFIX,biliapi.net
- DOMAIN-SUFFIX,biliapi.com
- DOMAIN-SUFFIX,bilivideo.com
- DOMAIN-SUFFIX,hdslb.com
- DOMAIN,upos-hz-mirrorakam.akamaized.net
# Hong Kong, Macau, Taiwan
# - USER-AGENT,bili-inter*
- DOMAIN,apiintl.biliapi.net

View File

@ -1,300 +0,0 @@
payload:
# > Forum
- DOMAIN-SUFFIX,bitcointalk.org
# > Exchange
- DOMAIN-SUFFIX,aex.com
- DOMAIN-SUFFIX,bibox.com
- DOMAIN-SUFFIX,bitfinex.com
- DOMAIN-SUFFIX,bithumb.com
- DOMAIN-SUFFIX,bitmex.com
- DOMAIN-SUFFIX,bitstamp.net
- DOMAIN-SUFFIX,bittrex.com
- DOMAIN-SUFFIX,bybit.com
- DOMAIN-SUFFIX,coinbase.com
- DOMAIN-SUFFIX,coincheck.com
- DOMAIN-SUFFIX,coinone.co.kr
- DOMAIN-SUFFIX,gemini.com
- DOMAIN-SUFFIX,korbit.co.kr
- DOMAIN-SUFFIX,kraken.com
- DOMAIN-SUFFIX,kucoin.com
- DOMAIN-SUFFIX,liquid.com
- DOMAIN-SUFFIX,poloniex.com
- DOMAIN-SUFFIX,bitbank.cc
- DOMAIN-SUFFIX,bitcoin.org
- DOMAIN-SUFFIX,bitquick.co
- DOMAIN-SUFFIX,btcbox.co.jp
- DOMAIN-SUFFIX,cex.io
- DOMAIN-SUFFIX,dogecoin.com
- DOMAIN-SUFFIX,paxful.com
- DOMAIN-SUFFIX,tether.to
- DOMAIN-SUFFIX,dydx.exchange
- DOMAIN-SUFFIX,solana.com
- DOMAIN-SUFFIX,avax.network
- DOMAIN-SUFFIX,optimism.io
- DOMAIN-SUFFIX,arbitrum.io
- DOMAIN-SUFFIX,poly.network
- DOMAIN-SUFFIX,zkscan.io
- DOMAIN-SUFFIX,zksync.io
- DOMAIN-SUFFIX,boba.network
# > Binance
- DOMAIN-SUFFIX,binance.cc
- DOMAIN-SUFFIX,binance.cloud
- DOMAIN-SUFFIX,binance.com
- DOMAIN-SUFFIX,binance.im
- DOMAIN-SUFFIX,binance.me
- DOMAIN-SUFFIX,binance.us
- DOMAIN-SUFFIX,bnappzh.co
- DOMAIN-SUFFIX,bnappzh.com
- DOMAIN-SUFFIX,bnbstatic.com
- DOMAIN-SUFFIX,bntrace.com
- DOMAIN-SUFFIX,binance.charity
- DOMAIN-SUFFIX,binance.co
- DOMAIN-SUFFIX,binance.info
- DOMAIN-SUFFIX,binance.net
- DOMAIN-SUFFIX,binance.org
- DOMAIN-SUFFIX,binance.vision
- DOMAIN-SUFFIX,binanceapi.com
- DOMAIN-SUFFIX,binancezh.be
- DOMAIN-SUFFIX,binancezh.biz
- DOMAIN-SUFFIX,binancezh.cc
- DOMAIN-SUFFIX,binancezh.co
- DOMAIN-SUFFIX,binancezh.com
- DOMAIN-SUFFIX,binancezh.info
- DOMAIN-SUFFIX,binancezh.ink
- DOMAIN-SUFFIX,binancezh.kim
- DOMAIN-SUFFIX,binancezh.link
- DOMAIN-SUFFIX,binancezh.live
- DOMAIN-SUFFIX,binancezh.mobi
- DOMAIN-SUFFIX,binancezh.net
- DOMAIN-SUFFIX,binancezh.pro
- DOMAIN-SUFFIX,binancezh.sh
- DOMAIN-SUFFIX,binancezh.top
- DOMAIN-SUFFIX,bnappzh.mobi
- DOMAIN-SUFFIX,bsc.getblock.io
- DOMAIN-SUFFIX,bscscan.com
- PROCESS-NAME,Binance.exe
- DOMAIN-KEYWORD,binance
# > Huobi
- DOMAIN-SUFFIX,hbabit.com
- DOMAIN-SUFFIX,hbfile.net
- DOMAIN-SUFFIX,huobi.com
- DOMAIN-SUFFIX,huobi.me
- DOMAIN-SUFFIX,huobi.pro
- DOMAIN-SUFFIX,huobi.sc
- DOMAIN-SUFFIX,huobiasia.vip
- DOMAIN-SUFFIX,huobigroup.com
- DOMAIN-SUFFIX,huobitoken.com
- DOMAIN-SUFFIX,heco-scan.com
- DOMAIN-SUFFIX,hecoview.com
- DOMAIN-SUFFIX,hbfile.net
- DOMAIN-SUFFIX,huobi.br.com
- DOMAIN-SUFFIX,bitderiv.com
- DOMAIN-SUFFIX,hecochain.com
- DOMAIN-SUFFIX,huobi.ws
- DOMAIN-SUFFIX,huobi.ug
- DOMAIN-SUFFIX,huobi.co.ma
- DOMAIN-SUFFIX,huobi.br.com
- PROCESS-NAME,Huobi.exe
- DOMAIN-KEYWORD,huobi
# > OKX
- DOMAIN-SUFFIX,okex.com
- DOMAIN-SUFFIX,okx.com
- PROCESS-NAME,OKX.exe
- DOMAIN-KEYWORD,okx
# > asproex
- DOMAIN-SUFFIX,asproex.com
- DOMAIN-SUFFIX,asproexapi.com
# > bitflyer
- DOMAIN-SUFFIX,bitflyer.com
- DOMAIN-SUFFIX,bitflyer.jp
# > bitsquare
- DOMAIN-SUFFIX,bisq.io
- DOMAIN-SUFFIX,bisq.network
- DOMAIN-SUFFIX,bitsquare.io
# > coinone
- DOMAIN-SUFFIX,coinone.co.kr
- DOMAIN-SUFFIX,coinonecore.com
- DOMAIN-SUFFIX,coinonecorp.com
# > ethereum
- DOMAIN-SUFFIX,devcon.org
- DOMAIN-SUFFIX,ethereum.foundation
- DOMAIN-SUFFIX,ethereum.org
- DOMAIN-SUFFIX,etherscan.io
- DOMAIN-SUFFIX,nansen.ai
- DOMAIN-SUFFIX,ethgasstation.info
- DOMAIN-SUFFIX,watchtheburn.com
- DOMAIN-SUFFIX,flashbots.net
- DOMAIN-SUFFIX,cryptofees.info
- DOMAIN-SUFFIX,etherscan.io
- DOMAIN-SUFFIX,ethereum-magicians.org
- DOMAIN-SUFFIX,vitalik.ca
- DOMAIN-SUFFIX,ethfans.org
- DOMAIN-SUFFIX,ethereum.cn
- DOMAIN-SUFFIX,ethereum.stackexchange.com
- DOMAIN-SUFFIX,etherscan.com
- DOMAIN-SUFFIX,parity.io
- DOMAIN-SUFFIX,ethernodes.org
# > localbitcoins
- DOMAIN-SUFFIX,localbitcoins.com
- DOMAIN-SUFFIX,localbitcoinschain.com
# > zb
- DOMAIN-SUFFIX,zb.app
- DOMAIN-SUFFIX,zb.com
- DOMAIN-SUFFIX,zb.io
- DOMAIN-SUFFIX,zb.live
# > Analysis
- DOMAIN-SUFFIX,aicoin.com
- DOMAIN-SUFFIX,aimoon.com
- DOMAIN-SUFFIX,coingecko.com
- DOMAIN-SUFFIX,coinmarketcap.com
- DOMAIN-SUFFIX,glassnode.com
- DOMAIN-SUFFIX,coinmetrics.io
- DOMAIN-SUFFIX,tokenview.com
- DOMAIN-SUFFIX,oklink.com
- DOMAIN-SUFFIX,blockchair.com
- DOMAIN-SUFFIX,intotheblock.com
- DOMAIN-SUFFIX,bytetree.com
- DOMAIN-SUFFIX,coin.dance
- DOMAIN-SUFFIX,defieye.io
- DOMAIN-SUFFIX,duneanalytics.com
- DOMAIN-SUFFIX,tokenterminal.com
- DOMAIN-SUFFIX,dapp.review
- DOMAIN-SUFFIX,dappradar.com
- DOMAIN-SUFFIX,stateofthedapps.com
- DOMAIN-SUFFIX,thegraph.com
- DOMAIN-SUFFIX,debank.com
- DOMAIN-SUFFIX,vfat.tools
- DOMAIN-SUFFIX,loanscan.io
- DOMAIN-SUFFIX,defirate.com
- DOMAIN-SUFFIX,defipulse.com
- DOMAIN-SUFFIX,apy999.com
- DOMAIN-SUFFIX,defieye.io
- DOMAIN-SUFFIX,dextools.io
- DOMAIN-SUFFIX,tradingview.com
- DOMAIN-SUFFIX,dcabtc.com
- DOMAIN-SUFFIX,chainalysis.com
- DOMAIN-SUFFIX,cryptoquant.com
- DOMAIN-SUFFIX,viewbase.com
- DOMAIN-SUFFIX,bitcoinity.org
- DOMAIN-SUFFIX,cryptocompare.com
- DOMAIN-SUFFIX,coincodex.com
- DOMAIN-SUFFIX,cointrendz.com
- DOMAIN-SUFFIX,coincheckup.com
- DOMAIN-SUFFIX,thetie.io
- DOMAIN-SUFFIX,cryptorank.io
- DOMAIN-SUFFIX,tradeblock.com
- DOMAIN-SUFFIX,nyctale.io
- DOMAIN-SUFFIX,dovemetrics.com
- DOMAIN-SUFFIX,cryptorank.io
- DOMAIN-SUFFIX,icodrops.com
- DOMAIN-SUFFIX,chainbroker.io
- DOMAIN-SUFFIX,crunchbase.com
- DOMAIN-SUFFIX,defillama.com
- DOMAIN-SUFFIX,coinowo.com
- DOMAIN-SUFFIX,earni.fi
- DOMAIN-SUFFIX,dropsearn.com
- DOMAIN-SUFFIX,bitcoin.it
- DOMAIN-SUFFIX,bitcoinmagazine.com
- DOMAIN-SUFFIX,blockchain.com
- DOMAIN-SUFFIX,tronscan.org
# > POOL
- DOMAIN-SUFFIX,btc.com
- DOMAIN-SUFFIX,f2pool.com
- DOMAIN-SUFFIX,cbeci.org
- DOMAIN-SUFFIX,digiconomist.net
- DOMAIN-SUFFIX,1ml.com
- DOMAIN-SUFFIX,bitcoinvisuals.com
- DOMAIN-SUFFIX,crypto51.app
- DOMAIN-SUFFIX,masternodes.online
- DOMAIN-SUFFIX,bitnodes.earn.com
- DOMAIN-SUFFIX,poolin.com
- DOMAIN-SUFFIX,ethermine.org
- DOMAIN-SUFFIX,ewapool.net
# > FTX
- DOMAIN-SUFFIX,ftx.com
# > Metamask
- DOMAIN-KEYWORD,metamask
- DOMAIN,token-api.metaswap.codefi.network
- DOMAIN,min-api.cryptocompare.com
# > NFT
- DOMAIN-SUFFIX,opensea.io
- DOMAIN-SUFFIX,nftscan.com
- DOMAIN-SUFFIX,makersplace.com
- DOMAIN-SUFFIX,nonfungible.com
- DOMAIN-SUFFIX,cryptoslam.io
- DOMAIN-SUFFIX,cryptoart.io
- DOMAIN-SUFFIX,nftcalendar.io
- DOMAIN-SUFFIX,nftgo.io
# > IPFS
- DOMAIN-SUFFIX,filecoin.io
- DOMAIN-SUFFIX,docs.lotu.sh
- DOMAIN-SUFFIX,ipfs.io
- DOMAIN-SUFFIX,docs.ipfs.io
- DOMAIN-SUFFIX,discuss.ipfs.io
# > EOS
- DOMAIN-SUFFIX,eos.io
- DOMAIN-SUFFIX,developers.eos.io
- DOMAIN-SUFFIX,block.one
- DOMAIN-SUFFIX,eostracker.io
- DOMAIN-SUFFIX,eosflare.io
- DOMAIN-SUFFIX,eospark.com
- DOMAIN-SUFFIX,bloks.io
# > Lightning
- DOMAIN-SUFFIX,lightning.engineering
- DOMAIN-SUFFIX,lightning.community
- DOMAIN-SUFFIX,acinq.co
- DOMAIN-SUFFIX,1ml.com
# > Token
- DOMAIN-SUFFIX,tokenpocket.pro
- DOMAIN-SUFFIX,token.im
- DOMAIN-SUFFIX,phantom.app
- DOMAIN-SUFFIX,tronlink.org
- DOMAIN-SUFFIX,myetherwallet.com
- DOMAIN-SUFFIX,jaxx.io
- DOMAIN-SUFFIX,trustwalletapp.com
# > Gate
- DOMAIN-SUFFIX,gate.ac
- DOMAIN-SUFFIX,gate.io
# > Mexc
- DOMAIN-SUFFIX,mexc.com
# > Dapp
- DOMAIN-SUFFIX,sushi.com
- DOMAIN-SUFFIX,uniswap.org
- DOMAIN-SUFFIX,sunswap.com
- DOMAIN-SUFFIX,traderjoexyz.com
- DOMAIN-SUFFIX,raydium.io
- DOMAIN-SUFFIX,synthetix.io
- DOMAIN-SUFFIX,aave.com
- DOMAIN-SUFFIX,compound.finance
- DOMAIN-SUFFIX,makerdao.com
- DOMAIN-SUFFIX,wbtc.network
- DOMAIN-SUFFIX,pancakeswap.finance
- DOMAIN-SUFFIX,pancakeswap.com
- DOMAIN-SUFFIX,mdex.co
- DOMAIN-SUFFIX,mdex.one
- DOMAIN-SUFFIX,mdex.com
- DOMAIN-SUFFIX,mdex.me
- DOMAIN-SUFFIX,1inch.io

View File

@ -1,25 +0,0 @@
payload:
# > DAZN
# - USER-AGENT,DAZN*
- PROCESS-NAME,com.dazn
- DOMAIN-KEYWORD,voddazn
- DOMAIN-SUFFIX,dazn.com
- DOMAIN-SUFFIX,dazn-api.com
- DOMAIN-SUFFIX,dazndn.com
- DOMAIN-SUFFIX,daznedge.net
- DOMAIN-SUFFIX,daznfeeds.com
- DOMAIN-SUFFIX,daznservices.com
- DOMAIN-SUFFIX,indazn.com
- DOMAIN-SUFFIX,indaznlab.com
- DOMAIN,daznfeeds.com.edgekey.net
- DOMAIN,dca-lm-livedazn.secure.footprint.net
- DOMAIN,h-dazn.online-metrix.net
- DOMAIN,images-daznservices-com.cdn.ampproject.org
- DOMAIN,d151l6v8er5bdm.cloudfront.net
- IP-CIDR,185.42.236.0/24,no-resolve
- IP-CIDR,185.42.238.0/24,no-resolve

View File

@ -1,8 +0,0 @@
payload:
# > Discord
- DOMAIN-SUFFIX,discord.com
- DOMAIN-SUFFIX,discord.gg
- DOMAIN-SUFFIX,discord.media
- DOMAIN-SUFFIX,discordapp.com
- DOMAIN-SUFFIX,discordapp.net
- DOMAIN-SUFFIX,discordstatus.com

View File

@ -1,11 +0,0 @@
payload:
# > Discovery Plus
- PROCESS-NAME,com.discovery.discoveryplus.mobile
- DOMAIN-SUFFIX,content-ause1-ur-discovery1.uplynk.com
- DOMAIN-SUFFIX,disco-api.com
- DOMAIN-SUFFIX,discoveryplus.com
- DOMAIN-SUFFIX,fwmrm.net
- DOMAIN-SUFFIX,getblueshift.com
- DOMAIN-SUFFIX,litix.io
- DOMAIN-SUFFIX,mobile-collector.newrelic.com
- DOMAIN-SUFFIX,uplynk.com

View File

@ -1,21 +0,0 @@
payload:
# > Disney Plus
# - USER-AGENT,Disney*
- PROCESS-NAME,com.disney.disneyplus
- DOMAIN-SUFFIX,adobedtm.com
- DOMAIN-SUFFIX,bam.nr-date.net
- DOMAIN-SUFFIX,bamgrid.com
- DOMAIN-SUFFIX,braze.com
- DOMAIN-SUFFIX,cdn.optimizely.com
- DOMAIN-SUFFIX,d9.flashtalking.com
- DOMAIN-SUFFIX,disney.demdex.net
- DOMAIN-SUFFIX,disney.my.sentry.io
- DOMAIN-SUFFIX,disneyplus.bn5x.net
- DOMAIN-SUFFIX,disneyplus.com
- DOMAIN-SUFFIX,disneyplus.com.ssl.sc.omtrdc.net
- DOMAIN-SUFFIX,disney-plus.net
- DOMAIN-SUFFIX,disney-portal.my.onetrust.com
- DOMAIN-SUFFIX,dssott.com
- DOMAIN-SUFFIX,registerdisney.go.com

View File

@ -1,335 +0,0 @@
payload:
# China Banks
# > Agricultural Bank of China
- DOMAIN-SUFFIX,abchina.com
- DOMAIN-SUFFIX,abchina.com.cn
# > Bank of China
- DOMAIN-SUFFIX,boc.cn
# > China Citic Bank
- DOMAIN-SUFFIX,citicbank.com
- DOMAIN-SUFFIX,ecitic.com
- DOMAIN-SUFFIX,ecitic.net
# > China Construction Bank
- DOMAIN-SUFFIX,ccb.com
- DOMAIN-SUFFIX,ccb.com.cn
# > China Everbright Bank
- DOMAIN-SUFFIX,cebbank.com
# > China Merchants Bank
# - USER-AGENT,cmb*
- DOMAIN-SUFFIX,cmbchina.com
- DOMAIN-SUFFIX,cmbimg.com
- DOMAIN-SUFFIX,cmbt.cn
- DOMAIN-SUFFIX,mbcloud.com
# > Industrial and Commercial Bank of China
# - USER-AGENT,%E4%B8%AD%E5%9B%BD%E5%B7%A5%E5%95%86%E9%93%B6%E8%A1%8C*
- DOMAIN-SUFFIX,icbc.com.cn
# > Ping An Bank
- DOMAIN-SUFFIX,pingan.com
- DOMAIN-SUFFIX,pingan.com.cn
# Type
# > Beplay
- DOMAIN-KEYWORD,beplay
# > Blizzard
# - USER-AGENT,hearthstone*
- DOMAIN,cdp.cloud.unity3d.com
- DOMAIN-SUFFIX,battle.net
- DOMAIN-SUFFIX,battlenet.com
- DOMAIN-SUFFIX,blizzard.com
# > Prior
- DOMAIN,client.amplifi.com
- DOMAIN,ip.bjango.com
- DOMAIN-SUFFIX,alphassl.com
- DOMAIN-SUFFIX,edu.cn
# > RRYS
- DOMAIN-SUFFIX,p4pfile.com
- DOMAIN-SUFFIX,zmzfile.com
# > Sony
# - USER-AGENT,RemotePlay*
- DOMAIN-SUFFIX,playstation.com
- DOMAIN-SUFFIX,playstation.net
- DOMAIN-SUFFIX,playstationnetwork.com
- DOMAIN-SUFFIX,sony.com
- DOMAIN-SUFFIX,sonyentertainmentnetwork.com
# > TeamViewer
- IP-CIDR,185.188.32.0/24,no-resolve
- IP-CIDR,185.188.33.0/24,no-resolve
- IP-CIDR,185.188.34.0/24,no-resolve
- IP-CIDR,185.188.35.0/24,no-resolve
- IP-CIDR6,2a0b:b580::/48,no-resolve
- IP-CIDR6,2a0b:b581::/48,no-resolve
- IP-CIDR6,2a0b:b582::/48,no-resolve
- IP-CIDR6,2a0b:b583::/48,no-resolve
# > Tencent
- IP-CIDR,182.254.116.0/24,no-resolve
# > Tencent WeChat (International)
- IP-CIDR,101.32.104.0/21,DIRECT,no-resolve
- IP-CIDR,101.32.118.0/23,DIRECT,no-resolve
- IP-CIDR,101.32.96.0/20,DIRECT,no-resolve
- IP-CIDR,129.226.0.0/16,DIRECT,no-resolve
- IP-CIDR,183.128.0.0/11,DIRECT,no-resolve
- IP-CIDR,183.131.48.0/20,DIRECT,no-resolve
- DOMAIN-SUFFIX,10010.com
- DOMAIN-SUFFIX,10086.cn
- DOMAIN-SUFFIX,12306.cn
- DOMAIN-SUFFIX,12306.com
- DOMAIN-SUFFIX,126.net
- DOMAIN-SUFFIX,163.com
- DOMAIN-SUFFIX,189.cn
- DOMAIN-SUFFIX,360.cn
- DOMAIN-SUFFIX,360.com
- DOMAIN-SUFFIX,360buy.com
- DOMAIN-SUFFIX,360buyimg.com
- DOMAIN-SUFFIX,36kr.com
- DOMAIN-SUFFIX,51ym.me
- DOMAIN-SUFFIX,58.com
- DOMAIN-SUFFIX,8686c.com
- DOMAIN-SUFFIX,95516.com
- DOMAIN-SUFFIX,abercrombie.com
- DOMAIN-SUFFIX,acfun.tv
- DOMAIN-SUFFIX,adobesc.com
- DOMAIN-SUFFIX,air-matters.com
- DOMAIN-SUFFIX,air-matters.io
- DOMAIN-SUFFIX,aixifan.com
- DOMAIN-SUFFIX,akadns.net
- DOMAIN-SUFFIX,alibaba.com
- DOMAIN-SUFFIX,alibabacloud.com
- DOMAIN-SUFFIX,alicdn.com
- DOMAIN-SUFFIX,alipay.com
- DOMAIN-SUFFIX,alipayobjects.com
- DOMAIN-SUFFIX,aliyun.com
- DOMAIN-SUFFIX,aliyuncs.com
- DOMAIN-SUFFIX,amap.com
- DOMAIN-SUFFIX,appshike.com
- DOMAIN-SUFFIX,appstore.com
- DOMAIN-SUFFIX,autonavi.com
- DOMAIN-SUFFIX,bababian.com
- DOMAIN-SUFFIX,baidu.com
- DOMAIN-SUFFIX,baidupcs.com
- DOMAIN-SUFFIX,bdimg.com
- DOMAIN-SUFFIX,bdstatic.com
- DOMAIN-SUFFIX,beatsbydre.com
- DOMAIN-SUFFIX,broadcasthe.net
- DOMAIN-SUFFIX,caiyunapp.com
- DOMAIN-SUFFIX,ccgslb.com
- DOMAIN-SUFFIX,ccgslb.net
- DOMAIN-SUFFIX,chinacache.net
- DOMAIN-SUFFIX,chunbo.com
- DOMAIN-SUFFIX,chunboimg.com
- DOMAIN-SUFFIX,clashroyaleapp.com
- DOMAIN-SUFFIX,clouddn.com
- DOMAIN-SUFFIX,cloudsigma.com
- DOMAIN-SUFFIX,cloudxns.net
- DOMAIN-SUFFIX,cmct.tv
- DOMAIN-SUFFIX,cmfu.com
- DOMAIN-SUFFIX,cnbeta.com
- DOMAIN-SUFFIX,cnbetacdn.com
- DOMAIN-SUFFIX,chdbits.co
- DOMAIN-SUFFIX,cnlang.org
- DOMAIN-SUFFIX,coolapk.com
- DOMAIN-SUFFIX,cn88.net
- DOMAIN-SUFFIX,dct-cloud.com
- DOMAIN-SUFFIX,didialift.com
- DOMAIN-SUFFIX,digicert.com
- DOMAIN-SUFFIX,douban.com
- DOMAIN-SUFFIX,doubanio.com
- DOMAIN-SUFFIX,douyin.com
- DOMAIN-SUFFIX,douyu.com
- DOMAIN-SUFFIX,douyu.tv
- DOMAIN-SUFFIX,douyutv.com
- DOMAIN-SUFFIX,duokan.com
- DOMAIN-SUFFIX,duoshuo.com
- DOMAIN-SUFFIX,dytt8.net
- DOMAIN-SUFFIX,easou.com
- DOMAIN-SUFFIX,eudic.net
- DOMAIN-SUFFIX,ewqcxz.com
- DOMAIN-SUFFIX,feng.com
- DOMAIN-SUFFIX,fir.im
- DOMAIN-SUFFIX,firefox.com
- DOMAIN-SUFFIX,frdic.com
- DOMAIN-SUFFIX,fresh-ideas.cc
- DOMAIN-SUFFIX,gameloft.com
- DOMAIN-SUFFIX,garmin.com
- DOMAIN-SUFFIX,geetest.com
- DOMAIN-SUFFIX,godic.net
- DOMAIN-SUFFIX,goodread.com
- DOMAIN-SUFFIX,goofish.com
- DOMAIN-SUFFIX,gtimg.com
- DOMAIN-SUFFIX,haibian.com
- DOMAIN-SUFFIX,hao123.com
- DOMAIN-SUFFIX,haosou.com
- DOMAIN-SUFFIX,hdchina.org
- DOMAIN-SUFFIX,hdcmct.org
- DOMAIN-SUFFIX,hjfile.cn
- DOMAIN-SUFFIX,hkserversolution.com
- DOMAIN-SUFFIX,hollisterco.com
- DOMAIN-SUFFIX,hongxiu.com
- DOMAIN-SUFFIX,hujiang.com
- DOMAIN-SUFFIX,hxcdn.net
- DOMAIN-SUFFIX,icedropper.com
- DOMAIN-SUFFIX,iciba.com
- DOMAIN-SUFFIX,ifeng.com
- DOMAIN-SUFFIX,ifengimg.com
- DOMAIN-SUFFIX,images-amazon.com
- DOMAIN-SUFFIX,img4me.com
- DOMAIN-SUFFIX,ithome.com
- DOMAIN-SUFFIX,ixdzs.com
- DOMAIN-SUFFIX,jd.com
- DOMAIN-SUFFIX,jd.hk
- DOMAIN-SUFFIX,jianshu.com
- DOMAIN-SUFFIX,jianshu.io
- DOMAIN-SUFFIX,jianshuapi.com
- DOMAIN-SUFFIX,jiathis.com
- DOMAIN-SUFFIX,jomodns.com
- DOMAIN-SUFFIX,jsboxbbs.com
- DOMAIN-SUFFIX,knewone.com
- DOMAIN-SUFFIX,kuaidi100.com
- DOMAIN-SUFFIX,kugou.com
- DOMAIN-SUFFIX,lecloud.com
- DOMAIN-SUFFIX,lemicp.com
- DOMAIN-SUFFIX,letv.com
- DOMAIN-SUFFIX,letvcloud.com
- DOMAIN-SUFFIX,liyuans.com
- DOMAIN-SUFFIX,lizhi.io
- DOMAIN-SUFFIX,localizecdn.com
- DOMAIN-SUFFIX,lucifr.com
- DOMAIN-SUFFIX,luoo.net
- DOMAIN-SUFFIX,lxdns.com
- DOMAIN-SUFFIX,mai.tn
- DOMAIN-SUFFIX,meizu.com
- DOMAIN-SUFFIX,metatrader4.com
- DOMAIN-SUFFIX,metatrader5.com
- DOMAIN-SUFFIX,mi.com
- DOMAIN-SUFFIX,miaopai.com
- DOMAIN-SUFFIX,miui.com
- DOMAIN-SUFFIX,miwifi.com
- DOMAIN-SUFFIX,mob.com
- DOMAIN-SUFFIX,moji.com
- DOMAIN-SUFFIX,moke.com
- DOMAIN-SUFFIX,mxhichina.com
- DOMAIN-SUFFIX,myqcloud.com
- DOMAIN-SUFFIX,myunlu.com
- DOMAIN-SUFFIX,ngabbs.com
- DOMAIN-SUFFIX,netease.com
- DOMAIN-SUFFIX,nfoservers.com
- DOMAIN-SUFFIX,nssurge.com
- DOMAIN-SUFFIX,nuomi.com
- DOMAIN-SUFFIX,ourbits.club
- DOMAIN-SUFFIX,ourdvs.com
- DOMAIN-SUFFIX,passthepopcorn.me
- DOMAIN-SUFFIX,pgyer.com
- DOMAIN-SUFFIX,pniao.com
- DOMAIN-SUFFIX,privatehd.to
- DOMAIN-SUFFIX,qbox.me
- DOMAIN-SUFFIX,qcloud.com
- DOMAIN-SUFFIX,qdaily.com
- DOMAIN-SUFFIX,qdmm.com
- DOMAIN-SUFFIX,qhimg.com
- DOMAIN-SUFFIX,qidian.com
- DOMAIN-SUFFIX,qihucdn.com
- DOMAIN-SUFFIX,qin.io
- DOMAIN-SUFFIX,qingmang.me
- DOMAIN-SUFFIX,qingmang.mobi
- DOMAIN-SUFFIX,qiniucdn.com
- DOMAIN-SUFFIX,qiniudn.com
- DOMAIN-SUFFIX,qq.com
- DOMAIN-SUFFIX,qqurl.com
- DOMAIN-SUFFIX,rarbg.to
- DOMAIN-SUFFIX,redacted.ch
- DOMAIN-SUFFIX,rrmj.tv
- DOMAIN-SUFFIX,ruguoapp.com
- DOMAIN-SUFFIX,sandai.net
- DOMAIN-SUFFIX,sf-express.com
- DOMAIN-SUFFIX,sinaapp.com
- DOMAIN-SUFFIX,sinaimg.cn
- DOMAIN-SUFFIX,sinaimg.com
- DOMAIN-SUFFIX,sm.ms
- DOMAIN-SUFFIX,smzdm.com
- DOMAIN-SUFFIX,snwx.com
- DOMAIN-SUFFIX,so.com
- DOMAIN-SUFFIX,sogou.com
- DOMAIN-SUFFIX,sogoucdn.com
- DOMAIN-SUFFIX,sohu.com
- DOMAIN-SUFFIX,soku.com
- DOMAIN-SUFFIX,soso.com
- DOMAIN-SUFFIX,sspai.com
- DOMAIN-SUFFIX,startssl.com
- DOMAIN-SUFFIX,suning.com
- DOMAIN-SUFFIX,symcd.com
- DOMAIN-SUFFIX,taobao.com
- DOMAIN-SUFFIX,tawk.link
- DOMAIN-SUFFIX,tawk.to
- DOMAIN-SUFFIX,tenpay.com
- DOMAIN-SUFFIX,tietuku.com
- DOMAIN-SUFFIX,tmall.com
- DOMAIN-SUFFIX,tmzvps.com
- DOMAIN-SUFFIX,trello.com
- DOMAIN-SUFFIX,trellocdn.com
- DOMAIN-SUFFIX,totheglory.im
- DOMAIN-SUFFIX,ttmeiju.com
- DOMAIN-SUFFIX,tudou.com
- DOMAIN-SUFFIX,udache.com
- DOMAIN-SUFFIX,umengcloud.com
- DOMAIN-SUFFIX,upaiyun.com
- DOMAIN-SUFFIX,upyun.com
- DOMAIN-SUFFIX,uxengine.net
- DOMAIN-SUFFIX,wandoujia.com
- DOMAIN-SUFFIX,weather.bjango.com
- DOMAIN-SUFFIX,weather.com
- DOMAIN-SUFFIX,webqxs.com
- DOMAIN-SUFFIX,weibo.cn
- DOMAIN-SUFFIX,weibo.com
- DOMAIN-SUFFIX,weico.cc
- DOMAIN-SUFFIX,weiphone.com
- DOMAIN-SUFFIX,weiphone.net
- DOMAIN-SUFFIX,wenku8.net
- DOMAIN-SUFFIX,werewolf.53site.com
- DOMAIN-SUFFIX,wkcdn.com
- DOMAIN-SUFFIX,xdrig.com
- DOMAIN-SUFFIX,xhostfire.com
- DOMAIN-SUFFIX,xhscdn.com
- DOMAIN-SUFFIX,xiaohongshu.com
- DOMAIN-SUFFIX,xiaojukeji.com
- DOMAIN-SUFFIX,xiaomi.com
- DOMAIN-SUFFIX,xiaomi.net
- DOMAIN-SUFFIX,xiaomicp.com
- DOMAIN-SUFFIX,ximalaya.com
- DOMAIN-SUFFIX,xitek.com
- DOMAIN-SUFFIX,xmcdn.com
- DOMAIN-SUFFIX,xslb.net
- DOMAIN-SUFFIX,yach.me
- DOMAIN-SUFFIX,yeepay.com
- DOMAIN-SUFFIX,yhd.com
- DOMAIN-SUFFIX,yinxiang.com
- DOMAIN-SUFFIX,yixia.com
- DOMAIN-SUFFIX,ykimg.com
- DOMAIN-SUFFIX,youdao.com
- DOMAIN-SUFFIX,youku.com
- DOMAIN-SUFFIX,yunjiasu-cdn.net
- DOMAIN-SUFFIX,zealer.com
- DOMAIN-SUFFIX,zgslb.net
- DOMAIN-SUFFIX,zhihu.com
- DOMAIN-SUFFIX,zhimg.com
- DOMAIN-SUFFIX,zimuzu.tv
- DOMAIN-SUFFIX,zmz002.com
- IP-CIDR,1.255.62.0/24,no-resolve
# > CN
- DOMAIN-SUFFIX,gov.cn
- DOMAIN-SUFFIX,cn

View File

@ -1,10 +0,0 @@
payload:
# > F1 TV
- DOMAIN,d2n9h2wits23hf.cloudfront.net
- DOMAIN,f1prodlive.akamaized.net
- DOMAIN,mobile-collector.newrelic.com
- DOMAIN-SUFFIX,bitmovin.com
- DOMAIN-SUFFIX,f1esports.com
- DOMAIN-SUFFIX,f1manager.com
- DOMAIN-SUFFIX,f1play.com
- DOMAIN-SUFFIX,formula1.com

View File

@ -1,37 +0,0 @@
payload:
# > Google FCM
- DOMAIN,alt1-mtalk.google.com
- DOMAIN,alt2-mtalk.google.com
- DOMAIN,alt3-mtalk.google.com
- DOMAIN,alt4-mtalk.google.com
- DOMAIN,alt5-mtalk.google.com
- DOMAIN,alt6-mtalk.google.com
- DOMAIN,alt7-mtalk.google.com
- DOMAIN,alt8-mtalk.google.com
- DOMAIN,mtalk.google.com
- IP-CIDR,64.233.177.188/32,no-resolve
- IP-CIDR,64.233.186.188/32,no-resolve
- IP-CIDR,64.233.187.188/32,no-resolve
- IP-CIDR,64.233.188.188/32,no-resolve
- IP-CIDR,64.233.189.188/32,no-resolve
- IP-CIDR,74.125.23.188/32,no-resolve
- IP-CIDR,74.125.24.188/32,no-resolve
- IP-CIDR,74.125.28.188/32,no-resolve
- IP-CIDR,74.125.127.188/32,no-resolve
- IP-CIDR,74.125.137.188/32,no-resolve
- IP-CIDR,74.125.203.188/32,no-resolve
- IP-CIDR,74.125.204.188/32,no-resolve
- IP-CIDR,74.125.206.188/32,no-resolve
- IP-CIDR,108.177.125.188/32,no-resolve
- IP-CIDR,142.250.4.188/32,no-resolve
- IP-CIDR,142.250.10.188/32,no-resolve
- IP-CIDR,142.250.31.188/32,no-resolve
- IP-CIDR,142.250.96.188/32,no-resolve
- IP-CIDR,172.217.194.188/32,no-resolve
- IP-CIDR,172.217.218.188/32,no-resolve
- IP-CIDR,172.217.219.188/32,no-resolve
- IP-CIDR,172.253.63.188/32,no-resolve
- IP-CIDR,172.253.122.188/32,no-resolve
- IP-CIDR,173.194.175.188/32,no-resolve
- IP-CIDR,173.194.218.188/32,no-resolve
- IP-CIDR,209.85.233.188/32,no-resolve

View File

@ -1,6 +0,0 @@
payload:
# > Fox+ (HK|TW|SG)
# - USER-AGENT,FOXPlus*
- DOMAIN-SUFFIX,akamaized.net
- DOMAIN-SUFFIX,foxplus.com
- DOMAIN-SUFFIX,theplatform.com

View File

@ -1,6 +0,0 @@
payload:
# > Fox Now
# - USER-AGENT,FOX%20NOW*
- DOMAIN-SUFFIX,fox.com
- DOMAIN-SUFFIX,foxdcg.com
- DOMAIN-SUFFIX,uplynk.com

View File

@ -1,37 +0,0 @@
payload:
# > Google FCM
- DOMAIN,alt1-mtalk.google.com
- DOMAIN,alt2-mtalk.google.com
- DOMAIN,alt3-mtalk.google.com
- DOMAIN,alt4-mtalk.google.com
- DOMAIN,alt5-mtalk.google.com
- DOMAIN,alt6-mtalk.google.com
- DOMAIN,alt7-mtalk.google.com
- DOMAIN,alt8-mtalk.google.com
- DOMAIN,mtalk.google.com
- IP-CIDR,64.233.177.188/32,no-resolve
- IP-CIDR,64.233.186.188/32,no-resolve
- IP-CIDR,64.233.187.188/32,no-resolve
- IP-CIDR,64.233.188.188/32,no-resolve
- IP-CIDR,64.233.189.188/32,no-resolve
- IP-CIDR,74.125.23.188/32,no-resolve
- IP-CIDR,74.125.24.188/32,no-resolve
- IP-CIDR,74.125.28.188/32,no-resolve
- IP-CIDR,74.125.127.188/32,no-resolve
- IP-CIDR,74.125.137.188/32,no-resolve
- IP-CIDR,74.125.203.188/32,no-resolve
- IP-CIDR,74.125.204.188/32,no-resolve
- IP-CIDR,74.125.206.188/32,no-resolve
- IP-CIDR,108.177.125.188/32,no-resolve
- IP-CIDR,142.250.4.188/32,no-resolve
- IP-CIDR,142.250.10.188/32,no-resolve
- IP-CIDR,142.250.31.188/32,no-resolve
- IP-CIDR,142.250.96.188/32,no-resolve
- IP-CIDR,172.217.194.188/32,no-resolve
- IP-CIDR,172.217.218.188/32,no-resolve
- IP-CIDR,172.217.219.188/32,no-resolve
- IP-CIDR,172.253.63.188/32,no-resolve
- IP-CIDR,172.253.122.188/32,no-resolve
- IP-CIDR,173.194.175.188/32,no-resolve
- IP-CIDR,173.194.218.188/32,no-resolve
- IP-CIDR,209.85.233.188/32,no-resolve

View File

@ -1,23 +0,0 @@
payload:
# > HBO Max
- PROCESS-NAME,com.hbo.hbonow
- DOMAIN-SUFFIX,hbo.com
- DOMAIN-SUFFIX,hbogo.com
- DOMAIN-SUFFIX,hbonow.com
- DOMAIN-SUFFIX,hbomax.com
- DOMAIN-SUFFIX,hbomaxcdn.com
# > HBO GO
- DOMAIN,44wilhpljf.execute-api.ap-southeast-1.amazonaws.com
- DOMAIN,bcbolthboa-a.akamaihd.net
- DOMAIN,cf-images.ap-southeast-1.prod.boltdns.net
- DOMAIN,dai3fd1oh325y.cloudfront.net
- DOMAIN,hboasia1-i.akamaihd.net
- DOMAIN,hboasia2-i.akamaihd.net
- DOMAIN,hboasia3-i.akamaihd.net
- DOMAIN,hboasia4-i.akamaihd.net
- DOMAIN,hboasia5-i.akamaihd.net
- DOMAIN,players.brightcove.net
- DOMAIN,s3-ap-southeast-1.amazonaws.com
- DOMAIN-SUFFIX,hbogoasia.com
- DOMAIN-SUFFIX,hbogoasia.hk

View File

@ -1,21 +0,0 @@
payload:
# > HBO Max
# - USER-AGENT,HBO%20GO%20PROD*
# - DOMAIN-KEYWORD,hboasia
- DOMAIN-KEYWORD,hbogoasia
- DOMAIN-SUFFIX,hboasia.com
- DOMAIN-SUFFIX,hbogo.co.th
- DOMAIN-SUFFIX,hbogo.com
- DOMAIN-SUFFIX,hbogo.eu
- DOMAIN-SUFFIX,hbogoasia.com
- DOMAIN-SUFFIX,hbogoasia.id
- DOMAIN-SUFFIX,hbogoasia.ph
- DOMAIN,hbolb.onwardsmg.com
- DOMAIN,hbounify-prod.evergent.com
# - DOMAIN,bcbolthboa-a.akamaihd.net
- DOMAIN,dai3fd1oh325y.cloudfront.net
# - DOMAIN,hboasialive.akamaized.net
# - DOMAIN,hbogoprod-vod.akamaized.net

View File

@ -1,11 +0,0 @@
payload:
# > HBO Max
# - USER-AGENT,HBOMAX*
- DOMAIN-SUFFIX,hbo.com
- DOMAIN-SUFFIX,hbomax.com
- DOMAIN-SUFFIX,hbomaxcdn.com
- DOMAIN-SUFFIX,hbonow.com
- DOMAIN-SUFFIX,hbomax.com
- DOMAIN,execute-api.ap-southeast-1.amazonaws.com

View File

@ -1,23 +0,0 @@
payload:
# > Hulu
- PROCESS-NAME,com.hulu.plus
- DOMAIN-SUFFIX,hulu.com
- DOMAIN-SUFFIX,hulu.hb.omtrdc.net
- DOMAIN-SUFFIX,hulu.sc.omtrdc.net
- DOMAIN-SUFFIX,huluad.com
- DOMAIN-SUFFIX,huluim.com
- DOMAIN-SUFFIX,hulumail.com
- DOMAIN-SUFFIX,huluqa.com
- DOMAIN-SUFFIX,hulustream.com
- DOMAIN,cs428.wpc.edgecastcdn.net
- DOMAIN,cws-hulu.conviva.com
- DOMAIN,hulu.com.c.footprint.net
- DOMAIN,hulu.map.fastly.net
- IP-CIDR,8.28.124.0/23
- IP-CIDR,199.60.116.0/24
- IP-CIDR,199.200.48.0/22
- IP-CIDR,208.91.156.0/22
- IP-CIDR6,2620:100:3000::/40

View File

@ -1,8 +0,0 @@
payload:
# > Hulu(フールー)
- PROCESS-NAME,jp.happyon.android
- DOMAIN-SUFFIX,happyon.jp
- DOMAIN-SUFFIX,hulu.jp
- DOMAIN-SUFFIX,prod.hjholdings.tv
- DOMAIN-SUFFIX,streaks.jp
- DOMAIN-SUFFIX,yb.uncn.jp

View File

@ -1,31 +0,0 @@
payload:
# > iQIYI Intl
# - USER-AGENT,iQIYI*
# - USER-AGENT,QIYIVideo*
# - USER-AGENT,QYPlayer*
# - USER-AGENT,QTP*
# - PROCESS-NAME,com.iqiyi.i18n
# - PROCESS-NAME,com.iqiyi.i18n.tv
- DOMAIN-SUFFIX,inter.iqiyi.com
- DOMAIN-SUFFIX,iq.com
# 首页
- DOMAIN-SUFFIX,intl.iqiyi.com
# 历史
- DOMAIN,intl-rcd.iqiyi.com
# 收藏
- DOMAIN,intl-subscription.iqiyi.com
# 播放
- IP-CIDR,104.85.165.17/32,no-resolve
- IP-CIDR,110.238.107.47/32,no-resolve
- IP-CIDR,118.26.32.162/32,no-resolve
- IP-CIDR,159.138.102.146/32,no-resolve
- IP-CIDR,184.51.102.0/24,no-resolve
- IP-CIDR,203.74.95.130/28,no-resolve
- IP-CIDR,203.80.97.203/32,no-resolve
- IP-CIDR,210.71.227.202/32,no-resolve
- IP-CIDR,23.200.145.146/32,no-resolve
- IP-CIDR,23.210.215.186/32,no-resolve
- IP-CIDR,23.211.15.0/24,no-resolve
- IP-CIDR,23.219.172.0/24,no-resolve
- IP-CIDR,23.40.242.10/32,no-resolve
- IP-CIDR,23.59.252.0/24,no-resolve

View File

@ -1,12 +0,0 @@
payload:
# > IQIYI
# - USER-AGENT,*QIYI*
# - USER-AGENT,iQiYi*
- DOMAIN-SUFFIX,iqiyi.com
- DOMAIN-SUFFIX,iqiyipic.com
- DOMAIN-SUFFIX,iq.com
- DOMAIN-SUFFIX,qy.net
- DOMAIN-SUFFIX,gitv.tv
- DOMAIN-SUFFIX,71.am
- DOMAIN-KEYWORD,qiyi
- DOMAIN,cache.video.iqiyi.com

View File

@ -1,6 +0,0 @@
payload:
# > JOOX
- PROCESS-NAME,com.tencent.ibg.joox
- PROCESS-NAME,com.tencent.ibg.jooxtv
- DOMAIN-SUFFIX,joox.com
- DOMAIN-KEYWORD,jooxweb-api

Some files were not shown because too many files have changed in this diff Show More