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

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

No files matched your search

+6 -7
View File
@@ -1,15 +1,14 @@
msgid "" msgid ""
msgstr "" msgstr ""
"PO-Revision-Date: 2025-10-27 15:04+0000\n" "PO-Revision-Date: 2026-03-15 08:27+0000\n"
"Last-Translator: 109247019824 " "Last-Translator: Daniel Konstantinov <bgshadow2010@gmail.com>\n"
"<109247019824@users.noreply.hosted.weblate.org>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/bg/>\n" "luciapplicationsaria2/bg/>\n"
"Language: bg\n" "Language: bg\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled" 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:594
msgid "falloc" msgid "falloc"
msgstr "" msgstr "falloc"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:592 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:592
msgid "prealloc" msgid "prealloc"
msgstr "" msgstr "prealloc"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:593 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:593
msgid "trunc" msgid "trunc"
msgstr "" msgstr "trunc"
+3 -3
View File
@@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" 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" "Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/cs/>\n" "luciapplicationsaria2/cs/>\n"
@@ -8,7 +8,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled" 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:231
msgid "Info" msgid "Info"
msgstr "Pro informaci" msgstr "Info"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:41 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:41
msgid "Installed web interface:" msgid "Installed web interface:"
+3 -3
View File
@@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" 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" "Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\n"
"Language-Team: Irish <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Irish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/ga/>\n" "luciapplicationsaria2/ga/>\n"
@@ -9,7 +9,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :" "Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :"
"(n>6 && n<11) ? 3 : 4;\n" "(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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled" 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:231
msgid "Info" msgid "Info"
msgstr "Faisnéis" msgstr "Eolas"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:41 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:41
msgid "Installed web interface:" msgid "Installed web interface:"
+3 -3
View File
@@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" 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" "Last-Translator: Hyeonjeong Lee <h9101654@gmail.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Korean <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsaria2/ko/>\n" "luciapplicationsaria2/ko/>\n"
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled" 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:551
msgid "Additional BT tracker" msgid "Additional BT tracker"
+6 -6
View File
@@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2026-01-20 07:02+0000\n" "PO-Revision-Date: 2026-03-10 02:29+0000\n"
"Last-Translator: Nicolas Aigner <nicolas.aigner@gmail.com>\n" "Last-Translator: Volenski <volenski@users.noreply.hosted.weblate.org>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsaria2/pt_BR/>\n" "openwrt/luciapplicationsaria2/pt_BR/>\n"
"Language: pt_BR\n" "Language: pt_BR\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled" 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 #: applications/luci-app-aria2/root/usr/share/luci/menu.d/luci-app-aria2.json:15
msgid "Configuration" msgid "Configuration"
msgstr "Configurações" msgstr "Configuração"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:367 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:367
msgid "Connect timeout" msgid "Connect timeout"
@@ -590,8 +590,8 @@ msgid ""
"you can add Cache-Control header with a directive you like using \"Header\" " "you can add Cache-Control header with a directive you like using \"Header\" "
"option." "option."
msgstr "" msgstr ""
"Envie os cabeçalhos <code> Cache-Control: no-cache </code> e <code> Pragma: " "Enviar cabeçalho <code>Cache-Control: no-cache</code> e <code>Pragma: no-"
"no-cache </code> para evitar a cache de conteúdo. Se desativado, estes " "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 " "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\"." "com uma diretiva que você gosta usando a opção \"Cabeçalho\"."
+2 -2
View File
@@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" 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" "Last-Translator: nKsyn <e.nksyn@gmail.com>\n"
"Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/" "Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsaria2/zh_Hans/>\n" "projects/openwrt/luciapplicationsaria2/zh_Hans/>\n"
@@ -377,7 +377,7 @@ msgstr "无"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:232 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:232
msgid "Notice" msgid "Notice"
msgstr "通知" msgstr "通知 (Notice)"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:242 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:242
msgid "Pause" msgid "Pause"
+22 -20
View File
@@ -3,7 +3,7 @@
# #
msgid "" msgid ""
msgstr "" 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" "Last-Translator: EESF-2 <eesf-2@users.noreply.hosted.weblate.org>\n"
"Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/" "Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsaria2/zh_Hant/>\n" "projects/openwrt/luciapplicationsaria2/zh_Hant/>\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:433
msgid "<abbr title=\"Local Peer Discovery\">LPD</abbr> enabled" 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:577
msgid "Disk cache" msgid "Disk cache"
msgstr "磁碟快取" msgstr "硬碟快取"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:396 #: 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." 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:579
msgid "Enable disk cache (in bytes), set 0 to disabled." 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:220
msgid "Enable logging" msgid "Enable logging"
msgstr "啟用日誌" msgstr "啟用紀錄"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:442 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:442
msgid "Enable peer exchange" msgid "Enable peer exchange"
@@ -275,11 +275,11 @@ msgstr "保留在記憶體中"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:31 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:31
msgid "Last 50 lines of log file:" msgid "Last 50 lines of log file:"
msgstr "日誌檔案最後 50 行:" msgstr "紀錄檔案最後 50 行:"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:36 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:36
msgid "Last 50 lines of syslog:" msgid "Last 50 lines of syslog:"
msgstr "系統日誌最後 50 行:" msgstr "系統紀錄最後 50 行:"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:210 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:210
msgid "Leave blank to use default user." 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 #: applications/luci-app-aria2/root/usr/share/luci/menu.d/luci-app-aria2.json:33
msgid "Log" msgid "Log"
msgstr "日誌" msgstr "紀錄"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:58 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:58
msgid "Log Data" msgid "Log Data"
msgstr "日誌資料" msgstr "紀錄資料"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:223 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:223
msgid "Log file" msgid "Log file"
msgstr "日誌檔案" msgstr "紀錄檔案"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:228 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:228
msgid "Log level" msgid "Log level"
msgstr "日誌等級" msgstr "紀錄等級"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:377 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:377
msgid "Lowest speed limit" 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:33
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:38 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/log.js:38
msgid "No log data." msgid "No log data."
msgstr "無日誌資料。" msgstr "無紀錄資料。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:591 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:591
msgid "None" msgid "None"
@@ -408,7 +408,7 @@ msgstr "Peer ID 前綴"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:341 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:341
msgid "Private key" msgid "Private key"
msgstr "私密金鑰" msgstr "私鑰"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:317 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:317
msgid "Proxy password" msgid "Proxy password"
@@ -440,7 +440,7 @@ msgstr "RPC 連接埠"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:293 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:293
msgid "RPC private key" msgid "RPC private key"
msgstr "RPC 私密金鑰" msgstr "RPC 私鑰"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:276 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:276
msgid "RPC secure" msgid "RPC secure"
@@ -476,7 +476,7 @@ msgid ""
"Please use this option with care because it will actually remove files from " "Please use this option with care because it will actually remove files from "
"your disk." "your disk."
msgstr "" msgstr ""
"BitTorrent 下載完成後刪除未選檔案。請小心使用此選項,因為它實際上會從磁碟中刪" "BitTorrent 下載完成後刪除未選檔案。請小心使用此選項,因為它實際上會從硬碟中刪"
"除檔案。" "除檔案。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:514 #: 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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:224
msgid "The file name of the log file." msgid "The file name of the log file."
msgstr "日誌檔案名稱。" msgstr "紀錄檔案名稱。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:386 #: 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." msgid "The maximum number of connections to one server for each download."
@@ -771,9 +771,10 @@ msgid ""
msgstr "" msgstr ""
"RPC 伺服器使用的憑證檔案。憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。<br/" "RPC 伺服器使用的憑證檔案。憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。<br/"
">PKCS12 檔案必須包含憑證、金鑰以及可選的附加憑證鏈,且該檔案不能有匯入密碼!" ">PKCS12 檔案必須包含憑證、金鑰以及可選的附加憑證鏈,且該檔案不能有匯入密碼!"
"<br/>使用 PEM 時,您必須同時指定 RPC 私密金鑰。" "<br/>使用 PEM 時,您必須同時指定 RPC 私鑰。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:335 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:335
#, fuzzy
msgid "" msgid ""
"Use the client certificate in FILE. The certificate must be either in PKCS12 " "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 " "(.p12, .pfx) or in PEM format.<br/>PKCS12 files must contain the "
@@ -783,19 +784,20 @@ msgid ""
msgstr "" msgstr ""
"用戶端使用的憑證檔案。憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。<br/>PKCS12 " "用戶端使用的憑證檔案。憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。<br/>PKCS12 "
"檔案必須包含憑證、金鑰以及可選的附加憑證鏈,且該檔案不能有匯入密碼!<br/>使" "檔案必須包含憑證、金鑰以及可選的附加憑證鏈,且該檔案不能有匯入密碼!<br/>使"
"用 PEM 時,您必須同時指定私密金鑰。" "用 PEM 時,您必須同時指定私鑰。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:294 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:294
msgid "" msgid ""
"Use the private key in FILE for RPC server. The private key must be " "Use the private key in FILE for RPC server. The private key must be "
"decrypted and in PEM format." "decrypted and in PEM format."
msgstr "RPC 伺服器使用的私密金鑰檔案。私密金鑰必須被解密,且格式為 PEM。" msgstr "RPC 伺服器使用的私鑰檔案。私鑰必須被解密,且格式為 PEM。"
#: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:342 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:342
#, fuzzy
msgid "" msgid ""
"Use the private key in FILE. The private key must be decrypted and in PEM " "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." "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 #: applications/luci-app-aria2/htdocs/luci-static/resources/view/aria2/config.js:408
msgid "User agent" msgid "User agent"
+4 -5
View File
@@ -1,15 +1,14 @@
msgid "" msgid ""
msgstr "" msgstr ""
"PO-Revision-Date: 2025-10-27 15:04+0000\n" "PO-Revision-Date: 2026-03-15 08:27+0000\n"
"Last-Translator: 109247019824 " "Last-Translator: Daniel Konstantinov <bgshadow2010@gmail.com>\n"
"<109247019824@users.noreply.hosted.weblate.org>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/bg/>\n" "luciapplicationsddns/bg/>\n"
"Language: bg\n" "Language: bg\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:763
msgid "A.k.a. the TOKEN at e.g. afraid.org" 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:458
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:526 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:526
+6 -6
View File
@@ -2,8 +2,9 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n" "Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n" "POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2025-12-02 19:00+0000\n" "PO-Revision-Date: 2026-03-08 17:33+0000\n"
"Last-Translator: Alfonso Montero López <amontero@tinet.org>\n" "Last-Translator: Christopher Picón "
"<ntrpc.tech@users.noreply.hosted.weblate.org>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/ca/>\n" "luciapplicationsddns/ca/>\n"
"Language: ca\n" "Language: ca\n"
@@ -11,11 +12,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:763
msgid "A.k.a. the TOKEN at e.g. afraid.org" 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:607
msgid "Advanced Settings" msgid "Advanced Settings"
msgstr "Configuració avançada" msgstr "Configuració Avançada"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:392 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:392
msgid "Allow non-public IPs" msgid "Allow non-public IPs"
@@ -115,7 +116,6 @@ msgid "Custom update script for updating your DDNS Provider."
msgstr "" msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:708 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:708
#, fuzzy
msgid "Custom update-URL" msgid "Custom update-URL"
msgstr "URL d'actualització personalitzada" msgstr "URL d'actualització personalitzada"
+5 -5
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n" "Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\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" "Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/cs/>\n" "luciapplicationsddns/cs/>\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:806
msgid "IP address source" 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:503
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:629 #: 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:963
msgid "Info" msgid "Info"
msgstr "Pro informaci" msgstr "Info"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:264 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:264
msgid "Information" 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:1000
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1062 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1062
msgid "seconds" msgid "seconds"
msgstr "sekundy/sekund" msgstr "sekund"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:793 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:793
msgid "to run HTTPS without verification of server certificates (insecure)" msgid "to run HTTPS without verification of server certificates (insecure)"
+1 -1
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n" "Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\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" "Last-Translator: Franco Castillo <castillofrancodamian@gmail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Spanish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/es/>\n" "luciapplicationsddns/es/>\n"
+3 -3
View File
@@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" 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" "Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\n"
"Language-Team: Irish <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Irish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsddns/ga/>\n" "luciapplicationsddns/ga/>\n"
@@ -9,7 +9,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :" "Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :"
"(n>6 && n<11) ? 3 : 4;\n" "(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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:963
msgid "Info" msgid "Info"
msgstr "Faisnéis" msgstr "Eolas"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:264 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:264
msgid "Information" msgid "Information"
+6 -6
View File
@@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n" "Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\n" "POT-Creation-Date: 2016-01-30 11:07+0100\n"
"PO-Revision-Date: 2026-01-20 07:02+0000\n" "PO-Revision-Date: 2026-03-09 19:11+0000\n"
"Last-Translator: Nicolas Aigner <nicolas.aigner@gmail.com>\n" "Last-Translator: Volenski <volenski@users.noreply.hosted.weblate.org>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsddns/pt_BR/>\n" "openwrt/luciapplicationsddns/pt_BR/>\n"
"Language: pt_BR\n" "Language: pt_BR\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:606
msgid "Basic Settings" 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:903
msgid "Bind Network" 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/status/include/70_ddns.js:27
msgid "Configuration" 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:226
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1134 #: 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:754
msgid "Username" 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:371
msgid "Using specific DNS Server not supported" msgid "Using specific DNS Server not supported"
+2 -2
View File
@@ -5,7 +5,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n" "Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\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" "Last-Translator: nKsyn <e.nksyn@gmail.com>\n"
"Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/" "Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsddns/zh_Hans/>\n" "projects/openwrt/luciapplicationsddns/zh_Hans/>\n"
@@ -498,7 +498,7 @@ msgstr "未在运行"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:964 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:964
msgid "Notice" msgid "Notice"
msgstr "通知" msgstr "通知 (Notice)"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:429 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:429
msgid "Number of last lines stored in log files" msgid "Number of last lines stored in log files"
+13 -13
View File
@@ -5,7 +5,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: luci-app-ddns 2.4.0-1\n" "Project-Id-Version: luci-app-ddns 2.4.0-1\n"
"POT-Creation-Date: 2016-01-30 11:07+0100\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" "Last-Translator: EESF-2 <eesf-2@users.noreply.hosted.weblate.org>\n"
"Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/" "Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationsddns/zh_Hant/>\n" "projects/openwrt/luciapplicationsddns/zh_Hant/>\n"
@@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:423
msgid "\"../\" not allowed in path for Security Reason." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:417
msgid "Contains Log files for each running section." msgid "Contains Log files for each running section."
msgstr "包含每個執行區域的日誌檔案。" msgstr "包含每個執行區域的紀錄檔案。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:411 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:411
msgid "Contains PID and other status information for each running section." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:609
msgid "Log File Viewer" msgid "Log File Viewer"
msgstr "日誌檔案檢視器" msgstr "紀錄檔案檢視器"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:416 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:416
msgid "Log directory" msgid "Log directory"
msgstr "日誌目錄" msgstr "紀錄目錄"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:428 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:428
msgid "Log length" msgid "Log length"
msgstr "日誌長度" msgstr "紀錄長度"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:969 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:969
msgid "Log to file" msgid "Log to file"
@@ -405,7 +405,7 @@ msgstr "記錄至檔案"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:957 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:957
msgid "Log to syslog" 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:621
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1130 #: 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:962
msgid "No logging" msgid "No logging"
msgstr "無日誌" msgstr "無紀錄"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:393 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:393
msgid "Non-public and by default blocked IPs" 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:429
msgid "Number of last lines stored in log files" msgid "Number of last lines stored in log files"
msgstr "日誌檔案中儲存的最後行數" msgstr "紀錄檔案中儲存的最後行數"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:916 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:916
msgid "OPTIONAL: Force the usage of pure IPv4/IPv6 only communication." 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1069
msgid "Read / Reread log file" msgid "Read / Reread log file"
msgstr "讀取 / 重讀日誌檔案" msgstr "讀取 / 重讀紀錄檔案"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:693 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:693
msgid "Really switch service?" msgid "Really switch service?"
@@ -722,7 +722,7 @@ msgstr ""
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:1085 #: 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." 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:210
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:277 #: 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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:974
msgid "" msgid ""
"Writes detailed messages to log file. File will be truncated automatically." "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 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:958
msgid "" msgid ""
"Writes log messages to syslog. Critical Errors will always be written to " "Writes log messages to syslog. Critical Errors will always be written to "
"syslog." "syslog."
msgstr "將日誌訊息寫入系統日誌。嚴重錯誤將始終寫入系統日誌。" msgstr "將紀錄訊息寫入系統紀錄。嚴重錯誤將始終寫入系統紀錄。"
#: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:375 #: applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js:375
msgid "" msgid ""
+6 -4
View File
@@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"PO-Revision-Date: 2026-03-05 17:52+0000\n" "PO-Revision-Date: 2026-03-15 08:27+0000\n"
"Last-Translator: Nikolay Tsanov <nick.tsanov@gmail.com>\n" "Last-Translator: Daniel Konstantinov <bgshadow2010@gmail.com>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsksmbd/bg/>\n" "luciapplicationsksmbd/bg/>\n"
"Language: bg\n" "Language: bg\n"
@@ -17,7 +17,7 @@ msgstr ""
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:57 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:57
msgid "Allow guest on IPC$." msgid "Allow guest on IPC$."
msgstr "" msgstr "Разреши гост достъп до IPC$."
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:103 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:103
msgid "Allow guests" msgid "Allow guests"
@@ -25,13 +25,15 @@ msgstr "Разрешаване на гости"
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:60 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:60
msgid "Allow legacy (insecure) protocols/authentication." msgid "Allow legacy (insecure) protocols/authentication."
msgstr "" msgstr "Разреши стари (несигурни) протоколи/автентикация."
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:61 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:61
msgid "" msgid ""
"Allow legacy smb(v1)/Lanman connections, needed for older devices without " "Allow legacy smb(v1)/Lanman connections, needed for older devices without "
"smb(v2.1/3) support." "smb(v2.1/3) support."
msgstr "" msgstr ""
"Разреши стари smb(v1)/Lanman връзки, необходими за по-стари устройства без "
"поддръжка на smb(v2.1/3)."
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:100 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:100
msgid "Allowed users" msgid "Allowed users"
+5 -4
View File
@@ -1,14 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"PO-Revision-Date: 2022-07-25 17:15+0000\n" "PO-Revision-Date: 2026-03-08 17:32+0000\n"
"Last-Translator: dtalens <databio@gmail.com>\n" "Last-Translator: Christopher Picón "
"<ntrpc.tech@users.noreply.hosted.weblate.org>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsksmbd/ca/>\n" "luciapplicationsksmbd/ca/>\n"
"Language: ca\n" "Language: ca\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\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 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:58
msgid "Add optional guest access to IPC$ share, disabled by default" 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 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:103
msgid "Allow guests" msgid "Allow guests"
msgstr "" msgstr "Permet convidats"
#: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:60 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:60
msgid "Allow legacy (insecure) protocols/authentication." msgid "Allow legacy (insecure) protocols/authentication."
+2 -2
View File
@@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" 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" "Last-Translator: hmzs <hmzs@1szer1.hu>\n"
"Language-Team: Hungarian <https://hosted.weblate.org/projects/openwrt/" "Language-Team: Hungarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsksmbd/hu/>\n" "luciapplicationsksmbd/hu/>\n"
@@ -8,7 +8,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\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 #: applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js:58
msgid "Add optional guest access to IPC$ share, disabled by default" msgid "Add optional guest access to IPC$ share, disabled by default"
+2 -10
View File
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.47.055 PKG_VERSION:=0.47.071
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash> PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) 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/config
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/rule_provider 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/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/etc/openclash/core
mkdir -p $(PKG_BUILD_DIR)/root/usr/share/openclash/backup/overwrite 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 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 define Package/$(PKG_NAME)/prerm
#!/bin/sh #!/bin/sh
uci -q set openclash.config.enable=0
uci -q commit openclash
[ -n "$(pidof clash)" ] && /etc/init.d/openclash stop 2>/dev/null [ -n "$(pidof clash)" ] && /etc/init.d/openclash stop 2>/dev/null
if [ -f "/etc/config/openclash" ] && [ ! -f "/tmp/openclash.bak" ]; then if [ -f "/etc/config/openclash" ] && [ ! -f "/tmp/openclash.bak" ]; then
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1 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_start.log >/dev/null 2>&1
rm -rf /tmp/openclash_last_version >/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/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 /tmp/clash_last_version >/dev/null 2>&1
rm -rf /usr/share/openclash >/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_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_chnroute_pass.conf >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute6_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/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 /tmp/openclash_announcement >/dev/null 2>&1
rm -rf /www/luci-static/resources/openclash >/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 sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
+124 -477
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", "one_key_update_check"}, call("action_one_key_update_check"))
entry({"admin", "services", "openclash", "switch_mode"}, call("action_switch_mode")) entry({"admin", "services", "openclash", "switch_mode"}, call("action_switch_mode"))
entry({"admin", "services", "openclash", "op_mode"}, call("action_op_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", "sub_info_get"}, call("sub_info_get"))
entry({"admin", "services", "openclash", "config_name"}, call("action_config_name")) entry({"admin", "services", "openclash", "config_name"}, call("action_config_name"))
entry({"admin", "services", "openclash", "switch_config"}, call("action_switch_config")) 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", "announcement"}, call("action_announcement"))
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Plugin Settings"), 30).leaf = true 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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "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", "log"},cbi("openclash/log"),_("Server Logs"), 90).leaf = true
entry({"admin", "services", "openclash", "myip_check"}, call("action_myip_check")) entry({"admin", "services", "openclash", "myip_check"}, call("action_myip_check"))
@@ -177,19 +167,13 @@ end
local function startlog() local function startlog()
local info = "" local info = ""
local line_trans = ""
if fs.access("/tmp/openclash_start.log") then if fs.access("/tmp/openclash_start.log") then
info = luci.sys.exec("sed -n '$p' /tmp/openclash_start.log 2>/dev/null") info = luci.sys.exec("sed -n '$p' /tmp/openclash_start.log 2>/dev/null")
line_trans = info
if string.len(info) > 0 then if string.len(info) > 0 then
if not string.find (info, "【") or not string.find (info, "】") then info = trans_line(info)
line_trans = trans_line_nolabel(info) end
else
line_trans = trans_line(info)
end
end
end end
return line_trans return info
end end
local function pkg_type() local function pkg_type()
@@ -234,23 +218,19 @@ local function coremetacv()
end end
local function corelv() local function corelv()
local status = process_status("/usr/share/openclash/clash_version.sh")
local core_meta_lv = "" local core_meta_lv = ""
local core_smart_enable = fs.uci_get_config("config", "smart_enable") or "0" local core_smart_enable = fs.uci_get_config("config", "smart_enable") or "0"
if not status then if fs.access("/tmp/clash_last_version") 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
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'")
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
else else
action_get_last_version() core_meta_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
core_meta_lv = "loading..."
end end
else else
core_meta_lv = "loading..." core_meta_lv = "loading..."
end end
action_get_last_version()
return core_meta_lv return core_meta_lv
end end
@@ -274,23 +254,19 @@ local function opcv()
end end
local function oplv() local function oplv()
local status = process_status("/usr/share/openclash/openclash_version.sh")
local oplv = "" 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 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'") 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
else else
oplv = "loading..." oplv = "loading..."
end end
action_get_last_version()
return oplv return oplv
end end
local function opup() 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 &") return luci.sys.call("bash /usr/share/openclash/openclash_update.sh >/dev/null 2>&1 &")
end end
@@ -298,7 +274,6 @@ local function coreup()
uci:set("openclash", "config", "enable", "1") uci:set("openclash", "config", "enable", "1")
uci:commit("openclash") uci:commit("openclash")
local type = luci.http.formvalue("core_type") 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)) return luci.sys.call(string.format("/usr/share/openclash/openclash_core.sh '%s' >/dev/null 2>&1 &", type))
end end
@@ -346,21 +321,13 @@ end
function core_download() function core_download()
local cdn_url = luci.http.formvalue("url") local cdn_url = luci.http.formvalue("url")
if cdn_url then 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)) luci.sys.call(string.format("bash /usr/share/openclash/openclash_core.sh 'Meta' '%s' >/dev/null 2>&1 &", cdn_url))
else 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 &") luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &")
end end
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() function action_flush_dns_cache()
local state = 0 local state = 0
if is_running() then if is_running() then
@@ -368,8 +335,8 @@ function action_flush_dns_cache()
local dase = dase() or "" local dase = dase() or ""
local cn_port = cn_port() local cn_port = cn_port()
if not daip or not cn_port then return end 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)) 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 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/dns/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 end
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
luci.http.write_json({ luci.http.write_json({
@@ -384,7 +351,7 @@ function action_flush_smart_cache()
local dase = dase() or "" local dase = dase() or ""
local cn_port = cn_port() local cn_port = cn_port()
if not daip or not cn_port then return end 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 end
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
luci.http.write_json({ luci.http.write_json({
@@ -393,13 +360,8 @@ function action_flush_smart_cache()
end end
function action_update_config() function action_update_config()
-- filename or config_file is basename -- filename is basename
local filename = luci.http.formvalue("filename") 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") luci.http.prepare_content("application/json")
@@ -450,195 +412,9 @@ end
function action_one_key_update() function action_one_key_update()
local cdn_url = luci.http.formvalue("url") local cdn_url = luci.http.formvalue("url")
if cdn_url then 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 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 &") return luci.sys.call("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"
end end
end end
@@ -761,10 +537,10 @@ function fetch_sub_info(sub_url, sub_ua)
local info, upload, download, total, day_expire, http_code local info, upload, download, total, day_expire, http_code
local used, expire, day_left, percent, surplus 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+)") local http_match = string.match(info, "http_code=(%d+)")
if not info or not http_match or tonumber(http_match) ~= 200 then 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+)") http_match = string.match(info, "http_code=(%d+)")
end end
@@ -972,7 +748,7 @@ function get_sub_url(filename)
end end
function sub_info_get() function sub_info_get()
local sub_ua, filename, sub_info local sub_ua, filename, sub_info, url_result
local providers_data = {} local providers_data = {}
filename = luci.http.formvalue("filename") filename = luci.http.formvalue("filename")
@@ -988,7 +764,7 @@ function sub_info_get()
) )
if filename and not is_start() then 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 if not url_result then
sub_info = "No Sub Info Found" sub_info = "No Sub Info Found"
@@ -1021,7 +797,8 @@ function sub_info_get()
luci.http.write_json({ luci.http.write_json({
sub_info = sub_info, sub_info = sub_info,
providers = providers_data, providers = providers_data,
get_time = os.time() get_time = os.time(),
url_result = url_result
}) })
end end
@@ -1032,7 +809,7 @@ function action_rule_mode()
local dase = dase() or "" local dase = dase() or ""
local cn_port = cn_port() local cn_port = cn_port()
if not daip or not cn_port then return end 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 if info then
mode = info["mode"] mode = info["mode"]
else else
@@ -1061,7 +838,7 @@ function action_switch_rule_mode()
if is_running() then if is_running() then
if not daip or not cn_port then luci.http.status(500, "Switch Faild") return end 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 if info ~= "" then
luci.http.status(500, "Switch Faild") luci.http.status(500, "Switch Faild")
end end
@@ -1111,7 +888,7 @@ function action_log_level()
local dase = dase() or "" local dase = dase() or ""
local cn_port = cn_port() local cn_port = cn_port()
if not daip or not cn_port then return end 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 if info then
level = info["log-level"] level = info["log-level"]
else else
@@ -1126,27 +903,6 @@ function action_log_level()
}) })
end 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 function s(e)
local t=0 local t=0
local a={' B/S',' KB/S',' MB/S',' GB/S',' TB/S',' PB/S'} 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() local cn_port = cn_port()
if not daip or not cn_port then return end 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))) 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 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', 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 if traffic and connections and connections.connections then
connection = #(connections.connections) connection = #(connections.connections)
@@ -1283,41 +1039,6 @@ function action_save_corever_branch()
}) })
end 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() function action_one_key_update_check()
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
luci.http.write_json({ luci.http.write_json({
@@ -1366,7 +1087,7 @@ function action_switch_dashboard()
local switch_name = luci.http.formvalue("name") local switch_name = luci.http.formvalue("name")
local switch_type = luci.http.formvalue("type") 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)) 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 if switch_type == "Official" then
uci:set("openclash", "config", "dashboard_type", "Official") uci:set("openclash", "config", "dashboard_type", "Official")
uci:commit("openclash") uci:commit("openclash")
@@ -1374,7 +1095,7 @@ function action_switch_dashboard()
uci:set("openclash", "config", "dashboard_type", "Meta") uci:set("openclash", "config", "dashboard_type", "Meta")
uci:commit("openclash") uci:commit("openclash")
end end
elseif switch_name == "Yacd" and tonumber(state) == 1 then elseif switch_name == "Yacd" and tonumber(state) == 0 then
if switch_type == "Official" then if switch_type == "Official" then
uci:set("openclash", "config", "yacd_type", "Official") uci:set("openclash", "config", "yacd_type", "Official")
uci:commit("openclash") uci:commit("openclash")
@@ -1492,10 +1213,14 @@ end
function action_get_last_version() function action_get_last_version()
if not process_status("/usr/share/openclash/clash_version.sh") then 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 end
if not process_status("/usr/share/openclash/openclash_version.sh") then 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
end end
@@ -1570,6 +1295,7 @@ function action_refresh_log()
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
local logfile = "/tmp/openclash.log" local logfile = "/tmp/openclash.log"
local log_len = tonumber(luci.http.formvalue("log_len")) or 0 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 if not fs.access(logfile) then
luci.http.write_json({ luci.http.write_json({
@@ -1594,54 +1320,54 @@ function action_refresh_log()
end end
local exclude_pattern = "UDP%-Receive%-Buffer%-Size|^Sec%-Fetch%-Mode|^User%-Agent|^Access%-Control|^Accept|^Origin|^Referer|^Connection|^Pragma|^Cache%-" 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 limit = 1000
local start_line = (log_len > 0 and total_lines > log_len) and (log_len + 1) or 1 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", "tail -n +%d '%s' | grep -v -E '%s' | grep -E '%s' | tail -n %d",
start_line, logfile, exclude_pattern, core_pattern, limit 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", "tail -n +%d '%s' | grep -v -E '%s' | grep -v -E '%s' | tail -n %d",
start_line, logfile, exclude_pattern, core_pattern, limit 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 if core_raw and core_raw ~= "" then
local core_logs = {}
for line in core_raw:gmatch("[^\n]+") do for line in core_raw:gmatch("[^\n]+") do
local line_trans = line table.insert(core_logs, 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")
end end
end end
local oc_log = ""
if oc_raw and oc_raw ~= "" then if oc_raw and oc_raw ~= "" then
local oc_logs = {}
for line in oc_raw:gmatch("[^\n]+") do for line in oc_raw:gmatch("[^\n]+") do
local line_trans if not string.match(string.sub(line, 1, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
if not string.find(line, "【") or not string.find(line, "】") then line = os.date("%Y-%m-%d %H:%M:%S") .. ' [Fatal] ' .. line
line_trans = trans_line_nolabel(line)
else
line_trans = trans_line(line)
end end
table.insert(oc_logs, line_trans) table.insert(oc_logs, trans_line(line))
end
if #oc_logs > 0 then
oc_log = table.concat(oc_logs, "\n")
end end
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({ luci.http.write_json({
len = total_lines, len = total_lines,
update = true, update = true,
@@ -1872,8 +1598,6 @@ function rename_file()
local new_file_path = file_path .. new_file_name local new_file_path = file_path .. new_file_name
local old_run_file_path = "/etc/openclash/" .. old_file_name local old_run_file_path = "/etc/openclash/" .. old_file_name
local new_run_file_path = "/etc/openclash/" .. new_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 fs.rename(old_file_path, new_file_path) then
if file_path == "/etc/openclash/config/" then if file_path == "/etc/openclash/config/" then
if fs.uci_get_config("config", "config_path") == old_file_path 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) fs.rename(old_run_file_path, new_run_file_path)
end 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", uci:foreach("openclash", "config_subscribe",
function(s) function(s)
if s.name == fs.filename(old_file_name) and fs.filename(new_file_name) ~= new_file_name then 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
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", uci:foreach("openclash", "groups",
function(s) function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then 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
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", uci:foreach("openclash", "servers",
function(s) function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then 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
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") uci:commit("openclash")
end end
luci.http.status(200, "Rename File Successful") luci.http.status(200, "Rename File Successful")
@@ -1956,19 +1648,13 @@ end
function manual_stream_unlock_test() function manual_stream_unlock_test()
local type = luci.http.formvalue("type") local type = luci.http.formvalue("type")
local cmd = string.format('/usr/share/openclash/openclash_streaming_unlock.lua "%s"', 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") luci.http.prepare_content("text/plain; charset=utf-8")
local util = io.popen(cmd) local util = io.popen(cmd)
if util and util ~= "" then if util and util ~= "" then
while true do while true do
local ln = util:read("*l") local ln = util:read("*l")
if ln then if ln then
if not string.find (ln, "【") or not string.find (ln, "】") then luci.http.write(trans_line(ln))
line_trans = trans_line_nolabel(ln)
else
line_trans = trans_line(ln)
end
luci.http.write(line_trans)
luci.http.write("\n") luci.http.write("\n")
end end
if not process_status("openclash_streaming_unlock.lua "..type) or not process_status("openclash_streaming_unlock.lua ") then 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() function all_proxies_stream_test()
local type = luci.http.formvalue("type") local type = luci.http.formvalue("type")
local cmd = string.format('/usr/share/openclash/openclash_streaming_unlock.lua "%s" "%s"', type, "all") 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") luci.http.prepare_content("text/plain; charset=utf-8")
local util = io.popen(cmd) local util = io.popen(cmd)
if util and util ~= "" then if util and util ~= "" then
while true do while true do
local ln = util:read("*l") local ln = util:read("*l")
if ln then if ln then
if not string.find (ln, "【") or not string.find (ln, "】") then luci.http.write(trans_line(ln))
line_trans = trans_line_nolabel(ln)
else
line_trans = trans_line(ln)
end
luci.http.write(line_trans)
luci.http.write("\n") luci.http.write("\n")
end end
if not process_status("openclash_streaming_unlock.lua "..type) or not process_status("openclash_streaming_unlock.lua ") then 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...") luci.http.status(500, "Something Wrong While Testing...")
end 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) function trans_line(data)
if data == nil or data == "" then if data == nil or data == "" then
return "" return ""
end end
local no_trans = {}
local line_trans = "" local line_trans = ""
local a = string.find(data, "【")
if not a then 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")
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 local time_part = ""
return string.sub(data, 0, 20) .. luci.i18n.translate(string.sub(data, 21, -1)) local level_part = ""
else local content_start = has_timestamp and 21 or 1
return luci.i18n.translate(data)
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
end end
local b_pos = string.find(data, "】") local segments = {}
if not b_pos then local last_pos = content_start
return luci.i18n.translate(data) local pos = string.find(data, "【", content_start)
end
local b = b_pos + 2 while pos do
local c = 21 if pos > last_pos then
local d = 0 table.insert(segments, {
local v type = "trans",
local x text = string.sub(data, last_pos, pos - 1)
})
end
while true do local close_pos = string.find(data, "】", pos + 1)
table.insert(no_trans, a) if not close_pos then
table.insert(no_trans, b) table.insert(segments, {
type = "trans",
local next_a = string.find(data, "【", b+1) text = string.sub(data, pos, -1)
local next_b = string.find(data, "】", b+1) })
if next_a and next_b then
a = next_a
b = next_b + 2
else
break break
end 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 end
if #no_trans % 2 ~= 0 then if last_pos <= string.len(data) then
table.remove(no_trans) table.insert(segments, {
type = "trans",
text = string.sub(data, last_pos, -1)
})
end end
for k = 1, #no_trans, 2 do line_trans = time_part .. level_part
x = no_trans[k] for _, seg in ipairs(segments) do
v = no_trans[k+1] if seg.type == "trans" then
line_trans = line_trans .. luci.i18n.translate(seg.text)
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
else else
line_trans = line_trans .. luci.i18n.translate(string.sub(data, c, -1)) line_trans = line_trans .. seg.text
end end
end end
@@ -2364,7 +2019,7 @@ function action_myip_check()
if result.ipify and result.ipify.ip then if result.ipify and result.ipify.ip then
local geo_cmd = string.format( 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 result.ipify.ip
) )
local geo_data = luci.sys.exec(geo_cmd) local geo_data = luci.sys.exec(geo_cmd)
@@ -2417,7 +2072,7 @@ function action_website_check()
end end
local cmd = string.format( 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 test_url
) )
@@ -2606,7 +2261,7 @@ function action_switch_oc_setting()
return false return false
end 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 if reload_result ~= "" then
luci.http.status(500, "Switch Failed") 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" local mixed_port = fs.uci_get_config("config", "mixed_port") or "7893"
if not proxy_ip then 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.prepare_content("application/json")
luci.http.write_json(result) luci.http.write_json(result)
return return
@@ -2959,7 +2614,7 @@ function action_generate_pac()
luci.sys.call("chmod 644 " .. pac_file_path) luci.sys.call("chmod 644 " .. pac_file_path)
else 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.prepare_content("application/json")
luci.http.write_json(result) luci.http.write_json(result)
return return
@@ -2972,7 +2627,7 @@ function action_generate_pac()
result.pac_url = pac_url result.pac_url = pac_url
if not auth_exists then 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 end
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
@@ -3640,7 +3295,7 @@ function action_add_subscription()
local address = luci.http.formvalue("address") local address = luci.http.formvalue("address")
local sub_ua = luci.http.formvalue("sub_ua") or "clash.meta" local sub_ua = luci.http.formvalue("sub_ua") or "clash.meta"
local sub_convert = luci.http.formvalue("sub_convert") or "0" 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 template = luci.http.formvalue("template") or ""
local emoji = luci.http.formvalue("emoji") or "false" local emoji = luci.http.formvalue("emoji") or "false"
local udp = luci.http.formvalue("udp") 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 overwrite_dir = "/etc/openclash/overwrite/"
local file_path = overwrite_dir .. section_name local file_path = overwrite_dir .. section_name
if url and url ~= "" then 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) local ret = luci.sys.call(cmd)
if not fs.access(file_path) then if not fs.access(file_path) then
fs.writefile(file_path, "") fs.writefile(file_path, "")
@@ -4259,14 +3914,6 @@ function action_get_subscribe_info_data()
luci.http.status(400, "Bad Request") luci.http.status(400, "Bad Request")
return return
end 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.prepare_content("application/json")
luci.http.write_json(data) luci.http.write_json(get_sub_url(filename))
end end
@@ -8,14 +8,11 @@ local fs = require "luci.openclash"
local uci = require("luci.model.uci").cursor() local uci = require("luci.model.uci").cursor()
m = SimpleForm("openclash",translate("OpenClash")) 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.reset = false
m.submit = false m.submit = false
m:section(SimpleSection).template = "openclash/status" 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/myip"))
m:append(Template("openclash/developer")) m:append(Template("openclash/developer"))
@@ -56,7 +56,6 @@ s:tab("dns", "DNS "..translate("Settings"))
s:tab("meta", translate("Meta Settings")) s:tab("meta", translate("Meta Settings"))
s:tab("smart", translate("Smart Settings")) s:tab("smart", translate("Smart Settings"))
s:tab("rules", translate("Rules Setting")) s:tab("rules", translate("Rules Setting"))
s:tab("developer", translate("Developer Settings"))
----- General Settings ----- General Settings
o = s:taboption("settings", ListValue, "interface_name", translate("Bind Network Interface")) 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" o.template = "openclash/flush_smart_cache"
---- Rules Settings ---- 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 = 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.description = translate("Append Some Rules to Config, Allow Only Traffic Proxies that Match the Rule, Prevent BT/P2P Passing")
o.default = 0 o.default = 0
@@ -496,36 +491,20 @@ function custom_rules_2.write(self, section, value)
end end
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 ]] -- -- [[ Edit Custom DNS ]] --
ds = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)")) ds = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)"))
ds.anonymous = true ds.anonymous = true
ds.addremove = true ds.addremove = true
ds.sortable = 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") ds.extedit = luci.dispatcher.build_url("admin/services/openclash/custom-dns-edit/%s")
function ds.create(...) function ds.create(self, section)
local sid = TypedSection.create(...) local sid = TypedSection.create(self, section)
if sid then 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) luci.http.redirect(ds.extedit % sid)
return return
end end
@@ -541,9 +520,9 @@ end
---- group ---- group
o = ds:option(ListValue, "group", translate("DNS Server Group")) o = ds:option(ListValue, "group", translate("DNS Server Group"))
o:value("nameserver", translate("NameServer ")) o:value("nameserver", translate("nameserver "))
o:value("fallback", translate("FallBack ")) o:value("fallback", translate("fallback "))
o:value("default", translate("Default-NameServer")) o:value("default", translate("default-nameserver"))
o.default = "nameserver" o.default = "nameserver"
o.rempty = false o.rempty = false
@@ -573,53 +552,6 @@ o = ds:option(Flag, "disable_ipv6", translate("Disable-IPv6"))
o.rmempty = false o.rmempty = false
o.default = o.disbled 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 ]] -- -- [[ Edit Authentication ]] --
s = m:section(TypedSection, "authentication", translate("Set Authentication of SOCKS5/HTTP(S)")) s = m:section(TypedSection, "authentication", translate("Set Authentication of SOCKS5/HTTP(S)"))
s.anonymous = true s.anonymous = true
@@ -17,8 +17,6 @@ m = Map(openclash, translate("Config Subscribe Edit"))
m.pageaction = false m.pageaction = false
m.description=translate("Convert Subscribe function of Online is Supported By subconverter Written By tindy X") .. m.description=translate("Convert Subscribe function of Online is Supported By subconverter Written By tindy X") ..
"<br/>".. "<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/>"..translate("Subconverter external configuration (subscription conversion template) Description: https://github.com/tindy2013/subconverter#external-configuration-file")..
"<br/>".. "<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").. "<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 return value
end 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 ---- UA
o = s:option(Value, "sub_ua", "User-Agent") 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 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.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.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: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.wcc.best/sub", translate("api.wcc.best"))
o:value("https://api.asailor.org/sub", translate("api.asailor.org")) o:value("https://api.asailor.org/sub", translate("api.asailor.org"))
o.default = "https://api.dler.io/sub" o.default = "https://api.wcc.best/sub"
o.placeholder = "https://api.dler.io/sub" o.placeholder = "https://api.wcc.best/sub"
---- Template ---- Template
o = s:option(ListValue, "template", translate("Template Name")) o = s:option(ListValue, "template", translate("Template Name"))
@@ -196,10 +167,10 @@ o.rmempty = true
---- de_exkey ---- de_exkey
o = s:option(MultiValue, "de_ex_keyword", font_red..bold_on..translate("Exclude Keyword Match Default")..bold_off..font_off) o = s:option(MultiValue, "de_ex_keyword", font_red..bold_on..translate("Exclude Keyword Match Default")..bold_off..font_off)
o.rmempty = true o.rmempty = true
o:value("过期时间") o:value(translate("Expire"))
o:value("剩余流量") o:value(translate("Traffic"))
o:value("TG群") o:value(translate("Plan"))
o:value("官网") o:value(translate("Official"))
local t = { local t = {
{Commit, Back} {Commit, Back}
@@ -149,7 +149,6 @@ o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings") o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:commit("openclash") m.uci:commit("openclash")
end end
@@ -157,18 +156,8 @@ o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Update Config") o.inputtitle = translate("Update Config")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:set("openclash", "config", "enable", 1) m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash") 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 &") SYS.call("/usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash")) HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end end
@@ -57,16 +57,11 @@ um = sul:option(DummyValue, "", nil)
um.template = "openclash/dvalue" um.template = "openclash/dvalue"
local dir, fd, clash local dir, fd, clash
clash = "/etc/openclash/clash"
dir = "/etc/openclash/config/" dir = "/etc/openclash/config/"
bakck_dir="/etc/openclash/backup"
proxy_pro_dir="/etc/openclash/proxy_provider/" proxy_pro_dir="/etc/openclash/proxy_provider/"
rule_pro_dir="/etc/openclash/rule_provider/" rule_pro_dir="/etc/openclash/rule_provider/"
core_dir="/etc/openclash/core/core/" core_dir="/etc/openclash/core/core/"
backup_dir="/tmp/" 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( HTTP.setfilehandler(
function(meta, chunk, eof) function(meta, chunk, eof)
@@ -101,15 +96,11 @@ HTTP.setfilehandler(
if fp == "config" then if fp == "config" then
CHIF = "1" CHIF = "1"
if IsYamlFile(meta.file) then 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) default_config_set(meta.file)
end end
if IsYmlFile(meta.file) then if IsYmlFile(meta.file) then
local ymlname=string.lower(string.sub(meta.file,0,-5)) 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.rename(dir .. meta.file,"/etc/openclash/config/".. ymlname .. ".yaml")
local c=fs.copy("/etc/openclash/config/".. ymlname .. ".yaml",ymlbackup)
local yamlname=ymlname .. ".yaml" local yamlname=ymlname .. ".yaml"
default_config_set(yamlname) default_config_set(yamlname)
end end
@@ -160,7 +151,6 @@ HTTP.setfilehandler(
fs.unlink(backup_dir .. meta.file) fs.unlink(backup_dir .. meta.file)
um.value = translate("Backup File Restore Successful!") um.value = translate("Backup File Restore Successful!")
end end
fs.unlink("/tmp/Proxy_Group")
end end
end end
) )
@@ -177,12 +167,7 @@ a=fs.stat(o)
if a then if a then
e[t]={} e[t]={}
e[t].name=fs.basename(o) e[t].name=fs.basename(o)
BACKUP_FILE="/etc/openclash/backup/".. e[t].name e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
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
if fs.uci_get_config("config", "config_path") and string.sub(fs.uci_get_config("config", "config_path"), 23, -1) == e[t].name then 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") e[t].state=translate("Enabled")
else else
@@ -206,22 +191,27 @@ st.template="openclash/cfg_check"
sb.template="openclash/sub_info_show" sb.template="openclash/sub_info_show"
btnis=tb:option(Button,"switch",translate("SwiTch")) btnis=tb:option(Button,"switch",translate("SwiTch"))
btnis.template="openclash/other_button"
btnis.render=function(o,t,a) btnis.render=function(o,t,a)
if not e[t] then return false end if not e[t] then return false end
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
a.display="" a.display=""
else else
a.display="none" a.display="none"
end end
o.inputstyle="apply" o.inputstyle="apply"
Button.render(o,t,a) Button.render(o,t,a)
end end
btnis.write=function(a,t) btnis.write=function(a,t)
fs.unlink("/tmp/Proxy_Group") uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name) uci:commit("openclash")
uci:commit("openclash") HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
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 end
btnrn=tb:option(DummyValue,"/etc/openclash/config/",translate("Rename")) 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 if not e[t] then return end
self.keylist = {} self.keylist = {}
self.vallist = {} self.vallist = {}
-- Edit -- Servers manage
table.insert(self.keylist, "edit") table.insert(self.keylist, "servers_manage")
table.insert(self.vallist, translate("Edit")) table.insert(self.vallist, translate("Servers Manage"))
-- Copy -- Copy
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then 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 if not e[t] then return end
local action = self.map:formvalue("cbid." .. self.map.config .. "." .. t .. ".actions") 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) 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 elseif action == "copy" then
local num = 1 local num = 1
while true do while true do
@@ -325,8 +315,6 @@ btnapply.write = function(self, t)
fd:close() fd:close()
HTTP.close() HTTP.close()
elseif action == "remove" then 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/history/"..fs.filename(e[t].name)..".db")
fs.unlink("/etc/openclash/"..fs.basename(e[t].name)) fs.unlink("/etc/openclash/"..fs.basename(e[t].name))
local a=fs.unlink("/etc/openclash/config/"..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 p.submit = false
local provider_manage = { local provider_manage = {
{proxy_mg, rule_mg, game_mg} {proxy_mg, rule_mg}
} }
promg = p:section(Table, provider_manage) 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")) HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
end 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 = SimpleForm("openclash",translate("Config File Edit"))
m.reset = false m.reset = false
m.submit = false m.submit = false
@@ -429,7 +410,6 @@ o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings") o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
fs.unlink("/tmp/Proxy_Group")
uci:commit("openclash") uci:commit("openclash")
end end
@@ -442,7 +422,6 @@ o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Apply Settings") o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
fs.unlink("/tmp/Proxy_Group")
uci:set("openclash", "config", "enable", 1) uci:set("openclash", "config", "enable", 1)
uci:commit("openclash") uci:commit("openclash")
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &") SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
@@ -78,6 +78,12 @@ o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("
o.rmempty = false o.rmempty = false
o.default = o.disbled 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 ---- Force HTTP/3
o = s:option(Flag, "http3", translate("Force HTTP/3"), translate("Force HTTP/3 to connect")) o = s:option(Flag, "http3", translate("Force HTTP/3"), translate("Force HTTP/3 to connect"))
o:depends("type", "https") o:depends("type", "https")
@@ -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
@@ -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
@@ -5,6 +5,15 @@ local uci = luci.model.uci.cursor()
local fs = require "luci.openclash" local fs = require "luci.openclash"
local sys = require "luci.sys" local sys = require "luci.sys"
local sid = arg[1] 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_red = [[<b style=color:red>]]
font_off = [[</b>]] font_off = [[</b>]]
@@ -24,7 +33,7 @@ end
m = Map(openclash, translate("Edit Group")) m = Map(openclash, translate("Edit Group"))
m.pageaction = false 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 if m.uci:get(openclash, sid) ~= "groups" then
luci.http.redirect(m.redirect) luci.http.redirect(m.redirect)
return 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.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")) o:value("all", translate("All Groups"))
uci:foreach("openclash", "groups", uci:foreach("openclash", "groups",
function(s) function(s)
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") then 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) o:value(s.name)
end end
end) end)
o:value("DIRECT") o:value("DIRECT")
o:value("REJECT") o:value("REJECT")
o:value("REJECT-DROP") o:value("REJECT-DROP")
@@ -194,6 +203,107 @@ o:value("PASS")
o:value("GLOBAL") o:value("GLOBAL")
o.rmempty = true 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 = { local t = {
{Commit, Back} {Commit, Back}
} }
@@ -203,8 +313,11 @@ o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings") o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() 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) m.uci:commit(openclash)
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
luci.http.redirect(m.redirect) luci.http.redirect(m.redirect)
end end
@@ -3,7 +3,6 @@ local SYS = require "luci.sys"
local HTTP = require "luci.http" local HTTP = require "luci.http"
local fs = require "luci.openclash" local fs = require "luci.openclash"
local file_path = "" local file_path = ""
local edit_file_name = "/tmp/openclash_edit_file_name"
for i = 2, #(arg) do for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i]) 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) file_path = luci.http.urldecode(file_path)
end 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 = Map("openclash", translate("File Edit"))
m.pageaction = false m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/"..arg[1]) m.redirect = luci.dispatcher.build_url("admin/services/openclash/"..arg[1])
@@ -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
@@ -5,6 +5,15 @@ local uci = luci.model.uci.cursor()
local sys = require "luci.sys" local sys = require "luci.sys"
local sid = arg[1] local sid = arg[1]
local fs = require "luci.openclash" 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_red = [[<b style=color:red>]]
font_off = [[</b>]] font_off = [[</b>]]
@@ -24,7 +33,7 @@ end
m = Map(openclash, translate("Edit Proxy-Provider")) m = Map(openclash, translate("Edit Proxy-Provider"))
m.pageaction = false 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 if m.uci:get(openclash, sid) ~= "proxy-provider" then
luci.http.redirect(m.redirect) luci.http.redirect(m.redirect)
return return
@@ -49,11 +58,6 @@ for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
end end
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 = s:option(ListValue, "type", translate("Provider Type"))
o.rmempty = true o.rmempty = true
o.description = translate("Choose The Provider Type") o.description = translate("Choose The Provider Type")
@@ -158,12 +162,12 @@ function o.validate(self, value)
end end
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)")) 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.rmempty = true
o:value("all", translate("All Groups")) o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups", m.uci:foreach("openclash", "groups",
function(s) 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) o:value(s.name)
end end
end) end)
@@ -43,7 +43,6 @@ btned1.write=function(r,x)
end end
btndl1 = tb1:option(Button,"download1",translate("Download Config")) btndl1 = tb1:option(Button,"download1",translate("Download Config"))
btndl1.template="openclash/other_button"
btndl1.render=function(y,x,r) btndl1.render=function(y,x,r)
y.inputstyle="remove" y.inputstyle="remove"
Button.render(y,x,r) Button.render(y,x,r)
@@ -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
@@ -43,7 +43,6 @@ btned1.write=function(h,n)
end end
btndl2 = tb2:option(Button,"download2",translate("Download Config")) btndl2 = tb2:option(Button,"download2",translate("Download Config"))
btndl2.template="openclash/other_button"
btndl2.render=function(m,n,h) btndl2.render=function(m,n,h)
m.inputstyle="remove" m.inputstyle="remove"
Button.render(m,n,h) Button.render(m,n,h)
@@ -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
@@ -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
@@ -6,6 +6,15 @@ local fs = require "luci.openclash"
local sys = require "luci.sys" local sys = require "luci.sys"
local sid = arg[1] local sid = arg[1]
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid") 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_red = [[<b style=color:red>]]
font_off = [[</b>]] font_off = [[</b>]]
@@ -99,7 +108,7 @@ local obfs = {
m = Map(openclash, translate("Edit Server")) m = Map(openclash, translate("Edit Server"))
m.pageaction = false 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 if m.uci:get(openclash, sid) ~= "servers" then
luci.http.redirect(m.redirect) luci.http.redirect(m.redirect)
@@ -130,11 +139,6 @@ for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
end end
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 = s:option(ListValue, "type", translate("Server Node Type"))
o:value("ss", translate("Shadowsocks")) o:value("ss", translate("Shadowsocks"))
o:value("ssr", translate("ShadowsocksR")) 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 o.description = font_red..bold_on..translate("The added Dialer Proxy or Group Must Exist")..bold_off..font_off
m.uci:foreach("openclash", "groups", m.uci:foreach("openclash", "groups",
function(s) 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) o:value(s.name)
end end
end) end)
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)")) 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.rmempty = true
o:value("all", translate("All Groups")) o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups", m.uci:foreach("openclash", "groups",
function(s) 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) o:value(s.name)
end end
end) end)
@@ -3,13 +3,17 @@ local m, s, o
local openclash = "openclash" local openclash = "openclash"
local uci = luci.model.uci.cursor() local uci = luci.model.uci.cursor()
local fs = require "luci.openclash" local fs = require "luci.openclash"
local file_path = ""
font_red = [[<b style=color:red>]] for i = 1, #(arg) do
font_off = [[</b>]] file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
bold_on = [[<strong>]] end
bold_off = [[</strong>]]
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.pageaction = false
m.description=translate("Attention:").. m.description=translate("Attention:")..
"<br/>"..translate("1. Before modifying the configuration file, please click the button below to read the configuration file").. "<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 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>" "<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 ]]-- -- [[ Groups Manage ]]--
s = m:section(TypedSection, "groups", translate("Proxy Groups(No Need Set when Config Create)")) gs = m:section(TypedSection, "groups", translate("Proxy Groups"))
s.anonymous = true gs.anonymous = true
s.addremove = true gs.addremove = true
s.sortable = true gs.sortable = true
s.template = "openclash/tblsection" gs.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s") gs.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s"..file_path)
function s.create(...) function gs.create(self, section)
local sid = TypedSection.create(...) local sid = TypedSection.create(self, section)
if sid then 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 return
end end
end end
---- enable flag ---- enable flag
o = s:option(Flag, "enabled", translate("Enable")) o = gs:option(Flag, "enabled", translate("Enable"))
o.rmempty = false o.rmempty = false
o.default = o.enabled o.default = o.enabled
o.cfgvalue = function(...) o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1" return Flag.cfgvalue(...) or "1"
end end
o = s:option(DummyValue, "config", translate("Config File")) o = gs:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all") return Value.cfgvalue(...) or translate("all")
end end
o = s:option(DummyValue, "type", translate("Group Type")) o = gs:option(DummyValue, "type", translate("Group Type"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
o = s:option(DummyValue, "name", translate("Group Name")) o = gs:option(DummyValue, "name", translate("Group Name"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
-- [[ Proxy-Provider Manage ]]-- -- [[ Proxy-Provider Manage ]]--
s = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider")) ps = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
s.anonymous = true ps.anonymous = true
s.addremove = true ps.addremove = true
s.sortable = true ps.sortable = true
s.template = "openclash/tblsection" ps.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s") ps.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s"..file_path)
function s.create(...) function ps.create(self, section)
local sid = TypedSection.create(...) local sid = TypedSection.create(self, section)
if sid then 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 return
end end
end end
o = s:option(Flag, "enabled", translate("Enable")) o = ps:option(Flag, "enabled", translate("Enable"))
o.rmempty = false o.rmempty = false
o.default = o.enabled o.default = o.enabled
o.cfgvalue = function(...) o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1" return Flag.cfgvalue(...) or "1"
end end
o = s:option(Flag, "manual", translate("Custom Tag")) o = ps:option(DummyValue, "config", translate("Config File"))
o.rmempty = false
o.default = "0"
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
o = s:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all") return Value.cfgvalue(...) or translate("all")
end end
o = s:option(DummyValue, "type", translate("Provider Type")) o = ps:option(DummyValue, "type", translate("Provider Type"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
o = s:option(DummyValue, "name", translate("Provider Name")) o = ps:option(DummyValue, "name", translate("Provider Name"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
-- [[ Servers Manage ]]-- -- [[ Servers Manage ]]--
s = m:section(TypedSection, "servers", translate("Proxies")) ss = m:section(TypedSection, "servers", translate("Proxies"))
s.anonymous = true ss.anonymous = true
s.addremove = true ss.addremove = true
s.sortable = true ss.sortable = true
s.template = "openclash/tblsection" ss.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s") ss.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s"..file_path)
function s.create(...) function ss.create(self, section)
local sid = TypedSection.create(...) local sid = TypedSection.create(self, section)
if sid then 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 return
end end
end end
---- enable flag ---- enable flag
o = s:option(Flag, "enabled", translate("Enable")) o = ss:option(Flag, "enabled", translate("Enable"))
o.rmempty = false o.rmempty = false
o.default = o.enabled o.default = o.enabled
o.cfgvalue = function(...) o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1" return Flag.cfgvalue(...) or "1"
end end
o = s:option(Flag, "manual", translate("Custom Tag")) o = ss:option(DummyValue, "config", translate("Config File"))
o.rmempty = false
o.default = "0"
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
o = s:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all") return Value.cfgvalue(...) or translate("all")
end end
o = s:option(DummyValue, "type", translate("Type")) o = ss:option(DummyValue, "type", translate("Type"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
o = s:option(DummyValue, "name", translate("Server Alias")) o = ss:option(DummyValue, "name", translate("Server Alias"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
o = s:option(DummyValue, "server", translate("Server Address")) o = ss:option(DummyValue, "server", translate("Server Address"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
o = s:option(DummyValue, "port", translate("Server Port")) o = ss:option(DummyValue, "port", translate("Server Port"))
function o.cfgvalue(...) function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None") return Value.cfgvalue(...) or translate("None")
end end
o = s:option(DummyValue, "udp", translate("UDP Support")) o = ss:option(DummyValue, "udp", translate("UDP Support"))
function o.cfgvalue(...) function o.cfgvalue(...)
if Value.cfgvalue(...) == "true" then if Value.cfgvalue(...) == "true" then
return translate("Enable") return translate("Enable")
@@ -207,8 +178,13 @@ o = b:option(Button,"Delete_Unused_Servers", " ")
o.inputtitle = translate("Delete Unused Servers") o.inputtitle = translate("Delete Unused Servers")
o.inputstyle = "reset" o.inputstyle = "reset"
o.write = function() o.write = function()
luci.sys.call("sh /usr/share/openclash/cfg_unused_servers_del.sh 2>/dev/null") m.uci:foreach("openclash", "servers",
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers")) function(s)
if s.enabled ~= "1" then
m.uci:delete("openclash", s[".name"])
end
end)
m.uci:commit("openclash")
end end
o = b:option(Button,"Delete_Servers", " ") o = b:option(Button,"Delete_Servers", " ")
@@ -217,7 +193,6 @@ o.inputstyle = "reset"
o.write = function() o.write = function()
m.uci:delete_all("openclash", "servers", function(s) return true end) m.uci:delete_all("openclash", "servers", function(s) return true end)
m.uci:commit("openclash") m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end end
o = b:option(Button,"Delete_Proxy_Provider", " ") o = b:option(Button,"Delete_Proxy_Provider", " ")
@@ -226,7 +201,6 @@ o.inputstyle = "reset"
o.write = function() o.write = function()
m.uci:delete_all("openclash", "proxy-provider", function(s) return true end) m.uci:delete_all("openclash", "proxy-provider", function(s) return true end)
m.uci:commit("openclash") m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end end
o = b:option(Button,"Delete_Groups", " ") o = b:option(Button,"Delete_Groups", " ")
@@ -235,11 +209,10 @@ o.inputstyle = "reset"
o.write = function() o.write = function()
m.uci:delete_all("openclash", "groups", function(s) return true end) m.uci:delete_all("openclash", "groups", function(s) return true end)
m.uci:commit("openclash") m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end end
local t = { local t = {
{Load_Config, Commit, Apply} {Load_Config, Commit, Apply, Back}
} }
a = m:section(Table, t) a = m:section(Table, t)
@@ -249,15 +222,13 @@ o.inputtitle = translate("Read Config")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
m.uci:commit("openclash") m.uci:commit("openclash")
luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &") luci.sys.call("/usr/share/openclash/yml_groups_get.sh \"%s\" 2>/dev/null" % file_path)
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
end end
o = a:option(Button, "Commit", " ") o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings") o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:commit("openclash") m.uci:commit("openclash")
end end
@@ -266,9 +237,14 @@ o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply" o.inputstyle = "apply"
o.write = function() o.write = function()
m.uci:commit("openclash") m.uci:commit("openclash")
fs.unlink("/tmp/Proxy_Group") luci.sys.call("/usr/share/openclash/yml_groups_set.sh \"%s\" >/dev/null 2>&1 &" % file_path)
luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &") end
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
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 end
m:append(Template("openclash/toolbar_show")) m:append(Template("openclash/toolbar_show"))
@@ -8,6 +8,13 @@ local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor() local uci = require "luci.model.uci".cursor()
local json = require "luci.jsonc" local json = require "luci.jsonc"
local datatype = require "luci.cbi.datatypes" 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 专用) -- 优化 CBI UI(新版 LuCI 专用)
local function optimize_cbi_ui() 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("version_update", translate("Version Update"))
s:tab("developer", translate("Developer Settings")) s:tab("developer", translate("Developer Settings"))
s:tab("debug", translate("Debug Logs")) 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 = 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") 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.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.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"), 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")) "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.default = "tcp"
o.rmempty = false 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 = s2:option(Value, "dscp", translate("DSCP"))
o.datatype = "range(0,63)" o.datatype = "range(0,63)"
o.rmempty = true 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 = 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.description = translate("Select WAN Interface Name For The Intranet Allowed")
o:depends("intranet_allowed", "1") o:depends("intranet_allowed", "1")
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null") for _, dev in ipairs(devices) do
for interface in string.gmatch(interfaces, "%S+") do o:value(dev.name)
o:value(interface)
end end
o = s:taboption("traffic_control", ListValue, "lan_interface_name", translate("LAN Interface Name")) o = s:taboption("traffic_control", ListValue, "lan_interface_name", translate("LAN Interface Name"))
o.description = translate("Select LAN Interface Name") o.description = translate("Select LAN Interface Name")
o:value("0", translate("Disable")) o:value("0", translate("Disable"))
o.default = "0" o.default = "0"
for interface in string.gmatch(interfaces, "%S+") do for _, dev in ipairs(devices) do
o:value(interface) o:value(dev.name)
end end
o = s:taboption("traffic_control", Value, "local_network_pass", translate("Local IPv4 Network Bypassed List")) 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") o:depends("stream_auto_select_openai", "1")
---- update Settings ---- 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 = s:taboption("geo_update", Flag, "geo_auto_update", font_red..bold_on..translate("Auto Update GeoIP MMDB")..bold_off..font_off)
o.default = 0 o.default = 0
@@ -911,7 +920,7 @@ o:depends("geo_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOIP Update")) o = s:taboption("geo_update", Button, translate("GEOIP Update"))
o.title = translate("Update GeoIP MMDB") 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.inputtitle = translate("Check And Update")
o.inputstyle = "reload" o.inputstyle = "reload"
o.write = function() o.write = function()
@@ -954,7 +963,7 @@ o:depends("geoip_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOIP Dat Update")) o = s:taboption("geo_update", Button, translate("GEOIP Dat Update"))
o.title = translate("Update GeoIP Dat") 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.inputtitle = translate("Check And Update")
o.inputstyle = "reload" o.inputstyle = "reload"
o.write = function() o.write = function()
@@ -997,7 +1006,7 @@ o:depends("geosite_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOSITE Update")) o = s:taboption("geo_update", Button, translate("GEOSITE Update"))
o.title = translate("Update GeoSite Database") 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.inputtitle = translate("Check And Update")
o.inputstyle = "reload" o.inputstyle = "reload"
o.write = function() o.write = function()
@@ -1040,7 +1049,7 @@ o:depends("geoasn_auto_update", "1")
o = s:taboption("geo_update", Button, translate("ASN Update")) o = s:taboption("geo_update", Button, translate("ASN Update"))
o.title = translate("Update Geo ASN Database") 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.inputtitle = translate("Check And Update")
o.inputstyle = "reload" o.inputstyle = "reload"
o.write = function() 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 = s:taboption("chnr_update", Button, translate("Chnroute Lists Update"))
o.title = translate("Update Chnroute Lists") 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.inputtitle = translate("Check And Update")
o.inputstyle = "reload" o.inputstyle = "reload"
o.write = function() o.write = function()
@@ -1298,54 +1308,6 @@ end
o = s:taboption("debug", DummyValue, "", nil) o = s:taboption("debug", DummyValue, "", nil)
o.template = "openclash/debug" 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 = { local t = {
{Commit, Apply} {Commit, Apply}
} }
+9 -6
View File
@@ -315,12 +315,15 @@ function get_resourse_mtime(path)
end end
end end
local file = fs.readlink(real_path) or real_path local file = fs.readlink(real_path) or real_path
local model_version = os.date("%Y-%m-%d %H:%M:%S", mtime(real_path)) local resourse_etag_version = SYS.exec(string.format("source /usr/share/openclash/openclash_etag.sh && GET_ETAG_TIMESTAMP_BY_PATH '%s'", real_path))
if model_version and model_version ~= "" then if resourse_etag_version and resourse_etag_version ~= "" then
return model_version return resourse_etag_version
else end
return "Unknown" local resourse_version = os.date("%Y-%m-%d %H:%M:%S", mtime(real_path))
end if resourse_version and resourse_version ~= "" then
return resourse_version
end
return "Unknown"
end end
function uci_get_config(section, key) function uci_get_config(section, key)
@@ -1,4 +1,8 @@
<style> <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 { .oc[data-darkmode="true"] .config-editor-model .CodeMirror {
background: var(--bg-white); background: var(--bg-white);
color: var(--text-primary); 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-125 { font-size: 17.5px; }
.oc .config-editor-model .CodeMirror.zoom-150 { font-size: 21px; } .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.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,
#config-mergeview-container .CodeMirror-merge-pane, #config-mergeview-container .CodeMirror-merge-pane,
#config-mergeview-container .CodeMirror, #config-mergeview-container .CodeMirror,
@@ -611,7 +621,6 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css"> <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/lib/codemirror.js"></script>
<script src="/luci-static/resources/openclash/mode/yaml/yaml.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/shell/shell.js"></script>
<script src="/luci-static/resources/openclash/mode/properties/properties.js"></script> <script src="/luci-static/resources/openclash/mode/properties/properties.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldcode.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"> <link rel="stylesheet" href="/luci-static/resources/openclash/addon/merge/merge.css">
<script type="text/javascript"> <script type="text/javascript">
var levelTranslations = {
'info': '<%:Info%>',
'warning': '<%:Warning%>',
'error': '<%:Error%>',
'debug': '<%:Debug%>',
'tip': '<%:Tip%>',
'watchdog': '<%:Watchdog%>',
'fatal': '<%:Fatal%>'
};
var ConfigEditor = { var ConfigEditor = {
overlay: null, overlay: null,
model: null, model: null,
@@ -9,7 +9,7 @@
border: none !important; border: none !important;
} }
.CodeMirror-merge-r-chunk { .CodeMirror-merge-r-chunk {
background: #0095ff2e !important; background: #0095ff2e !important;
} }
.CodeMirror-merge-2pane .CodeMirror-merge-gap { .CodeMirror-merge-2pane .CodeMirror-merge-gap {
height: 700px !important; height: 700px !important;
@@ -28,15 +28,22 @@
box-sizing: border-box; box-sizing: border-box;
word-break: break-all !important; word-break: break-all !important;
overflow-wrap: break-word !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 { :root[data-darkmode="true"] .CodeMirror-merge-gap {
background: #d0cfcf !important; background: #d0cfcf !important;
} }
@font-face {
font-family: 'Twemoji Mozilla';
src: url('/luci-static/resources/openclash/fonts/TwemojiMozilla-flags-B12sb_Bp.woff2') format('woff2');
}
</style> </style>
<link rel="stylesheet" href="/luci-static/resources/openclash/lib/codemirror.css"/> <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.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material-log.css"/> <link rel="stylesheet" href="/luci-static/resources/openclash/theme/log.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/idea.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/fold/foldgutter.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/lint/lint.css">
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/display/fullscreen.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"> <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/lib/codemirror.js"></script>
<script src="/luci-static/resources/openclash/mode/yaml/yaml.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/mode/shell/shell.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script> <script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldgutter.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") local conf = fs.uci_get_config("config", "config_path")
if not conf then conf = "/etc/openclash/config/config.yaml" end if not conf then conf = "/etc/openclash/config/config.yaml" end
local conf_name = fs.basename(conf) 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 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;"> <table id="my_editor_div" style="width: 100%; text-align: center; display: none;">
<tr> <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> <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 if fs.isfile(sconf) then
-%> -%>
@@ -95,6 +104,15 @@ local sconf = "/etc/openclash/"..conf_name
</table> </table>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
var levelTranslations = {
'info': '<%:Info%>',
'warning': '<%:Warning%>',
'error': '<%:Error%>',
'debug': '<%:Debug%>',
'tip': '<%:Tip%>',
'watchdog': '<%:Watchdog%>',
'fatal': '<%:Fatal%>'
};
function isDarkBackground(element) { function isDarkBackground(element) {
var cachedTheme = localStorage.getItem('oc-theme'); 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) { merge_editor.edit.on("change", function(cm) {
id.value = cm.getValue(); id.value = cm.getValue();
}); });
if (wid && height) { if (wid && height) {
merge_editor.editor().setSize(wid, height); merge_editor.editor().setSize(wid, height);
@@ -233,27 +251,27 @@ function editor(id, readOnly, wid, height)
lint: true, lint: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"], gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
extraKeys: { extraKeys: {
"F11": function(cm) { "F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen")); cm.setOption("fullScreen", !cm.getOption("fullScreen"));
}, },
"Esc": function(cm) { "Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}, },
"Tab": function(cm) { "Tab": function(cm) {
if (cm.somethingSelected()) { if (cm.somethingSelected()) {
cm.indentSelection('add') cm.indentSelection('add')
} else { } else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ") var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces) cm.replaceSelection(spaces)
} }
} }
} }
}); });
if (readOnly == "true") { if (readOnly) {
editor.setOption("readOnly","true"); editor.setOption("readOnly","true");
}; };
if (wid && height) { if (wid && height) {
editor.setSize(wid, height); editor.setSize(wid, height);
}; };
@@ -272,21 +290,21 @@ function shell_editor(id, readOnly, wid, height)
foldGutter: true, foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: { extraKeys: {
"F11": function(cm) { "F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen")); cm.setOption("fullScreen", !cm.getOption("fullScreen"));
}, },
"Esc": function(cm) { "Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}, },
"Tab": function(cm) { "Tab": function(cm) {
if (cm.somethingSelected()) { if (cm.somethingSelected()) {
cm.indentSelection('add') cm.indentSelection('add')
} else { } else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ") var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces) cm.replaceSelection(spaces)
} }
} }
} }
}); });
if (wid && height) { if (wid && height) {
@@ -297,7 +315,7 @@ function shell_editor(id, readOnly, wid, height)
function other_editor(id, readOnly, wid, height) function other_editor(id, readOnly, wid, height)
{ {
var editor = CodeMirror.fromTextArea(id, { var editor = CodeMirror.fromTextArea(id, {
mode: "lua", mode: "text/yaml",
autoRefresh: true, autoRefresh: true,
styleActiveLine: true, styleActiveLine: true,
lineNumbers: true, lineNumbers: true,
@@ -307,21 +325,21 @@ function other_editor(id, readOnly, wid, height)
foldGutter: true, foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: { extraKeys: {
"F11": function(cm) { "F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen")); cm.setOption("fullScreen", !cm.getOption("fullScreen"));
}, },
"Esc": function(cm) { "Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}, },
"Tab": function(cm) { "Tab": function(cm) {
if (cm.somethingSelected()) { if (cm.somethingSelected()) {
cm.indentSelection('add') cm.indentSelection('add')
} else { } else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ") var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces) cm.replaceSelection(spaces)
} }
} }
} }
}); });
if (wid && height) { 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, { window['editor_' + name] = CodeMirror.fromTextArea(id, {
mode: "lua", mode: "log",
autoRefresh: true, autoRefresh: true,
styleActiveLine: true, styleActiveLine: true,
lineNumbers: true, lineNumbers: true,
theme: "idea", theme: "log",
lineWrapping: true, lineWrapping: true,
matchBrackets: true, matchBrackets: false,
foldGutter: true, foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: { extraKeys: {
"F11": function(cm) { "F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen")); cm.setOption("fullScreen", !cm.getOption("fullScreen"));
}, },
"Esc": function(cm) { "Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
} }
} }
}); });
if (readOnly == "true") { if (readOnly) {
other_log_area.setOption("readOnly","true"); window['editor_' + name].setOption("readOnly","true");
}; };
if (wid && height) { 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) { 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_firewall = document.getElementById("cbid.openclash.config.firewall_custom");
var custom_ymchange = document.getElementById("cbid.openclash.config.ymchange_custom");
if (custom_firewall) { if (custom_firewall) {
shell_editor(custom_firewall, 'false', "100%", '300px'); shell_editor(custom_firewall, false, "100%", '300px');
};
if (custom_ymchange) {
shell_editor(custom_ymchange, 'false', "100%", '300px');
}; };
var myEditor_use = document.getElementById("cbid.table.1.user"); 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) { if (myEditor_use && myEditor_def) {
var myEditor_div_use = document.getElementById("cbi-table-1-user"); var myEditor_div_use = document.getElementById("cbi-table-1-user");
var myEditor_div_def = document.getElementById("cbi-table-1-default"); 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.parentNode.style.cssText="text-align: left !important"
myEditor_div_def.parentNode.className='cbi-value'; myEditor_div_def.parentNode.className='cbi-value';
myEditor_div_def.parentNode.style.display="revert" 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.className='cbi-value';
myEditor_div_use.parentNode.style.display="revert" myEditor_div_use.parentNode.style.display="revert"
myEditor_div_use.parentNode.style.width="100%" 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"); 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"); var myEditor_proxy_name_pol = document.getElementById("cbid.openclash.config.custom_proxy_server_dns_policy");
if (myEditor_hosts) { if (myEditor_hosts) {
editor(myEditor_hosts, 'false', '100%', '300px'); editor(myEditor_hosts, false, '100%', '300px');
}; };
if (myEditor_edit_file) { if (myEditor_edit_file) {
editor(myEditor_edit_file, 'false', '100%', '700px'); editor(myEditor_edit_file, false, '100%', '700px');
}; };
if (myEditor_fall_fil) { if (myEditor_fall_fil) {
editor(myEditor_fall_fil, 'false', '100%', '300px'); editor(myEditor_fall_fil, false, '100%', '300px');
}; };
if (myEditor_name_pol) { if (myEditor_name_pol) {
editor(myEditor_name_pol, 'false', '100%', '300px'); editor(myEditor_name_pol, false, '100%', '300px');
}; };
if (myEditor_proxy_name_pol) { 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) { if (myEditor_name_cus_r1) {
editor(myEditor_name_cus_r1, 'false', '100%', '300px'); editor(myEditor_name_cus_r1, false, '100%', '300px');
editor(myEditor_name_cus_r2, 'false', '100%', '300px'); editor(myEditor_name_cus_r2, false, '100%', '300px');
}; };
if (myEditor_fake_filter) { 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) { 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) { if (myEditor_custom_sniffer) {
other_editor(myEditor_custom_sniffer, 'false', '100%', '300px'); 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');
};
}; };
var proxy_mg = document.getElementById('cbi-table-1-proxy_mg'); var proxy_mg = document.getElementById('cbi-table-1-proxy_mg');
var rule_mg = document.getElementById('cbi-table-1-rule_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 Commit = document.getElementById('cbi-table-1-Commit');
var Apply = document.getElementById('cbi-table-1-Apply'); var Apply = document.getElementById('cbi-table-1-Apply');
var Create = document.getElementById('cbi-table-1-Create'); var Create = document.getElementById('cbi-table-1-Create');
@@ -506,7 +474,6 @@ var Create = document.getElementById('cbi-table-1-Create');
if (proxy_mg) { if (proxy_mg) {
proxy_mg.style.textAlign="center"; proxy_mg.style.textAlign="center";
rule_mg.style.textAlign="center"; rule_mg.style.textAlign="center";
game_mg.style.textAlign="center";
Commit.style.textAlign="center"; Commit.style.textAlign="center";
Apply.style.textAlign="center"; Apply.style.textAlign="center";
Create.style.textAlign="center"; Create.style.textAlign="center";
@@ -785,7 +785,6 @@
<label for="convert-address-input"><%:Convert Address%>:</label> <label for="convert-address-input"><%:Convert Address%>:</label>
<div class="form-select-wrapper"> <div class="form-select-wrapper">
<select id="convert-address-input" class="form-select"> <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.wcc.best/sub">api.wcc.best</option>
<option value="https://api.asailor.org/sub">api.asailor.org</option> <option value="https://api.asailor.org/sub">api.asailor.org</option>
<option value="custom"><%:Custom%></option> <option value="custom"><%:Custom%></option>
@@ -901,24 +900,24 @@
<label for="exclude-default-select"><%:Exclude Keyword Match Default%>:</label> <label for="exclude-default-select"><%:Exclude Keyword Match Default%>:</label>
<div class="form-checkbox-group"> <div class="form-checkbox-group">
<label class="form-checkbox"> <label class="form-checkbox">
<input type="checkbox" id="exclude-expire" value="过期时间"> <input type="checkbox" id="exclude-expire" value="<%:Expire%>">
<span class="checkmark"></span> <span class="checkmark"></span>
<%:Expire Time%> <%:Expire%>
</label> </label>
<label class="form-checkbox"> <label class="form-checkbox">
<input type="checkbox" id="exclude-traffic" value="剩余流量"> <input type="checkbox" id="exclude-traffic" value="<%:Traffic%>">
<span class="checkmark"></span> <span class="checkmark"></span>
<%:Remaining Traffic%> <%:Traffic%>
</label> </label>
<label class="form-checkbox"> <label class="form-checkbox">
<input type="checkbox" id="exclude-tg" value="TG群"> <input type="checkbox" id="exclude-plan" value="<%:Plan%>">
<span class="checkmark"></span> <span class="checkmark"></span>
<%:TG Group%> <%:Plan%>
</label> </label>
<label class="form-checkbox"> <label class="form-checkbox">
<input type="checkbox" id="exclude-website" value="官网"> <input type="checkbox" id="exclude-website" value="<%:Official%>">
<span class="checkmark"></span> <span class="checkmark"></span>
<%:Official Website%> <%:Official%>
</label> </label>
</div> </div>
</div> </div>
@@ -1160,7 +1159,7 @@ var ConfigUploader = {
resetAdvancedOptions: function() { resetAdvancedOptions: function() {
document.getElementById('sub-convert-enable').checked = false; document.getElementById('sub-convert-enable').checked = false;
document.getElementById('sub-convert-options').style.display = 'none'; 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').style.display = 'none';
document.getElementById('convert-address-custom').value = ''; document.getElementById('convert-address-custom').value = '';
@@ -1184,7 +1183,7 @@ var ConfigUploader = {
document.getElementById('exclude-keyword-input').value = ''; document.getElementById('exclude-keyword-input').value = '';
document.getElementById('exclude-expire').checked = false; document.getElementById('exclude-expire').checked = false;
document.getElementById('exclude-traffic').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; document.getElementById('exclude-website').checked = false;
}, },
@@ -1249,7 +1248,7 @@ var ConfigUploader = {
document.getElementById('sub-convert-options').style.display = 'block'; document.getElementById('sub-convert-options').style.display = 'block';
if (data.convert_address) { 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; document.getElementById('convert-address-input').value = data.convert_address;
if (data.convert_address === 'custom') { if (data.convert_address === 'custom') {
document.getElementById('convert-address-custom').style.display = 'block'; document.getElementById('convert-address-custom').style.display = 'block';
@@ -1303,10 +1302,10 @@ var ConfigUploader = {
} }
if (data.de_ex_keyword) { if (data.de_ex_keyword) {
var defaults = data.de_ex_keyword.split(' '); var defaults = data.de_ex_keyword.split(' ');
document.getElementById('exclude-expire').checked = defaults.indexOf('过期时间') !== -1; document.getElementById('exclude-expire').checked = defaults.indexOf(document.getElementById('exclude-expire').value) !== -1;
document.getElementById('exclude-traffic').checked = defaults.indexOf('剩余流量') !== -1; document.getElementById('exclude-traffic').checked = defaults.indexOf(document.getElementById('exclude-traffic').value) !== -1;
document.getElementById('exclude-tg').checked = defaults.indexOf('TG群') !== -1; document.getElementById('exclude-plan').checked = defaults.indexOf(document.getElementById('exclude-plan').value) !== -1;
document.getElementById('exclude-website').checked = defaults.indexOf('官网') !== -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 advancedEnabled = document.getElementById('advanced-options-enable').checked;
var subConvert = advancedEnabled && document.getElementById('sub-convert-enable').checked; var subConvert = advancedEnabled && document.getElementById('sub-convert-enable').checked;
var convertAddress = 'https://api.dler.io/sub'; var convertAddress = '';
var template = ''; var template = '';
var emoji = false; var emoji = false;
var udp = false; var udp = false;
@@ -1548,13 +1547,13 @@ var ConfigUploader = {
keywords = document.getElementById('keyword-input').value; keywords = document.getElementById('keyword-input').value;
excludeKeywords = document.getElementById('exclude-keyword-input').value; excludeKeywords = document.getElementById('exclude-keyword-input').value;
if (document.getElementById('exclude-expire').checked) excludeDefaults.push('过期时间'); if (document.getElementById('exclude-expire').checked) excludeDefaults.push(document.getElementById('exclude-expire').value);
if (document.getElementById('exclude-traffic').checked) excludeDefaults.push('剩余流量'); if (document.getElementById('exclude-traffic').checked) excludeDefaults.push(document.getElementById('exclude-traffic').value);
if (document.getElementById('exclude-tg').checked) excludeDefaults.push('TG群'); if (document.getElementById('exclude-plan').checked) excludeDefaults.push(document.getElementById('exclude-plan').value);
if (document.getElementById('exclude-website').checked) excludeDefaults.push('官网'); if (document.getElementById('exclude-website').checked) excludeDefaults.push(document.getElementById('exclude-website').value);
if (convertAddress === 'custom') { if (convertAddress === 'custom') {
convertAddress = convertAddressCustom.trim() || 'https://api.dler.io/sub'; convertAddress = convertAddressCustom.trim();
} }
if (template === '0') { if (template === '0') {
@@ -10,7 +10,13 @@ local dns_host = "www.instagram.com"
<style> <style>
:root[data-darkmode="true"] .diag-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 { :root[data-darkmode="true"] #diag-rc-output > pre {
@@ -24,6 +30,12 @@ local dns_host = "www.instagram.com"
} }
.diag-style { .diag-style {
color: #000;
background-color: #f5f5f5;
}
.diag-style select, .diag-style input {
color: #000;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
@@ -57,12 +69,6 @@ local dns_host = "www.instagram.com"
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
setTimeout(function(){
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
}, 300);
function show_diag_info(addr) function show_diag_info(addr)
{ {
var addr = addr; var addr = addr;
@@ -158,9 +158,6 @@
.oc .developer-grid > span:nth-child(10) { animation-delay: 0.55s; } .oc .developer-grid > span:nth-child(10) { animation-delay: 0.55s; }
.oc .developer-grid > span:nth-child(11) { animation-delay: 0.6s; } .oc .developer-grid > span:nth-child(11) { animation-delay: 0.6s; }
.oc .developer-grid > span:nth-child(12) { animation-delay: 0.65s; } .oc .developer-grid > span:nth-child(12) { animation-delay: 0.65s; }
.oc .developer-grid > span:nth-child(13) { animation-delay: 0.7s; }
.oc .developer-grid > span:nth-child(14) { animation-delay: 0.75s; }
.oc .developer-grid > span:nth-child(15) { animation-delay: 0.8s; }
@keyframes fadeInUp { @keyframes fadeInUp {
to { to {
@@ -290,17 +287,14 @@
<span id="_vernesong"><%:Collecting data...%></span> <span id="_vernesong"><%:Collecting data...%></span>
<span id="_frainzy1477"><%:Collecting data...%></span> <span id="_frainzy1477"><%:Collecting data...%></span>
<span id="_SukkaW"><%:Collecting data...%></span> <span id="_SukkaW"><%:Collecting data...%></span>
<span id="_lhie1_dev"><%:Collecting data...%></span>
<span id="_ConnersHua_dev"><%:Collecting data...%></span>
<span id="_haishanh"><%:Collecting data...%></span> <span id="_haishanh"><%:Collecting data...%></span>
<span id="_MaxMind"><%:Collecting data...%></span> <span id="_Zephyruso"><%:Collecting data...%></span>
<span id="_FQrabbit"><%:Collecting data...%></span>
<span id="_Alecthw"><%:Collecting data...%></span> <span id="_Alecthw"><%:Collecting data...%></span>
<span id="_Tindy_X"><%:Collecting data...%></span> <span id="_Tindy_X"><%:Collecting data...%></span>
<span id="_lmc999"><%:Collecting data...%></span> <span id="_lmc999"><%:Collecting data...%></span>
<span id="_dlercloud"><%:Collecting data...%></span>
<span id="_immortalwrt"><%:Collecting data...%></span> <span id="_immortalwrt"><%:Collecting data...%></span>
<span id="_MetaCubeX"><%:Collecting data...%></span> <span id="_MetaCubeX"><%:Collecting data...%></span>
<span id="_more"><%:Collecting data...%></span>
</div> </div>
</div> </div>
</div> </div>
@@ -311,17 +305,14 @@
var vernesong = document.getElementById('_vernesong'); var vernesong = document.getElementById('_vernesong');
var frainzy1477 = document.getElementById('_frainzy1477'); var frainzy1477 = document.getElementById('_frainzy1477');
var SukkaW = document.getElementById('_SukkaW'); var SukkaW = document.getElementById('_SukkaW');
var lhie1_dev = document.getElementById('_lhie1_dev'); var Zephyruso = document.getElementById('_Zephyruso');
var ConnersHua_dev = document.getElementById('_ConnersHua_dev');
var MaxMind = document.getElementById('_MaxMind');
var haishanh = document.getElementById('_haishanh'); var haishanh = document.getElementById('_haishanh');
var FQrabbit = document.getElementById('_FQrabbit');
var Alecthw = document.getElementById('_Alecthw'); var Alecthw = document.getElementById('_Alecthw');
var Tindy_X = document.getElementById('_Tindy_X'); var Tindy_X = document.getElementById('_Tindy_X');
var dlercloud = document.getElementById('_dlercloud');
var immortalwrt = document.getElementById('_immortalwrt'); var immortalwrt = document.getElementById('_immortalwrt');
var lmc999 = document.getElementById('_lmc999'); var lmc999 = document.getElementById('_lmc999');
var MetaCubeX = document.getElementById('_MetaCubeX'); var MetaCubeX = document.getElementById('_MetaCubeX');
var more = document.getElementById('_more');
function getAvatarSize() { function getAvatarSize() {
var width = window.innerWidth; var width = window.innerWidth;
@@ -341,22 +332,27 @@
'</div>'; '</div>';
} }
function createMoreAvatarHTML(title, clickHandler) {
var size = getAvatarSize();
return '<div class="developer-avatar-container">' +
'<div class="developer-avatar" title="' + title + '" style="display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; color: rgba(255, 255, 255, 0.8);" onclick="return ' + clickHandler + '()">...</div>' +
'<div class="developer-label">' + title + '</div>' +
'</div>';
}
function setAvatars() { function setAvatars() {
Dreamacro.innerHTML = createAvatarHTML('https://avatars3.githubusercontent.com/u/8615343?s=460&v=4', 'Dreamacro', 'Dreamacro', 'Dreamacro_rediret'); Dreamacro.innerHTML = createAvatarHTML('https://avatars3.githubusercontent.com/u/8615343?s=460&v=4', 'Dreamacro', 'Dreamacro', 'Dreamacro_rediret');
vernesong.innerHTML = createAvatarHTML('https://avatars2.githubusercontent.com/u/42875168?s=460&v=4', 'vernesong', 'vernesong', 'vernesong_rediret'); vernesong.innerHTML = createAvatarHTML('https://avatars2.githubusercontent.com/u/42875168?s=460&v=4', 'vernesong', 'vernesong', 'vernesong_rediret');
frainzy1477.innerHTML = createAvatarHTML('https://avatars2.githubusercontent.com/u/49537471?s=460&v=4', 'frainzy1477', 'frainzy1477', 'frainzy1477_rediret'); frainzy1477.innerHTML = createAvatarHTML('https://avatars2.githubusercontent.com/u/49537471?s=460&v=4', 'frainzy1477', 'frainzy1477', 'frainzy1477_rediret');
SukkaW.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/40715044?s=460&v=4', 'SukkaW', 'SukkaW', 'SukkaW_rediret'); SukkaW.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/40715044?s=460&v=4', 'SukkaW', 'SukkaW', 'SukkaW_rediret');
lhie1_dev.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/11873197?s=460&v=4', 'lhie1', 'lhie1', 'lhie1_rediret'); Zephyruso.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/176294927?v=4', 'Zephyruso', 'Zephyruso', 'Zephyruso_rediret');
ConnersHua_dev.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/11730838?s=460&v=4', 'ConnersHua', 'ConnersHua', 'ConnersHua_rediret');
MaxMind.innerHTML = createAvatarHTML('https://avatars3.githubusercontent.com/u/1181834?s=460&v=4', 'MaxMind', 'MaxMind', 'MaxMind_rediret');
haishanh.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/1166872?s=460&v=4', 'haishanh', 'haishanh', 'haishanh_rediret'); haishanh.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/1166872?s=460&v=4', 'haishanh', 'haishanh', 'haishanh_rediret');
FQrabbit.innerHTML = createAvatarHTML('https://avatars1.githubusercontent.com/u/29931248?s=460&v=4', 'FQrabbit', 'FQrabbit', 'FQrabbit_rediret');
Alecthw.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/22856212?v=4', 'Alecthw', 'Alecthw', 'Alecthw_rediret'); Alecthw.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/22856212?v=4', 'Alecthw', 'Alecthw', 'Alecthw_rediret');
Tindy_X.innerHTML = createAvatarHTML('https://avatars0.githubusercontent.com/u/49061470?s=460&u=22a89312bf2de411e87340e04b5f9d149f7366cc&v=4', 'Tindy X', 'Tindy X', 'Tindy_X_rediret'); Tindy_X.innerHTML = createAvatarHTML('https://avatars0.githubusercontent.com/u/49061470?s=460&u=22a89312bf2de411e87340e04b5f9d149f7366cc&v=4', 'Tindy X', 'Tindy X', 'Tindy_X_rediret');
dlercloud.innerHTML = createAvatarHTML('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAAEcq2jCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjFFQjY1RjRCMjJENDExRUM5NjlEQURCQTU4RDMyNUM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjFFQjY1RjRDMjJENDExRUM5NjlEQURCQTU4RDMyNUM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MUVCNjVGNDkyMkQ0MTFFQzk2OURBREJBNThEMzI1QzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MUVCNjVGNEEyMkQ0MTFFQzk2OURBREJBNThEMzI1QzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5CHITsAAACx1BMVEVjY2P+/v79/f1kZGT8/PwDAwMCAgIBAQFiYmIEBAT7+/tlZWX6+vpmZmZnZ2dhYWFpaWnb29toaGhaWlrh4eFgYGAFBQVXV1dNTU1qampVVVXi4uJcXFxYWFhfX19dXV1MTExZWVlsbGw7OztQUFBRUVFSUlLy8vJPT0/d3d0iIiL09PRWVlZUVFS6urqUlJTo6Oj5+fmLi4uxsbGYmJhLS0tzc3P39/fz8/M9PT1TU1OhoaHr6+sZGRkLCwsJCQk3NzdeXl6MjIzDw8N6enqoqKjOzs7V1dXAwMBKSkqjo6OFhYX29va5ublwcHDg4OAxMTFbW1szMzN7e3tCQkIYGBiPj4/c3NwwMDCNjY1FRUUrKystLS1JSUnl5eV3d3fW1tbw8PC/v7+2traJiYmVlZWenp7Nzc2amppOTk6ysrKmpqZubm5ISEh+fn42NjY8PDxHR0c4ODja2to5OTnf398QEBAkJCQfHx8WFhYgICAbGxvq6urt7e28vLwGBgZ0dHTn5+fZ2dnCwsJ4eHgMDAweHh41NTX19fV5eXns7OzY2NigoKAHBwfm5uYICAhvb2+7u7vv7+/MzMwODg5tbW3x8fElJSXKysoXFxdEREQTExOKioru7u6bm5t1dXWdnZ0yMjKpqamGhobS0tLIyMg+Pj6Hh4e3t7cjIyPQ0NAKCgoUFBTR0dEnJyd9fX2BgYEPDw8oKCj4+Pi+vr4sLCwVFRXj4+MdHR2vr686OjohISGQkJA/Pz+rq6unp6e1tbVDQ0OsrKywsLDJyckcHBzFxcWIiIiCgoLk5OTPz8+RkZGTk5Pp6enT09PGxsYaGhqXl5dycnKzs7PU1NSqqqrBwcF/f3+lpaVAQECEhITExMSWlpa0tLSDg4Otra18fHxBQUFGRkbe3t6ZmZlra2s0NDRxcXGioqIuLi4SEhIAAAD///+mEWvaAAAN20lEQVR42mJ4QwAwDE4FTPgVCDAAASNOBYx+QGkOBuYjuBS8ZuAF22KUgF3B69cEHEmEAia8Cl6/fp1GSAEbISsw7MBQ8JqgAia8cYFpBKkKuIAKGPHGJoYjsCjAb0IkATdgxhemAgJp8pAAAQWvh0jOQgUAATREFTDiTw/FwOzPLIwn0YKKBw4GBlwKXF4zbAAzFHFlHK03hDIvIQWsFJtAWAH+NLkRI1+RVYDgVcAIVBCJNzZZCRUgmhgFIXppT8gEoDPvEFLwhlIFBBIt49DMegABRFDBqAFUMIClVEGOQ048g0wDWDkYIICZGdKuIc2A3WxgzaIyLpF5siq8DMwmpBnA/rqfQ4MJf2LHZwC2gooEA5hAJchrRvIN4HtNoQtevybOBJwGzIEYYE22ASysxDmBQCwAQSL5SRlqgib5eYGYgMRrgDHEAFbycyPEAHYm8rMzOCrYKDCAcCAQMECdskCEOMGGEgO0CSZFQmGwhsJClYLyYLRmIh4ABGC/7pEIBsIwAGfXR37WTPwUhiEKf6NMZUbtAHqtUqPTchKdKxhHcAyNIjmEyCYKDfleCiMHyJPN7jfZ982BHPgdQAgIuNYtt91wJA+gTRTQ4pTmEQtYGWnMM9y1YFxtSj9u3auvMaCsQGkRv3yqDstm3ysoRZmAKKN0Das1emzf9jKUGRNKpfZ0oPtsgHkkYJDei4lfBE53YIQmVcUHyP5IVi4SCOBpfc4GynoPbAftCzs2MAvQuG9qoAyN8hu963XhOKNAINHGwl6BCNDGMtHP28QFKCks/LuxY4KlKxmmKhuQAQiEPRTwY8BHGgt2CrrC8+cgHcYQ/IQQBSQISGQFAvojxadgSyxolsCkOs7Teg78DXATgF37d2kYiOIAnrskd2ma2ErRUlR0UbEU6VoVLIggpYLoIgguioKbIFihXQVxcBLRWQQXB0Fd/BccXQRdHC9/hKY/c6IopnlvufsDmk+/d8nde0noH1AABVAABVAAr970rk0cv+ftrx9QAQCI97znurrebHJpbmpwnQACrnK6Jg3906KPTYMAiCfutO+HpRfG7cgBgpnJwP+3rITV6vT5OfTN25ECiqZghcZbaDcxulmtZ0Ib7dZaaXhEz8QTrzQqAM3XS5+kpsVzbz+8+aGkvJKdoZEAjEe/dmPXPcXFX1Y8jSQBmo412xAE5UFE0uZfX4FHAqBzXKAC2q0oYZZsBICx0AaIfpQEZnlHUKUIgM7lBat4uAAhJik8YI0FBfAJkLIUgUC4DSvBCNgtOIA4UgLmBYFOwNiQVgHLgh9K7ZeYJDgHPxUbGVOeBvBjORmSBOwMvC4gu9IsxE4d6MKELMuz4BBggOedBK/PDxBKsy49Ef8NoE8SYICCJ0CmAsuA98ID5KMBBsDY4sgJeIIjLkJ/7Le2JX6PAjC2WfhzSbgGRWs3OnJQAeYSRU2A34BvxxLATFEsAL30b8OHcLVBGABZZewQ/lgu9akwyvPODOx0o0WimtUKoAAKoADogA8B2DmXnSiCKAxT1dX3tjUj6GQM4IAarhJRLkZBlASCJqgBZYMxuFGEBYrGiBs1GI1RE19AIhs1Jl4SE+PGuHRtfAYTU/UQzkzDTNcgAaa7z9lUvUB/85/q02eq/nMUgAJQAApAASgABaAAFIACiAmA5BcWABWCfZ2fr57aoGkxGQAi6LG2TH2NZdXU72zqHt6ymywiAO1J70+5WmGgRW657vQRAeklE21dfsE3FZqrkb4OBuCcPTFbpZV72Sy3y2MgAM6zC365jS0QI/2DAgB4F/kvbR03nbWUPAD7abe4mvRUK2iazUVFS41sdi9WCsCuGTy71s1XtPOl5jZJUCEAa+acN2ir/kU321Y3+qnz1JmlmvZ9GdfVNNf/szmCygDo0/xBfUPwfDezbdAppOPAT8h+d0+f91P+4yQVyN9T9LuFX9/+cs0wCSrI2+1N/nhyAAsG5/qAVWXt2Dvx/+SbywSDN0YSAqBfClc1WS01flCsn3OYaH2Y0JyN4K6qYXZgo31GElGApoJba38MqyBZuazb7eEA0KOBAHoHQ1KgeF2KA+B9tFdDQHEUKHoW/qIAkBLAAkpZ7izbHNfW+8FABrBLto0JFGt3yEFmefAA5EHIuvMOIQR0T7ye2q0DVIcBjhNcAL2OIIeAY+8B3kvA34Jeyc3qM8w8gOMtF31m2Mr5jUEDsE7JT/scXAH6Qo7BFIEOgbwJjDl4gDnZUcyg3fVEzgT6LYSq2IwzGVXQX9AhxcDsw/pnVFy3oe189L6UCsxH4AqUSzBEgQFYrSzBZ3AFyiV4QoAB6LTc4tEIrQAplwA8BOKSJIE+SKEB5HSoT4IrIF7rMcWgQgD5/wHnDnyXjfxJusKgAZxX4WRkL3rgCkhvol1L4QH6Ql1/Zj/4WyDYdxO30ansg4ABcNfABWBvdFwAcgg7BAIdoMWMoSKI0ms2tqs4COAyQiYUzulSNj7MEABIa2kL9BCMPSAQ6wEZQG9kOACTK7nQGKIoAF6djVYVBwBWAKAfILgAkQ7rYgAw7iADRDsjiQ5g3BRYCjgn7ejHtZHywLlcSWIuO3gA+QDcEwIVIPJ5eVSAZoYH4Mzo/KqDqAAdtWeiz2SKEoL3ixgDkUJrLA4DQaTGZ4EMIBSAAlAACkABKAAFoAAUgAKIY/0ToL1zf42jiuL4zp3Zmc3szu52N4/dZNO802DMo82jNm0TE2wTTWNMaNIY7YPWqihpoGhFq0m1+MAXtdVarRWlVqQqglXxFxERFVF8ILine truncated
immortalwrt.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/82308430?v=4', 'immortalwrt', 'immortalwrt', 'immortalwrt_rediret'); immortalwrt.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/82308430?v=4', 'immortalwrt', 'immortalwrt', 'immortalwrt_rediret');
lmc999.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/39726914?v=4', 'lmc999', 'lmc999', 'lmc999_rediret'); lmc999.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/39726914?v=4', 'lmc999', 'lmc999', 'lmc999_rediret');
MetaCubeX.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/84378451?v=4', 'MetaCubeX', 'MetaCubeX', 'MetaCubeX_rediret'); MetaCubeX.innerHTML = createAvatarHTML('https://avatars.githubusercontent.com/u/84378451?v=4', 'MetaCubeX', 'MetaCubeX', 'MetaCubeX_rediret');
more.innerHTML = createMoreAvatarHTML('<%:More%>', 'more_rediret');
} }
setAvatars(); setAvatars();
@@ -377,30 +373,18 @@
function SukkaW_rediret() { function SukkaW_rediret() {
window.open('https://github.com/SukkaW'); window.open('https://github.com/SukkaW');
} }
function lhie1_rediret() { function Zephyruso_rediret() {
window.open('https://github.com/lhie1'); window.open('https://github.com/Zephyruso');
}
function ConnersHua_rediret() {
window.open('https://github.com/ConnersHua');
}
function MaxMind_rediret() {
window.open('https://dev.maxmind.com/geoip/geoip2/geolite2/');
} }
function haishanh_rediret() { function haishanh_rediret() {
window.open('https://github.com/haishanh'); window.open('https://github.com/haishanh');
} }
function FQrabbit_rediret() {
window.open('https://github.com/FQrabbit');
}
function Alecthw_rediret() { function Alecthw_rediret() {
window.open('https://github.com/alecthw'); window.open('https://github.com/alecthw');
} }
function Tindy_X_rediret() { function Tindy_X_rediret() {
window.open('https://github.com/tindy2013'); window.open('https://github.com/tindy2013');
} }
function dlercloud_rediret() {
window.open('https://bit.ly/32mrABp');
}
function immortalwrt_rediret() { function immortalwrt_rediret() {
window.open('https://github.com/immortalwrt'); window.open('https://github.com/immortalwrt');
} }
@@ -410,6 +394,9 @@
function MetaCubeX_rediret() { function MetaCubeX_rediret() {
window.open('https://github.com/MetaCubeX'); window.open('https://github.com/MetaCubeX');
} }
function more_rediret() {
window.open('https://github.com/vernesong/OpenClash/graphs/contributors');
}
function imgerrorfun(imgobj, imgSrc) { function imgerrorfun(imgobj, imgSrc) {
setTimeout(function() { setTimeout(function() {
@@ -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%>
@@ -1,845 +0,0 @@
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
<style>
.oc[data-darkmode="true"] .card {
background: linear-gradient(var(--bg-gray), #657183);
}
.oc[data-darkmode="true"] .card .additional {
background: linear-gradient(#337ab7, #657183);
}
.oc[data-darkmode="true"] .card .general .dler-title {
color: #dfdfdf;
}
.oc[data-darkmode="true"] .card .general .dler-result {
color: #dfdfdf;
}
.oc[data-darkmode="true"] .card .general .dler-result2 {
color: #dfdfdf;
}
.oc[data-darkmode="true"] .card .general h1 {
color: #dfdfdf;
}
.oc[data-darkmode="true"] .card .additional .user-card::after {
border-left: 2px solid #ffffff33;
}
.oc[data-darkmode="true"] .card .additional .more-info h1 {
color: #ededed;
}
.oc[data-darkmode="true"] .card .additional .coords {
color: #ededed;
}
.oc[data-darkmode="true"] .card .general .dler-info::-webkit-scrollbar-thumb {
background: rgba(255,255,255,0.3);
}
.oc[data-darkmode="true"] .card .general .dler-info::-webkit-scrollbar-thumb:hover {
background: rgba(255,255,255,0.4);
}
.oc .dler-main-container {
background: var(--bg-white);
margin: 0 auto;
width: 100%;
transition: all var(--transition-fast);
}
.oc .center {
width: 100%;
background: var(--bg-white);
border: 1px solid var(--border-light);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
padding: 12px;
transition: all var(--transition-fast);
}
.oc .card {
width: 100%;
height: 250px;
background-color: #fff;
background: linear-gradient(#f8f8f8, #fff);
box-shadow: 0 8px 16px -8px rgba(0,0,0,0.4);
border-radius: 6px;
position: relative;
}
.oc .card h1 {
text-align: center;
}
.oc .card .additional {
position: absolute;
width: 150px;
height: 100%;
background: linear-gradient(#337ab7, #fefefe);
transition: width 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0.5s ease;
overflow: hidden;
z-index: 2;
display: flex;
align-items: stretch;
border-radius: var(--radius-lg);
}
.oc .card .additional.expanded {
width: 100%;
}
.oc .card .additional.collapsed {
width: 150px;
}
.oc .card .additional .user-card {
width: 150px;
height: 100%;
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.oc .card .additional .user-card::after {
content: "";
display: block;
position: absolute;
top: 10%;
right: -2px;
height: 80%;
border-left: 2px solid rgba(0,0,0,0.025);
}
.oc .card .additional .user-card .img {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.oc .card .additional .user-card img {
width: 65%;
border-radius: 50%;
position: relative;
top: auto;
left: auto;
bottom: auto;
}
.oc .card .additional .more-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
padding: 1rem;
text-align: center;
transition: opacity 0.3s ease, visibility 0.3s ease;
opacity: 0;
visibility: hidden;
overflow: visible;
}
.oc .card .additional.expanded .more-info {
opacity: 1;
visibility: visible;
}
.oc .card .additional.collapsed .more-info {
opacity: 0;
visibility: hidden;
}
.oc .card .additional .more-info h1 {
color: #fff;
margin: 0.5rem 0;
font-size: 2.5rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border-bottom: none;
position: relative;
line-height: 1.2;
padding-top: 0.2rem;
}
.oc .card .additional .more-info h1::after {
content: "";
position: absolute;
bottom: -0.2rem;
left: 50%;
transform: translateX(-50%);
width: 60%;
height: 1px;
background-color: #eee;
margin-bottom: 5px;
}
.oc .card .additional .coords {
color: #fff;
font-size: 1rem;
line-height: 1.4;
margin: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.oc .card .additional.expanded + .general {
margin-left: 0;
opacity: 0;
}
.oc .card .additional.collapsed + .general {
opacity: 1;
}
.oc .card .general {
width: auto;
height: 100%;
position: relative;
margin-left: 180px;
top: 0;
right: 0;
z-index: 1;
overflow: hidden;
padding-top: 0;
padding-right: 10px;
transition: margin-left 0.5s ease, opacity 0.5s ease;
opacity: 1;
}
.oc .card .general h1 {
font-size: 30px;
text-align: center;
padding-top: 10px;
margin: 0 0 0 -15%;
line-height: 35px;
color: var(--text-title) !important;
}
.oc .card .general .dler-info {
top: 8%;
width: 90%;
height: 65%;
display: grid;
grid-template-columns: 1fr 1fr 120px;
gap: 5%;
position: absolute;
margin: 0 auto;
overflow-y: auto;
overflow-x: hidden;
position: relative;
}
.oc .card .general .dler-info-left {
display: flex;
flex-direction: column;
gap: 4px;
overflow: visible;
}
.oc .card .general .dler-info-center {
display: flex;
flex-direction: column;
gap: 4px;
overflow: visible;
}
.oc .card .general .dler-info-right {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-width: 100px;
width: 100%;
height: 100%;
padding-right: 10px;
}
.oc .card .general .dler-btn-container {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
margin-bottom: 30px;
}
.oc .card .general .dler-info p {
padding: 4px 0 !important;
text-align: left;
margin-bottom: 0;
line-height: 25px;
min-height: 25px;
}
.oc .card .general .dler-info div {
position: relative;
}
.oc .card .general .dler-title {
font-weight: bold;
color: var(--text-primary) !important;
font-size: 15px;
display: inline-block;
width: 45%;
overflow: hidden;
vertical-align: bottom;
white-space: nowrap;
text-overflow: ellipsis;
line-height: 25px;
height: 25px;
text-align: left;
}
.oc .card .general .dler-result {
color: var(--text-secondary) !important;
font-size: 15px;
white-space: nowrap;
display: inline-block;
width: 55%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: bottom;
text-align: right;
line-height: 25px;
height: 25px;
}
.oc .card .general .dler-result2 {
color: var(--text-secondary) !important;
font-size: 15px;
white-space: nowrap;
display: inline-block;
width: 55%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: bottom;
text-align: right;
line-height: 25px;
height: 25px;
}
.oc .card .general .btn {
color: white !important;
border-color: #337ab7 !important;
background: #1473e6;
background-color: var(--primary-color) !important;
box-shadow: 0 8px 16px -8px rgba(0,0,0,0.4);
border-radius: 6px;
width: 90px;
height: 90px !important;
font-size: 15px;
font-weight: bold;
display: inline-block;
overflow: hidden;
appearance: button;
-webkit-appearance: button;
border: none !important;
cursor: pointer;
transition: all var(--transition-fast);
text-shadow: none !important;
}
.oc .card .general .btn:hover {
background: #2563eb !important;
}
.oc .card .general .more {
font-size: 12px;
line-height: 16px;
padding: 0;
margin: 0;
pointer-events: auto;
overflow: hidden;
display: flex;
justify-content: flex-end;
align-items: center;
position: absolute;
bottom: 8px;
left: 0;
right: 0;
width: 100%;
z-index: 10;
padding-right: 16px;
padding-bottom: 5px;
white-space: nowrap;
text-overflow: ellipsis;
}
.oc .card .general .more p {
margin: 0;
font-size: 15px;
padding: 0;
color: var(--text-secondary) !important;
text-align: right;
white-space: nowrap;
overflow: hidden;
width: 100%;
min-width: 0;
flex-shrink: 1;
text-overflow: ellipsis;
}
.oc .card .general .more a {
text-decoration: none;
color: var(--primary-color);
opacity: 0.8;
transition: opacity var(--transition-fast);
white-space: nowrap;
font-weight: 500;
}
.oc .card .general .more a:hover {
opacity: 1;
text-decoration: underline;
}
.oc .card .general .dler-info::-webkit-scrollbar {
width: 4px;
}
.oc .card .general .dler-info::-webkit-scrollbar-track {
background: transparent;
}
.oc .card .general .dler-info::-webkit-scrollbar-thumb {
background: rgba(0,0,0,0.2);
border-radius: 2px;
}
.oc .card .general .dler-info::-webkit-scrollbar-thumb:hover {
background: rgba(0,0,0,0.3);
}
@media screen and (max-width: 1200px) {
.oc .dler-main-container {
width: calc(100% - 32px);
}
.oc .card .additional.collapsed {
width: 140px;
}
.oc .card .additional .user-card {
width: 140px;
}
.oc .card .additional .more-info h1 {
font-size: 1.8rem;
}
.oc .card .additional .coords {
font-size: 0.95rem;
}
.oc .card .general {
margin-left: 120px;
padding-right: 8px;
}
.oc .card .general .more {
bottom: 6px;
padding-right: 12px;
}
}
@media screen and (max-width: 768px) {
.oc .dler-main-container {
width: 100%;
}
.oc .card .additional.collapsed {
width: 125px;
}
.oc .card .additional .user-card {
width: 125px;
}
.oc .card .additional .more-info h1 {
font-size: 1.5rem;
}
.oc .card .additional .coords {
font-size: 0.8rem;
}
.oc .card .general {
margin-left: 110px;
padding-right: 6px;
}
.oc .card .general h1 {
font-size: 24px;
line-height: 30px;
margin: 0;
}
.oc .card .general .dler-info {
grid-template-columns: 1fr;
grid-template-rows: auto auto auto;
gap: 12px;
padding-right: 8px;
height: 50%;
}
.oc .card .general .dler-info-right {
justify-content: flex-start;
padding-top: 8px;
gap: 12px;
}
.oc .card .general .btn {
width: 80px !important;
height: 80px !important;
font-size: 14px;
padding: 0 !important;
}
.oc .card .general .dler-title {
font-size: 14px;
width: 50%;
}
.oc .card .general .dler-result,
.oc .card .general .dler-result2 {
font-size: 14px;
width: 50%;
}
.oc .card .general .more {
bottom: 4px;
padding-right: 10px;
}
.oc .card .general .more p {
font-size: 13px;
}
}
@media screen and (max-width: 575px) {
.oc .center {
padding: 8px;
}
.oc .card .additional.collapsed {
width: 115px;
}
.oc .card .additional .user-card {
width: 115px;
}
.oc .card .additional .more-info h1 {
font-size: 1.3rem;
}
.oc .card .additional .coords {
font-size: 0.7rem;
}
.oc .card .general {
margin-left: 120px;
padding-right: 4px;
}
.oc .card .general .dler-info {
height: 50%;
}
.oc .card .general h1 {
font-size: 18px;
line-height: 26px;
margin: 0;
}
.oc .card .general .dler-title {
font-size: 12px;
width: 50%;
}
.oc .card .general .dler-result,
.oc .card .general .dler-result2 {
font-size: 12px;
width: 50%;
}
.oc .card .general .more {
bottom: 2px;
padding-right: 8px;
}
.oc .card .general .btn {
width: 60px !important;
height: 60px !important;
font-size: 10px;
padding: 0 !important;
}
.oc .card .general .more p {
font-size: 11px;
}
}
</style>
</head>
<body>
<fieldset class="cbi-section">
<table width="100%"><tr><td>
<div class="oc">
<div class="dler-main-container">
<div class="center">
<div id="card" class="card">
<div id="additional" class="additional">
<div class="user-card">
<div class="img">
<img id="dler_logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAAEcq2jCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjFFQjY1RjRCMjJENDExRUM5NjlEQURCQTU4RDMyNUM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjFFQjY1RjRDMjJENDExRUM5NjlEQURCQTU4RDMyNUM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MUVCNjVGNDkyMkQ0MTFFQzk2OURBREJBNThEMzI1QzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MUVCNjVGNEEyMkQ0MTFFQzk2OURBREJBNThEMzI1QzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5CHITsAAACx1BMVEVjY2P+/v79/f1kZGT8/PwDAwMCAgIBAQFiYmIEBAT7+/tlZWX6+vpmZmZnZ2dhYWFpaWnb29toaGhaWlrh4eFgYGAFBQVXV1dNTU1qampVVVXi4uJcXFxYWFhfX19dXV1MTExZWVlsbGw7OztQUFBRUVFSUlLy8vJPT0/d3d0iIiL09PRWVlZUVFS6urqUlJTo6Oj5+fmLi4uxsbGYmJhLS0tzc3P39/fz8/M9PT1TU1OhoaHr6+sZGRkLCwsJCQk3NzdeXl6MjIzDw8N6enqoqKjOzs7V1dXAwMBKSkqjo6OFhYX29va5ublwcHDg4OAxMTFbW1szMzN7e3tCQkIYGBiPj4/c3NwwMDCNjY1FRUUrKystLS1JSUnl5eV3d3fW1tbw8PC/v7+2traJiYmVlZWenp7Nzc2amppOTk6ysrKmpqZubm5ISEh+fn42NjY8PDxHR0c4ODja2to5OTnf398QEBAkJCQfHx8WFhYgICAbGxvq6urt7e28vLwGBgZ0dHTn5+fZ2dnCwsJ4eHgMDAweHh41NTX19fV5eXns7OzY2NigoKAHBwfm5uYICAhvb2+7u7vv7+/MzMwODg5tbW3x8fElJSXKysoXFxdEREQTExOKioru7u6bm5t1dXWdnZ0yMjKpqamGhobS0tLIyMg+Pj6Hh4e3t7cjIyPQ0NAKCgoUFBTR0dEnJyd9fX2BgYEPDw8oKCj4+Pi+vr4sLCwVFRXj4+MdHR2vr686OjohISGQkJA/Pz+rq6unp6e1tbVDQ0OsrKywsLDJyckcHBzFxcWIiIiCgoLk5OTPz8+RkZGTk5Pp6enT09PGxsYaGhqXl5dycnKzs7PU1NSqqqrBwcF/f3+lpaVAQECEhITExMSWlpa0tLSDg4Otra18fHxBQUFGRkbe3t6ZmZlra2s0NDRxcXGioqIuLi4SEhIAAAD///+mEWvaAAAN20lEQVR42mJ4QwAwDE4FTPgVCDAAASNOBYx+QGkOBuYjuBS8ZuAF22KUgF3B69cEHEmEAia8Cl6/fp1GSAEbISsw7MBQ8JqgAia8cYFpBKkKuIAKGPHGJoYjsCjAb0IkATdgxhemAgJp8pAAAQWvh0jOQgUAATREFTDiTw/FwOzPLIwn0YKKBw4GBlwKXF4zbAAzFHFlHK03hDIvIQWsFJtAWAH+NLkRI1+RVYDgVcAIVBCJNzZZCRUgmhgFIXppT8gEoDPvEFLwhlIFBBIt49DMegABRFDBqAFUMIClVEGOQ048g0wDWDkYIICZGdKuIc2A3WxgzaIyLpF5siq8DMwmpBnA/rqfQ4MJf2LHZwC2gooEA5hAJchrRvIN4HtNoQtevybOBJwGzIEYYE22ASysxDmBQCwAQSL5SRlqgib5eYGYgMRrgDHEAFbycyPEAHYm8rMzOCrYKDCAcCAQMECdskCEOMGGEgO0CSZFQmGwhsJClYLyYLRmIh4ABGC/7pEIBsIwAGfXR37WTPwUhiEKf6NMZUbtAHqtUqPTchKdKxhHcAyNIjmEyCYKDfleCiMHyJPN7jfZ982BHPgdQAgIuNYtt91wJA+gTRTQ4pTmEQtYGWnMM9y1YFxtSj9u3auvMaCsQGkRv3yqDstm3ysoRZmAKKN0Das1emzf9jKUGRNKpfZ0oPtsgHkkYJDei4lfBE53YIQmVcUHyP5IVi4SCOBpfc4GynoPbAftCzs2MAvQuG9qoAyN8hu963XhOKNAINHGwl6BCNDGMtHP28QFKCks/LuxY4KlKxmmKhuQAQiEPRTwY8BHGgt2CrrC8+cgHcYQ/IQQBSQISGQFAvojxadgSyxolsCkOs7Teg78DXATgF37d2kYiOIAnrskd2ma2ErRUlR0UbEU6VoVLIggpYLoIgguioKbIFihXQVxcBLRWQQXB0Fd/BccXQRdHC9/hKY/c6IopnlvufsDmk+/d8nde0noH1AABVAABVAAr970rk0cv+ftrx9QAQCI97znurrebHJpbmpwnQACrnK6Jg3906KPTYMAiCfutO+HpRfG7cgBgpnJwP+3rITV6vT5OfTN25ECiqZghcZbaDcxulmtZ0Ib7dZaaXhEz8QTrzQqAM3XS5+kpsVzbz+8+aGkvJKdoZEAjEe/dmPXPcXFX1Y8jSQBmo412xAE5UFE0uZfX4FHAqBzXKAC2q0oYZZsBICx0AaIfpQEZnlHUKUIgM7lBat4uAAhJik8YI0FBfAJkLIUgUC4DSvBCNgtOIA4UgLmBYFOwNiQVgHLgh9K7ZeYJDgHPxUbGVOeBvBjORmSBOwMvC4gu9IsxE4d6MKELMuz4BBggOedBK/PDxBKsy49Ef8NoE8SYICCJ0CmAsuA98ID5KMBBsDY4sgJeIIjLkJ/7Le2JX6PAjC2WfhzSbgGRWs3OnJQAeYSRU2A34BvxxLATFEsAL30b8OHcLVBGABZZewQ/lgu9akwyvPODOx0o0WimtUKoAAKoADogA8B2DmXnSiCKAxT1dX3tjUj6GQM4IAarhJRLkZBlASCJqgBZYMxuFGEBYrGiBs1GI1RE19AIhs1Jl4SE+PGuHRtfAYTU/UQzkzDTNcgAaa7z9lUvUB/85/q02eq/nMUgAJQAApAASgABaAAFIACiAmA5BcWABWCfZ2fr57aoGkxGQAi6LG2TH2NZdXU72zqHt6ymywiAO1J70+5WmGgRW657vQRAeklE21dfsE3FZqrkb4OBuCcPTFbpZV72Sy3y2MgAM6zC365jS0QI/2DAgB4F/kvbR03nbWUPAD7abe4mvRUK2iazUVFS41sdi9WCsCuGTy71s1XtPOl5jZJUCEAa+acN2ir/kU321Y3+qnz1JmlmvZ9GdfVNNf/szmCygDo0/xBfUPwfDezbdAppOPAT8h+d0+f91P+4yQVyN9T9LuFX9/+cs0wCSrI2+1N/nhyAAsG5/qAVWXt2Dvx/+SbywSDN0YSAqBfClc1WS01flCsn3OYaH2Y0JyN4K6qYXZgo31GElGApoJba38MqyBZuazb7eEA0KOBAHoHQ1KgeF2KA+B9tFdDQHEUKHoW/qIAkBLAAkpZ7izbHNfW+8FABrBLto0JFGt3yEFmefAA5EHIuvMOIQR0T7ye2q0DVIcBjhNcAL2OIIeAY+8B3kvA34Jeyc3qM8w8gOMtF31m2Mr5jUEDsE7JT/scXAH6Qo7BFIEOgbwJjDl4gDnZUcyg3fVEzgT6LYSq2IwzGVXQX9AhxcDsw/pnVFy3oe189L6UCsxH4AqUSzBEgQFYrSzBZ3AFyiV4QoAB6LTc4tEIrQAplwA8BOKSJIE+SKEB5HSoT4IrIF7rMcWgQgD5/wHnDnyXjfxJusKgAZxX4WRkL3rgCkhvol1L4QH6Ql1/Zj/4WyDYdxO30ansg4ABcNfABWBvdFwAcgg7BAIdoMWMoSKI0ms2tqs4COAyQiYUzulSNj7MEABIa2kL9BCMPSAQ6wEZQG9kOACTK7nQGKIoAF6djVYVBwBWAKAfILgAkQ7rYgAw7iADRDsjiQ5g3BRYCjgn7ejHtZHywLlcSWIuO3gA+QDcEwIVIPJ5eVSAZoYH4Mzo/KqDqAAdtWeiz2SKEoL3ixgDkUJrLA4DQaTGZ4EMIBSAAlAACkABKAAFoAAUgAKIY/0ToL1zf42jiuL4zp3Zmc3szu52N4/dZNO802DMo82jNm0TE2wTTWNMaNIY7YPWqihpoGhFq0m1+MAXtdVarRWlVqQqglXxFxERLine truncated
</div>
</div>
<div class="more-info" id="more_info">
<h1>Dler Cloud</h1>
<div class="coords" id="dler_it">
<%:Simple & trustworthy%>
</div>
</div>
</div>
<div class="general">
<h1 id="dler-plan"></h1>
<div class="dler-info">
<div class="dler-info-left">
<div>
<p>
<span class="dler-title" title="<%:Plan Expiration Time%>"><%:Plan Expiration Time%>:</span><span class="dler-result" id="dler-plantime" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
<p>
<span class="dler-title" title="<%:Account Balances%>"><%:Account Balances%>:</span><span class="dler-result" id="dler-money" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
<p>
<span class="dler-title" title="<%:Aff Balances%>"><%:Aff Balances%>:</span><span class="dler-result" id="dler-affmoney" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
<p>
<span class="dler-title" title="<%:Account Integral%>"><%:Account Integral%>:</span><span class="dler-result" id="dler-integral" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
</div>
</div>
<div class="dler-info-center">
<div>
<p>
<span class="dler-title" title="<%:Today Used%>"><%:Today Used%>:</span><span class="dler-result2" id="dler-today-used" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
<p>
<span class="dler-title" title="<%:Plan Used%>"><%:Plan Used%>:</span><span class="dler-result2" id="dler-used" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
<p>
<span class="dler-title" title="<%:Plan Unused%>"><%:Plan Unused%>:</span><span class="dler-result2" id="dler-unused" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
<p>
<span class="dler-title" title="<%:Plan Traffic%>"><%:Plan Traffic%>:</span><span class="dler-result2" id="dler-traffic" title="<%:Collecting data...%>"><%:Collecting data...%></span>
</p>
</div>
</div>
<div class="dler-info-right">
<div class="dler-btn-container">
<input type="button" class="btn" value="<%:Checkin%>" onclick="return dler_checkin_btn(this)">
</div>
</div>
</div>
<div class="more">
<p>Powered by <a class="myip-footer" onclick="return web_dler()" href="javascript:void(0);">dlercloud.com</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
</td></tr></table>
</fieldset>
<script type="text/javascript">//<![CDATA[
var dler_plan = document.getElementById('dler-plan');
var dler_plantime = document.getElementById('dler-plantime');
var dler_money = document.getElementById('dler-money');
var dler_affmoney = document.getElementById('dler-affmoney');
var dler_today_used = document.getElementById('dler-today-used');
var dler_used = document.getElementById('dler-used');
var dler_unused = document.getElementById('dler-unused');
var dler_traffic = document.getElementById('dler-traffic');
var dler_integral = document.getElementById('dler-integral');
var dler_checkin = document.getElementById('dler-checkin');
var obj = document.getElementById("additional");
var card = document.getElementById("card");
var dler_it = document.getElementById("dler_it");
var more_info = document.getElementById("more_info");
var dler_logo = document.getElementById("dler_logo");
var showmore=1;
document.addEventListener('DOMContentLoaded', function() {
DarkModeDetector.init();
obj.classList.remove('collapsed');
obj.classList.add('expanded');
});
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_info")%>', null, function(x, status) {
if (x && x.status == 200 && status.dler_info != "error") {
dler_plan.innerHTML = status.dler_info.plan;
dler_plantime.innerHTML = status.dler_info.plan_time;
dler_plantime.title = status.dler_info.plan_time;
dler_money.innerHTML = status.dler_info.money;
dler_money.title = status.dler_info.money;
dler_affmoney.innerHTML = status.dler_info.aff_money;
dler_affmoney.title = status.dler_info.aff_money;
dler_today_used.innerHTML = status.dler_info.today_used;
dler_today_used.title = status.dler_info.today_used;
dler_used.innerHTML = status.dler_info.used;
dler_used.title = status.dler_info.used;
dler_unused.innerHTML = status.dler_info.unused;
dler_unused.title = status.dler_info.unused;
dler_traffic.innerHTML = status.dler_info.traffic;
dler_traffic.title = status.dler_info.traffic;
dler_integral.innerHTML = status.dler_info.integral;
dler_integral.title = status.dler_info.integral;
show_info();
}
else {
show_less();
}
});
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_info")%>', null, function(x, status) {
if (x && x.status == 200 && status.dler_info != "error") {
dler_plan.innerHTML = status.dler_info.plan;
dler_plantime.innerHTML = status.dler_info.plan_time;
dler_plantime.title = status.dler_info.plan_time;
dler_money.innerHTML = status.dler_info.money;
dler_money.title = status.dler_info.money;
dler_affmoney.innerHTML = status.dler_info.aff_money;
dler_affmoney.title = status.dler_info.aff_money;
dler_today_used.innerHTML = status.dler_info.today_used;
dler_today_used.title = status.dler_info.today_used;
dler_used.innerHTML = status.dler_info.used;
dler_used.title = status.dler_info.used;
dler_unused.innerHTML = status.dler_info.unused;
dler_unused.title = status.dler_info.unused;
dler_traffic.innerHTML = status.dler_info.traffic;
dler_traffic.title = status.dler_info.traffic;
dler_integral.innerHTML = status.dler_info.integral;
dler_integral.title = status.dler_info.integral;
if (showmore != 0) {
show_info();
}
else {
show_less();
}
}
else {
show_less();
}
});
function dler_checkin_btn(btn)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_checkin")%>', null, function(x, status) {
if ( x && x.status == 200 && status.dler_checkin != "error") {
if (status.dler_checkin.ret == 200) {
alert("<%:Dler Cloud Checkin Successful, Result:%>\n\n"+
status.dler_checkin.data.checkin);
}
else if (status.dler_checkin.msg) {
alert("<%:Dler Cloud Checkin Failed, Result:%>\n\n"+
status.dler_checkin.msg);
}
else {
alert("<%:Dler Cloud Checkin Failed! Please Check And Try Again...%>")
}
}
else {
alert("<%:Dler Cloud Checkin Failed! Please Check And Try Again...%>")
}
});
}
function web_dler()
{
url='https://bit.ly/32mrABp';
window.open(url);
}
function show_more()
{
if (obj.classList.contains('expanded')) {
show_info();
showmore = 1;
}
else {
if (dler_plan.innerHTML != "") {
show_less();
showmore = 0;
}
else {
web_dler();
}
}
}
function show_less()
{
if (!obj.classList.contains('expanded')) {
obj.classList.add('expanded');
obj.classList.remove('collapsed');
}
var rdmdl = Math.floor(Math.random() * 6) + 1;
if (rdmdl == 1) {
dler_it.innerHTML = '<%:Simple & trustworthy%>';
}
if (rdmdl == 2) {
dler_it.innerHTML = '<%:Cross-platform Support%>';
}
if (rdmdl == 3) {
dler_it.innerHTML = '<%:Global Acceleration Network%>';
}
if (rdmdl == 4) {
dler_it.innerHTML = '<%:Easy to Use%>';
}
if (rdmdl == 5) {
dler_it.innerHTML = '<%:Intelligent Shunting%>';
}
if (rdmdl == 6) {
dler_it.innerHTML = '<%:Perfect Technical Support%>';
}
}
function show_info()
{
if (!obj.classList.contains('collapsed')) {
obj.classList.add('collapsed');
obj.classList.remove('expanded');
}
}
function imgerrorfuns(imgobj,imgSrc)
{
setTimeout(function(){
imgobj.src=imgSrc;
},1000*10);
}
//]]></script>
</html>
@@ -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%>
+302 -146
View File
@@ -3,15 +3,15 @@
*{margin: 0;padding: 0;} *{margin: 0;padding: 0;}
ul{ ul{
list-style: none; list-style: none;
} }
#tab{ #tab{
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 1px solid #ddd; border: 1px solid #ddd;
box-shadow: 0 0 2px #ddd; box-shadow: 0 0 2px #ddd;
overflow: hidden; overflow: hidden;
} }
#tab-header { #tab-header {
@@ -120,7 +120,7 @@ ul{
} }
#tab-content .dom{ #tab-content .dom{
display: none; display: none;
} }
#tab-content .dom ul li{ #tab-content .dom ul li{
@@ -233,66 +233,66 @@ ul{
} }
:root[data-darkmode="true"] { :root[data-darkmode="true"] {
.radio-button { .radio-button {
background: #374151; background: #374151;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15); box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15);
} }
.radio-button label { .radio-button label {
background: #1f2937; background: #1f2937;
color: #d1d5db; color: #d1d5db;
border-color: #4b5563; border-color: #4b5563;
} }
.radio-button label:hover { .radio-button label:hover {
color: #3b82f6; color: #3b82f6;
border-color: #3b82f6; border-color: #3b82f6;
background: #22304a; background: #22304a;
} }
.radio-button input[type="radio"]:checked + label { .radio-button input[type="radio"]:checked + label {
background: #3b82f6; background: #3b82f6;
color: #fff; color: #fff;
border-color: #3b82f6; border-color: #3b82f6;
box-shadow: 0 1px 2px 0 rgba(59,130,246,0.18); box-shadow: 0 1px 2px 0 rgba(59,130,246,0.18);
} }
} }
</style> </style>
<body> <body>
<div id="tab" class="cbi-section"> <div id="tab" class="cbi-section">
<div id="tab-header"> <div id="tab-header">
<ul class="cbi-tabmenu"> <ul class="cbi-tabmenu">
<li name="tab-header" class="cbi-tab"><a href="#"><%:OpenClash Log%></a></li> <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> <li name="tab-header" class="cbi-tab-disabled"><a href="#"><%:Core Log%></a></li>
</ul> </ul>
</div> </div>
<div id="tab-content"> <div id="tab-content">
<div class="dom" style="display: block;"> <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> <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>
<div class="dom"> <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> <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"> <div class="radio-button">
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/> <input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
<label for="info">Info</label> <label for="info"><%:Info%></label>
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/> <input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
<label for="warning">Warning</label> <label for="warning"><%:Warning%></label>
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/> <input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
<label for="error">Error</label> <label for="error"><%:Error%></label>
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/> <input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
<label for="debug">Debug</label> <label for="debug"><%:Debug%></label>
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/> <input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
<label for="silent">Silent</label> <label for="silent"><%:Silent%></label>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<fieldset style="text-align: center; width: 100%" class="cbi-section"> <fieldset style="text-align: center; width: 100%" class="cbi-section">
<div class="btn-group"> <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="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="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="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() " /> <input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" onclick=" return download_log() " />
</div> </div>
</fieldset> </fieldset>
</body> </body>
@@ -304,46 +304,60 @@ var lv = document.getElementById('cbid.openclash.config.clog');
var cl = document.getElementById('core_log'); var cl = document.getElementById('core_log');
var animatingOC = false; var animatingOC = false;
var animatingCore = 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() { function get_log_level() {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
if (x && x.status == 200 && status.log_level != "") { if (x && x.status == 200 && status.log_level != "") {
var radio = document.getElementsByName("radios"); currentLogLevel = status.log_level;
for (i=0; i<radio.length; i++) { setLogTab(currentLogLevel);
if (radio[i].value == status.log_level && ! radio[i].checked) { coreLogWebSocket();
radio[i].checked = true; }
} });
}
}
});
s=setTimeout("get_log_level()",5000);
}; };
function switch_log_level(value) function switch_log_level(value)
{ {
clearTimeout(s); if (!coreWebSocket || coreWebSocket.readyState !== WebSocket.OPEN) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
if (x && x.status == 200) { if (!x || x.status != 200) {
alert(' <%:Log Level%>: ' + value + ' <%:switching succeeded!%>'); alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
get_log_level(); return
} }
else { });
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>'); }
get_log_level();
} currentLogLevel = value;
}); setLogTab(currentLogLevel);
coreLogWebSocket();
}; };
function stop_refresh() { function stop_refresh() {
clearTimeout(r); clearTimeout(r);
return coreLogWebSocketStop();
return
}; };
function start_refresh() { function start_refresh() {
clearTimeout(r); clearTimeout(r);
r=setTimeout("poll_log()",1000*2); coreLogWebSocket();
return r=setTimeout("poll_log()",1000);
return
}; };
function createAndDownloadFile(fileName, content) { 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 timestamp = dt.getFullYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+"-"+dt.getHours()+"-"+dt.getMinutes()+"-"+dt.getSeconds();
var oc_content = ""; var oc_content = "";
if (typeof oc_editor !== 'undefined' && oc_editor) { if (typeof editor_oc !== 'undefined' && editor_oc) {
oc_content = oc_editor.getValue(); oc_content = editor_oc.getValue();
} else if (lv && lv.value) { } else if (lv && lv.value) {
oc_content = lv.value; oc_content = lv.value;
} else if (lv && lv.innerHTML) { } else if (lv && lv.innerHTML) {
@@ -369,8 +383,8 @@ function download_log(){
} }
var core_content = ""; var core_content = "";
if (typeof core_editor !== 'undefined' && core_editor) { if (typeof editor_core !== 'undefined' && editor_core) {
core_content = core_editor.getValue(); core_content = editor_core.getValue();
} else if (cl && cl.value) { } else if (cl && cl.value) {
core_content = cl.value; core_content = cl.value;
} else if (cl && cl.innerHTML) { } else if (cl && cl.innerHTML) {
@@ -378,7 +392,7 @@ function download_log(){
} }
oc_content = oc_content.split('\n').filter(function(line) { 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'); }).join('\n');
if (!oc_content.trim() && !core_content.trim()) { if (!oc_content.trim() && !core_content.trim()) {
@@ -398,27 +412,136 @@ function download_log(){
}; };
function del_log() { function del_log() {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){ XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
lv.innerHTML=""; lv.innerHTML="";
cl.innerHTML=""; cl.innerHTML="";
log_len = 0; coreLogBuffer = [];
oc_editor.setValue(lv.value); log_len = 0;
core_editor.setValue(cl.value); editor_oc.setValue(lv.value);
core_editor.refresh(); editor_core.setValue(cl.value);
oc_editor.refresh(); editor_core.refresh();
}); editor_oc.refresh();
return });
return
}; };
function p(s) { 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) { function line_tolocal(str) {
var trans_local = new Array(); var trans_local = new Array();
var local_count = 0; var local_count = 0;
str.trim().split('\n').forEach(function(v, i) { str.trim().split('\n').forEach(function(v, i) {
var regex = /(time=)"([^"]*)"/g; var regex = /(time=)"([^"]*)"/g;
var res = regex.exec(v); var res = regex.exec(v);
@@ -428,13 +551,15 @@ function line_tolocal(str) {
var dt = new Date(res[2]); var dt = new Date(res[2]);
if (!isNaN(dt.getTime())) { if (!isNaN(dt.getTime())) {
if (v.indexOf("level=") != -1) { var timestamp = dt.getFullYear() + "-" + p(dt.getMonth() + 1) + "-" + p(dt.getDate()) + " " +
var log_info = v.substring(res[2].length + 7); p(dt.getHours()) + ":" + p(dt.getMinutes()) + ":" + p(dt.getSeconds());
} else {
var log_info = v.substring(res[2].length + 2); var levelMatch = v.match(/level=(\w+)/);
} var level = levelMatch ? levelMatch[1] : 'info';
trans_local[local_count] = dt.getFullYear() + "-" + p(dt.getMonth() + 1) + "-" + p(dt.getDate()) + " " + var translatedLevel = levelTranslations[level] || level;
p(dt.getHours()) + ":" + p(dt.getMinutes()) + ":" + p(dt.getSeconds()) + log_info; var msgMatch = v.match(/msg="(.*)"/);
var msg = msgMatch ? msgMatch[1] : '';
trans_local[local_count] = timestamp + " [" + translatedLevel + "] " + msg;
local_count++; local_count++;
} else { } else {
trans_local[local_count] = v; trans_local[local_count] = v;
@@ -500,7 +625,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
isAtTop = (target.scrollTop < 20); 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 content = "";
var lines = newLines.slice().reverse(); var lines = newLines.slice().reverse();
for (var i = 0; i < lines.length; i++) { for (var i = 0; i < lines.length; i++) {
@@ -557,7 +682,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
return; return;
} }
if (target === oc_editor || target === lv) { if (target === editor_oc || target === lv) {
animatingOC = true; animatingOC = true;
} else { } else {
animatingCore = true; animatingCore = true;
@@ -596,7 +721,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
function displayNextBatch() { function displayNextBatch() {
if (currentBatchCount >= logLines.length) { if (currentBatchCount >= logLines.length) {
if (target === oc_editor || target === lv) { if (target === editor_oc || target === lv) {
animatingOC = false; animatingOC = false;
} else { } else {
animatingCore = false; animatingCore = false;
@@ -661,7 +786,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
if (currentBatchCount < logLines.length) { if (currentBatchCount < logLines.length) {
setTimeout(displayNextBatch, interval); setTimeout(displayNextBatch, interval);
} else { } else {
if (target === oc_editor || target === lv) { if (target === editor_oc || target === lv) {
animatingOC = false; animatingOC = false;
} else { } else {
animatingCore = false; animatingCore = false;
@@ -691,15 +816,54 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
} }
function poll_log(){ 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")%>', 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) { function(x, status) {
if (x && x.status == 200) { if (x && x.status == 200) {
if (status) { if (status) {
if (!status.update) { if (!status.update) {
r = setTimeout("poll_log()", 2000); isPolling = false;
r = setTimeout("poll_log()", 1000);
return; return;
} }
@@ -707,45 +871,37 @@ function poll_log(){
log_len = status.len; 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 !== "") { 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_logs.length > 0) {
if (oc_editor) { if (editor_oc) {
var currentContent = oc_editor.getValue(); currentContent = editor_oc.getValue();
smoothlyDisplayLogs(oc_logs, oc_editor, true, currentContent, activeTabId === 0); smoothlyDisplayLogs(oc_logs, editor_oc, true, currentContent, activeTabId === 0);
} else if (lv) { } else if (lv) {
var currentContent = lv.innerHTML; currentContent = lv.innerHTML;
smoothlyDisplayLogs(oc_logs, lv, false, currentContent, activeTabId === 0); smoothlyDisplayLogs(oc_logs, lv, false, currentContent, activeTabId === 0);
} }
} }
} }
if (status.core_log && status.core_log !== "") { 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_logs.length > 0) {
if (core_editor) { if (editor_core) {
var currentCoreContent = core_editor.getValue(); currentCoreContent = editor_core.getValue();
smoothlyDisplayLogs(core_logs, core_editor, true, currentCoreContent, activeTabId === 1); smoothlyDisplayLogs(core_logs, editor_core, true, currentCoreContent, activeTabId === 1);
} else if (cl) { } else if (cl) {
var currentCoreContent = cl.innerHTML; currentCoreContent = cl.innerHTML;
smoothlyDisplayLogs(core_logs, cl, false, currentCoreContent, activeTabId === 1); 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'; tab.className = 'cbi-tab';
divs[tab.id].style.display = 'block'; divs[tab.id].style.display = 'block';
if(tab.id == 0 && typeof oc_editor !== 'undefined') { if(tab.id == 0 && typeof editor_oc !== 'undefined') {
setTimeout(function(){ setTimeout(function(){
oc_editor.refresh(); editor_oc.refresh();
}, 10); }, 10);
} else if(tab.id == 1 && typeof core_editor !== 'undefined') { } else if(tab.id == 1 && typeof editor_core !== 'undefined') {
setTimeout(function(){ setTimeout(function(){
core_editor.refresh(); editor_core.refresh();
}, 10); }, 10);
} }
}; };
@@ -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%>
@@ -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_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>'; 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 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%>_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>'; 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 else
{ {
@@ -14,6 +14,9 @@
--success-dark: #047857; --success-dark: #047857;
--warning-color: #f59e0b; --warning-color: #f59e0b;
--error-color: #dc2626; --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-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); --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; --radius-sm: 6px;
@@ -40,6 +43,11 @@
--primary-color: #3b82f6; --primary-color: #3b82f6;
--success-color: #34d399; --success-color: #34d399;
--success-dark: #10b981; --success-dark: #10b981;
--error-color: #ff7070;
--tip-color: #f9bb51;
--warning-color: #fa41c8;
--watchdog-color: #c147f5;
--info-color: #2563eb;
} }
.oc * { .oc * {
@@ -204,8 +212,8 @@
padding: 8px 32px 8px 12px; padding: 8px 32px 8px 12px;
border: 1px solid var(--border-light); border: 1px solid var(--border-light);
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
background: var(--bg-white); background: var(--bg-white) !important;
color: var(--text-primary); color: var(--text-primary) !important;
font-size: 13px; font-size: 13px;
appearance: none; appearance: none;
cursor: pointer; cursor: pointer;
@@ -640,22 +648,22 @@
var smart_enable_cdn = document.getElementById('SMART_ENABLE_CDN'); var smart_enable_cdn = document.getElementById('SMART_ENABLE_CDN');
function initDarkMode() { function initDarkMode() {
var ocContainer = document.querySelector('.oc'); var ocContainers = document.querySelectorAll('.oc');
if (!ocContainer) return; if (!ocContainers.length) return;
var shouldUseDark = isDarkBackground(document.body); var shouldUseDark = isDarkBackground(document.body);
if (shouldUseDark) { ocContainers.forEach(function(ocContainer) {
ocContainer.setAttribute('data-darkmode', 'true'); if (shouldUseDark) {
} else { ocContainer.setAttribute('data-darkmode', 'true');
ocContainer.removeAttribute('data-darkmode'); 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') { if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initDarkMode); document.addEventListener('DOMContentLoaded', initDarkMode);
} else { } else {
@@ -14,10 +14,11 @@
--primary-color: #3b82f6; --primary-color: #3b82f6;
--success-color: #059669; --success-color: #059669;
--success-dark: #047857; --success-dark: #047857;
--warning-color: #f59e0b; --tip-color: #f59e0b;
--error-color: #dc2626; --error-color: #dc2626;
--warning-log: #ff00bb; --warning-color: #ff00bb;
--watch-log: #b300ff; --watchdog-color: #b300ff;
--info-color: #3b82f6;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); --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); --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; --radius-sm: 6px;
@@ -50,9 +51,10 @@
--success-color: #34d399; --success-color: #34d399;
--success-dark: #10b981; --success-dark: #10b981;
--error-color: #ff7070; --error-color: #ff7070;
--warning-color: #f9bb51; --tip-color: #f9bb51;
--warning-log: #fa41c8; --warning-color: #fa41c8;
--watch-log: #c147f5; --watchdog-color: #c147f5;
--info-color: #3b82f6;
} }
.oc[data-darkmode="true"] .plugin-toggle-slider { .oc[data-darkmode="true"] .plugin-toggle-slider {
@@ -94,7 +96,7 @@
} }
.oc[data-darkmode="true"] .subscription-progress-fill.medium { .oc[data-darkmode="true"] .subscription-progress-fill.medium {
background: var(--warning-color); background: var(--tip-color);
} }
.oc[data-darkmode="true"] .subscription-progress-fill.low { .oc[data-darkmode="true"] .subscription-progress-fill.low {
@@ -942,7 +944,7 @@
} }
.oc .subscription-progress-fill.medium { .oc .subscription-progress-fill.medium {
background: var(--warning-color); background: var(--tip-color);
} }
.oc .subscription-progress-fill.low { .oc .subscription-progress-fill.low {
@@ -2248,14 +2250,10 @@
DISCONNECTED: 2, DISCONNECTED: 2,
ERROR: 3 ERROR: 3
}, },
retryAttempts: {}, reconnectDelay: 5000,
maxRetries: 3,
reconnectDelay: 2000,
heartbeatInterval: 30000, heartbeatInterval: 30000,
heartbeatTimers: {}, heartbeatTimers: {},
_ws_connect: false, _ws_connect: false,
_ws_error: false,
_ws_retry: 0,
_allowedCloseCodes: [1000, 1001, 1005, 1006], _allowedCloseCodes: [1000, 1001, 1005, 1006],
isSupported: function() { isSupported: function() {
@@ -2284,8 +2282,6 @@
options: options options: options
}; };
this.retryAttempts[type] = 0;
if (ws.addEventListener) { if (ws.addEventListener) {
ws.addEventListener('open', this.handleOpen.bind(this, type)); ws.addEventListener('open', this.handleOpen.bind(this, type));
ws.addEventListener('message', this.handleMessage.bind(this, type)); ws.addEventListener('message', this.handleMessage.bind(this, type));
@@ -2362,8 +2358,6 @@
this.closeConnection(types[i]); this.closeConnection(types[i]);
} }
this._ws_connect = false; this._ws_connect = false;
this._ws_error = false;
this._ws_retry = 0;
}, },
handleMessage: function(type, event) { handleMessage: function(type, event) {
@@ -2389,13 +2383,13 @@
connection.state = this.connectionStates.CONNECTED; connection.state = this.connectionStates.CONNECTED;
connection.lastActivity = Date.now(); connection.lastActivity = Date.now();
} }
this.retryAttempts[type] = 0;
this.startHeartbeat(type); 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_connect = true;
this._ws_error = false; if (NetworkStatsManager.isEnabled) {
this._ws_retry = 0; NetworkStatsManager.stop();
}
} }
}, },
@@ -2404,15 +2398,14 @@
if (connection) { if (connection) {
connection.state = this.connectionStates.ERROR; connection.state = this.connectionStates.ERROR;
} }
this._ws_error = true;
this.stopHeartbeat(type); this.stopHeartbeat(type);
this.enableFallbackMode();
if (type === 'traffic') {
this.enableFallbackMode();
}
}, },
handleClose: function(type, event) { handleClose: function(type, event) {
// if not connected, start log display because core maybe restart
LogManager.startLogDisplay();
var connection = this.connections[type]; var connection = this.connections[type];
if (connection) { if (connection) {
connection.state = this.connectionStates.DISCONNECTED; connection.state = this.connectionStates.DISCONNECTED;
@@ -2429,7 +2422,6 @@
if (connection) { if (connection) {
connection.state = this.connectionStates.ERROR; connection.state = this.connectionStates.ERROR;
} }
this._ws_error = true;
this.enableFallbackMode(); this.enableFallbackMode();
}, },
@@ -2437,25 +2429,22 @@
var self = this; var self = this;
var connection = this.connections[type]; var connection = this.connections[type];
if (!connection || this.retryAttempts[type] >= this.maxRetries) { if (!connection) {
this.enableFallbackMode(); this.enableFallbackMode();
return; return;
} }
this.retryAttempts[type] = (this.retryAttempts[type] || 0) + 1;
var delay = this.reconnectDelay * Math.pow(1.5, this.retryAttempts[type] - 1);
setTimeout(function() { setTimeout(function() {
if (self.connections[type] && self.connections[type].state !== self.connectionStates.CONNECTED) { if (self.connections[type] && self.connections[type].state !== self.connectionStates.CONNECTED) {
self.createConnection(type, connection.url, connection.messageHandler, connection.options); self.createConnection(type, connection.url, connection.messageHandler, connection.options);
} }
}, delay); }, this.reconnectDelay);
}, },
enableFallbackMode: function() { enableFallbackMode: function() {
this._ws_connect = false; this._ws_connect = false;
this.closeAll(); this.closeAll();
if (typeof NetworkStatsManager !== "undefined" && !NetworkStatsManager.isEnabled) { if (!NetworkStatsManager.isEnabled) {
NetworkStatsManager.start(); NetworkStatsManager.start();
} }
}, },
@@ -2480,14 +2469,6 @@
} }
} }
return false; return false;
},
resetRetryCount: function(type) {
if (type) {
this.retryAttempts[type] = 0;
} else {
this.retryAttempts = {};
}
} }
}; };
@@ -2575,7 +2556,7 @@
this.updateSubscriptionDisplay(currentConfigFile, currentFileInfo); this.updateSubscriptionDisplay(currentConfigFile, currentFileInfo);
if (currentConfigFile && SubscriptionManager.currentConfigFile !== currentConfigFile) { if (SubscriptionManager.currentConfigFile !== currentConfigFile) {
SubscriptionManager.currentConfigFile = currentConfigFile; SubscriptionManager.currentConfigFile = currentConfigFile;
SubscriptionManager.getSubscriptionInfo(); SubscriptionManager.getSubscriptionInfo();
} }
@@ -2967,7 +2948,7 @@
loadSubscriptionInfo: function() { loadSubscriptionInfo: function() {
var currentConfig = ConfigFileManager.getCurrentConfig() || ConfigFileManager.getSelectedConfig(); var currentConfig = ConfigFileManager.getCurrentConfig() || ConfigFileManager.getSelectedConfig();
if (currentConfig && currentConfig !== this.currentConfigFile) { if (currentConfig !== this.currentConfigFile) {
this.currentConfigFile = currentConfig; this.currentConfigFile = currentConfig;
this.getSubscriptionInfo(); this.getSubscriptionInfo();
} }
@@ -3376,7 +3357,6 @@
}, },
bindEvents: function() { bindEvents: function() {
var self = this;
var textarea = document.getElementById('subscription-url-textarea'); var textarea = document.getElementById('subscription-url-textarea');
var overlay = document.getElementById('subscription-url-overlay'); 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() { loadUrls: function() {
var self = this; 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")%>', { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_subscribe_info_data")%>', {
filename: this.filename filename: this.filename
}, function(x, status) { }, function(x, status) {
if (x && x.status == 200 && status) { if (x && x.status == 200 && status) {
var textarea = document.getElementById('subscription-url-textarea'); self.handleSubURL(status);
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;
}
} }
}); });
} }
@@ -3489,9 +3483,9 @@
StateManager.clearCache('<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>'); 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.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; this.isPolling = true;
@@ -3591,17 +3585,11 @@
checkForErrors: function(log) { checkForErrors: function(log) {
if (!log) return false; 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) {}); XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
var errorMsg; var msgParts = log.split('msg=');
if (log.match(/level=(fatal|error)/)) { var errorMsg = msgParts.length > 1 ? msgParts[1].replace(/"/g, '') : log;
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;
}
setTimeout(function() { setTimeout(function() {
alert('<%:OpenClash Start Failed%>:\n\n' + errorMsg); alert('<%:OpenClash Start Failed%>:\n\n' + errorMsg);
@@ -3621,6 +3609,7 @@
var color = this.getLogColor(cleanLog); var color = this.getLogColor(cleanLog);
var displayText = this.formatLogText(cleanLog); var displayText = this.formatLogText(cleanLog);
DOMCache.oclog.style.display = 'inline-flex';
DOMCache.oclog.innerHTML = '<b style="color:' + color + '">' + displayText + '</b>'; DOMCache.oclog.innerHTML = '<b style="color:' + color + '">' + displayText + '</b>';
}, },
@@ -3629,19 +3618,13 @@
}, },
getLogColor: function(log) { getLogColor: function(log) {
if (log.includes("Tip:") || log.includes("提示:")) { for (var levelKey in window.levelTranslations) {
return 'var(--warning-color)'; var translatedText = '[' + window.levelTranslations[levelKey] + ']';
} else if (log.includes("Error:") || log.includes("错误:") || log.includes("level=error")) { if (log.includes(translatedText)) {
return 'var(--error-color)'; return "var(--" + levelKey + "-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)';
} }
return "var(--info-color)";
}, },
formatLogText: function(log) { formatLogText: function(log) {
@@ -3695,12 +3678,12 @@
StateManager.cachedXHRGet('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', function(x, status) { StateManager.cachedXHRGet('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', function(x, status) {
if (x && x.status == 200 && x.responseText != "") { if (x && x.status == 200 && x.responseText != "") {
self.retryCount = 0; 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 %"; var cpuValue = status.cpu <= 100 ? status.cpu + " %" : "0 %";
document.getElementById("cpu_t").innerHTML = "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>"; document.getElementById("cpu_t").innerHTML = "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>";
var loadValue = parseFloat(status.load_avg) || 0; 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>"; document.getElementById("load_a").innerHTML = "<font style=\"color:"+loadColor+"\">"+status.load_avg+" %</font>";
} else { } else {
self.handleError(); self.handleError();
@@ -3782,12 +3765,12 @@
]; ];
if (!SystemStatusManager.isEnabled) { 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 %"; var cpuValue = status.cpu <= 100 ? status.cpu + " %" : "0 %";
updates.push({element: document.getElementById("cpu_t"), content: "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>"}); updates.push({element: document.getElementById("cpu_t"), content: "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>"});
var loadValue = parseFloat(status.load_avg) || 0; 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>"}); 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 (status.clash && status.daip) {
if (!WSManager.hasActiveConnections()) { if (!WSManager.hasActiveConnections()) {
if (!WSManager._ws_error || WSManager._ws_retry < 3) { initializeWebSocketConnections(status);
if (initializeWebSocketConnections(status)) {
WSManager._ws_retry++;
}
} else {
WSManager.enableFallbackMode();
}
} else { } else {
if (NetworkStatsManager && NetworkStatsManager.isEnabled) { if (NetworkStatsManager.isEnabled) {
NetworkStatsManager.stop(); NetworkStatsManager.stop();
} }
if (SystemStatusManager && !SystemStatusManager.isEnabled) { if (!SystemStatusManager.isEnabled) {
SystemStatusManager.start(); SystemStatusManager.start();
} }
} }
@@ -4232,14 +4209,14 @@
var isChineseUser = userLang.indexOf('zh') === 0; var isChineseUser = userLang.indexOf('zh') === 0;
var tips = [ var tips = [
'<%:Tip: You can modify the profile on the profile page (for content that is not taken over)%>', '<%: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%>', '<%: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%>', '<%:some website are abnormal? Try switching modes or using third-party rules%>',
'<%:Tip: using the fake IP mode can get a faster access experience%>', '<%: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%>', '<%: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%>', '<%: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%>', '<%: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 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: 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: 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%>', '<%: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) { function ws_tmessage(event) {
var dataObj = event && event.data !== undefined ? event.data : event; var dataObj = event && event.data !== undefined ? event.data : event;
var data; var data;
@@ -4938,7 +4909,7 @@
} }
}); });
return false; return false;
} }
function copySecret() { function copySecret() {
var secret = StateManager.current_status.dase || ''; var secret = StateManager.current_status.dase || '';
@@ -4969,6 +4940,10 @@
var mixPort = StateManager.cached_proxy_info.mixed_port || '7893'; var mixPort = StateManager.cached_proxy_info.mixed_port || '7893';
var proxyIp = StateManager.current_status.daip; var proxyIp = StateManager.current_status.daip;
var proxyText = proxyIp + ':' + mixPort; 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:%> '); copyToClipboard(proxyText, '<%:Mix proxy address copied:%> ');
} else { } else {
alert('<%:Proxy info not available, please try again later%>'); alert('<%:Proxy info not available, please try again later%>');
@@ -5062,13 +5037,8 @@
client_href: currentUrl.href client_href: currentUrl.href
}, function(x, data) { }, function(x, data) {
if (x && x.status == 200 && data.pac_url) { if (x && x.status == 200 && data.pac_url) {
if (data.error && data.error.indexOf("warning:") === 0) { if (data.error && data.error !== "") {
var warningMsg = data.error.replace("warning: ", ""); alert(data.error);
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);
} }
copyToClipboard(data.pac_url, '<%:PAC file URL copied:%> '); copyToClipboard(data.pac_url, '<%:PAC file URL copied:%> ');
} else if (data.error) { } else if (data.error) {
@@ -5392,11 +5362,11 @@
filename: filename filename: filename
}, function(x, status) { }, function(x, status) {
if (x.status == 200) { if (x.status == 200) {
if (typeof ConfigUploader !== 'undefined' && ConfigUploader.showEditSubscribe) { if (ConfigUploader && ConfigUploader.showEditSubscribe) {
ConfigUploader.showEditSubscribe(status, filename); ConfigUploader.showEditSubscribe(status, filename);
} else { } else {
setTimeout(function() { setTimeout(function() {
if (typeof ConfigUploader !== 'undefined' && ConfigUploader.showEditSubscribe) { if (ConfigUploader && ConfigUploader.showEditSubscribe) {
ConfigUploader.showEditSubscribe(status, filename); ConfigUploader.showEditSubscribe(status, filename);
} else { } else {
alert('<%:Config editor not ready, please try again%>'); alert('<%:Config editor not ready, please try again%>');
@@ -5418,11 +5388,11 @@
return false; return false;
} }
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.show) { if (ConfigEditor.show) {
ConfigEditor.show(currentConfig); ConfigEditor.show(currentConfig);
} else { } else {
setTimeout(function() { setTimeout(function() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.show) { if (ConfigEditor.show) {
ConfigEditor.show(currentConfig); ConfigEditor.show(currentConfig);
} else { } else {
alert('<%:Config editor not ready, please try again%>'); alert('<%:Config editor not ready, please try again%>');
@@ -5434,11 +5404,11 @@
} }
function editOverwrite() { function editOverwrite() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.showOverwrite) { if (ConfigEditor.showOverwrite) {
ConfigEditor.showOverwrite(); ConfigEditor.showOverwrite();
} else { } else {
setTimeout(function() { setTimeout(function() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.showOverwrite) { if (ConfigEditor.showOverwrite) {
ConfigEditor.showOverwrite(); ConfigEditor.showOverwrite();
} else { } else {
alert('<%:Config editor not ready, please try again%>'); alert('<%:Config editor not ready, please try again%>');
@@ -55,15 +55,20 @@
line-height: 0; line-height: 0;
flex-shrink: 0; flex-shrink: 0;
cursor: pointer; cursor: pointer;
background-color: unset;
border: unset;
} }
.sub_setting img { .sub_setting svg {
vertical-align: middle; vertical-align: middle;
display: inline-block; 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; opacity: 0.7;
} }
@@ -95,14 +100,147 @@
background-color: #ffb9b9; background-color: #ffb9b9;
} }
:root[data-darkmode="true"] #icon_wrench { .sub-info-url-overlay {
-webkit-filter: invert(1); position: fixed;
filter: invert(1); 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 { .sub-info-url-model {
-webkit-filter: invert(1); background: var(--bg-white, white);
filter: invert(1); 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 { :root[data-darkmode="true"] .text_show {
@@ -127,6 +265,62 @@
background-color: #cc6262; 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) { @media (max-width: 1024px) {
.sub_tab, .sub_tab_show { .sub_tab, .sub_tab_show {
font-size: 11px; font-size: 11px;
@@ -152,10 +346,6 @@
min-width: 200px; min-width: 200px;
} }
.sub_setting img {
height: 18px !important;
}
.sub_div { .sub_div {
gap: 4px; gap: 4px;
width: calc(100% - 16px); width: calc(100% - 16px);
@@ -172,10 +362,6 @@
min-width: 180px !important; min-width: 180px !important;
} }
.sub_setting img {
height: 16px !important;
}
.sub_div { .sub_div {
gap: 2px; gap: 2px;
width: calc(100% - 12px); width: calc(100% - 12px);
@@ -192,24 +378,12 @@
min-width: 160px !important; min-width: 160px !important;
} }
.sub_setting img {
height: 14px !important;
}
.sub_div { .sub_div {
width: calc(100% - 8px); width: calc(100% - 8px);
margin: 0 4px; margin: 0 4px;
} }
} }
.sub_div * {
flex-shrink: 0;
}
.sub_div > span:first-child {
flex-shrink: 1;
}
/* Multiple providers container */ /* Multiple providers container */
.sub_providers_container { .sub_providers_container {
display: flex; display: flex;
@@ -272,18 +446,6 @@
border-radius: 5px; 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 { .sub_provider_name {
position: relative; position: relative;
z-index: 1; z-index: 1;
@@ -304,18 +466,6 @@
border-color: #666666; 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 { :root[data-darkmode="true"] .sub_provider_name {
color: #e0e0e0; color: #e0e0e0;
} }
@@ -383,12 +533,20 @@
<div class="sub_div"> <div class="sub_div">
<span id='<%=idname%>' class="sub_tab"></span> <span id='<%=idname%>' class="sub_tab"></span>
<span class="sub_setting"> <button type="button" class="sub_setting" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'>
<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)'> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
</span> <path d="M23 4v6h-6"></path>
<span class="sub_setting"> <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
<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%>")'> </svg>
</span> </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> </div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
@@ -398,10 +556,21 @@ var s_<%=idname%>;
sub_info_get_<%=idname%>(); sub_info_get_<%=idname%>();
setTimeout(function(){ setTimeout(function(){
initDarkMode();
}, 200);
function initDarkMode() {
if (typeof isDarkBackground === 'undefined') {
setTimeout(function() {
initDarkMode();
}, 100);
return;
}
if (isDarkBackground(document.body)) { if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true'); document.documentElement.setAttribute('data-darkmode', 'true');
}; }
}, 300); }
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) { function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
var screenWidth = window.innerWidth || document.documentElement.clientWidth; var screenWidth = window.innerWidth || document.documentElement.clientWidth;
@@ -588,14 +757,12 @@ function sub_info_refresh_<%=idname%>()
(status.day_left) (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; retry_<%=idname%> = 0;
localStorage.setItem("sub_info_<%=filename%>",JSON.stringify(status)); localStorage.setItem("sub_info_<%=filename%>",JSON.stringify(status));
document.getElementById('<%=idname%>').className = "sub_tab_show"; document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>"; document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
} } else {
else {
if (document.getElementById('<%=idname%>').innerHTML == "" || retry_<%=idname%> > 2) { if (document.getElementById('<%=idname%>').innerHTML == "" || retry_<%=idname%> > 2) {
document.getElementById('<%=idname%>').className = "sub_tab_show"; document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>"; 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) { if (retry_<%=idname%> > 2) {
retry_<%=idname%> = 0; retry_<%=idname%> = 0;
localStorage.removeItem("sub_info_<%=filename%>"); localStorage.removeItem("sub_info_<%=filename%>");
} } else {
else {
retry_<%=idname%> ++; retry_<%=idname%> ++;
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*120); s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*120);
return return
} }
}; };
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*1800); 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) { function set_subinfo_url_<%=idname%>(btn, filename) {
var new_url = prompt("<%:Paste the new url of subscribe infos sources here:%>", ""); if (filename == null || filename == "") {
if (filename == null || filename == "") { return false;
return false; }
}
if (new_url == null) { var dialogDiv = document.createElement('div');
return false; dialogDiv.className = 'sub-info-url-overlay';
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "set_subinfo_url")%>', {filename: filename, url: new_url}, function(x, status) { var contentDiv = document.createElement('div');
if (x && x.status == 200 && status.info == "Success") contentDiv.className = 'sub-info-url-model';
{
sub_info_refresh_<%=idname%>(); var headerDiv = document.createElement('div');
alert("<%:Specify subscribe infos sources url successfully!%>"); headerDiv.className = 'sub-info-url-header';
}
else if (x && x.status == 200 && status.info == "Delete success") var titleDiv = document.createElement('div');
{ titleDiv.className = 'sub-info-url-title';
sub_info_refresh_<%=idname%>(); titleDiv.innerHTML = '<%:Paste the new url of subscribe infos sources here:%>';
alert("<%:Delete Specify Subscribe infos sources url successfully!%>"); headerDiv.appendChild(titleDiv);
}
else var bodyDiv = document.createElement('div');
{ bodyDiv.className = 'sub-info-url-content';
alert("<%:Specify subscribe infos sources url failed:%>\n" + status.info);
} 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> //]]></script>
@@ -56,7 +56,7 @@
btn.value = '<%:Downloading File...%>'; btn.value = '<%:Downloading File...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_dashboard")%>', {name: name, type : type}, function(x, status) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_dashboard")%>', {name: name, type : type}, function(x, status) {
if ( x && x.status == 200 ) { if ( x && x.status == 200 ) {
if ( status.download_state == "1" ) { if ( status.download_state == "0" ) {
if ( type == "Meta" ) { if ( type == "Meta" ) {
if ( name == "Dashboard" ) { 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\')"/>'; 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\')"/>';
@@ -33,23 +33,32 @@ end
local a={} local a={}
local e={} local e={}
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do if self.sectiontype == "dns_servers" then
a=fs.stat(o) table.insert(e, {name="nameserver", title="nameserver"})
if a then table.insert(e, {name="fallback", title="fallback"})
e[t]={} table.insert(e, {name="default", title="default-nameserver"})
e[t].name=fs.basename(o) 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
end end
if not table_include(e, "all") then
table.insert(e, 1, {name="all"})
end
local cfg_name 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")) cfg_name = fs.basename(uci:get("openclash", "config", "config_path"))
end end
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype" 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{ #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
flex: 1 1 0; flex: 1 1 0;
min-width: 120px; min-width: 120px;
max-width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 8px; gap: 8px;
padding: 12px 0; padding: 12px 0;
height: 40px; height: 100%;
font-size: 12px; font-size: 13px;
font-weight: 400; font-weight: 400;
color: #64748b; color: #64748b;
background: transparent; background: transparent;
@@ -128,7 +138,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{ #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
display: block; display: block;
width: 100%; width: 100%;
height: 130%; height: 100%;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
background: none; background: none;
@@ -232,9 +242,9 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
<!-- tblsection --> <!-- tblsection -->
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>"> <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title and #self.title > 0 then -%> <%- if self.title and #self.title > 0 then -%>
<legend><%=self.title%></legend> <h3><%=self.title%></h3>
<%- end %> <%- end -%>
<%- if self.sortable then -%> <%- if self.sortable then -%>
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" /> <input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%> <%- 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"> <div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
<ul class="cbi-tabmenu"> <ul class="cbi-tabmenu">
<%- <%-
if #e ~= 1 then if self.sectiontype == "dns_servers" then
for t,o in ipairs(e)do for i, tab in ipairs(e) do
if o.name == cfg_name and cfg_name then if i == 1 then
-%> -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a><%=o.name%></a></li> <li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.title%></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>
<%- else -%> <%- 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 -%>
<%- end -%> <%- end -%>
<%- else -%> <%- 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 -%> <%- end -%>
</ul> </ul>
</div> </div>
<div id="tab-content"> <div id="tab-content">
<%- for t,o in ipairs(e)do <%- for i, tab in ipairs(e) do
if #e ~= 1 and o.name == cfg_name and cfg_name then if self.sectiontype == "dns_servers" then
if tab.name == "nameserver" 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%>">
<%- elseif #e ~= 1 and o.name == "all" and not cfg_name then -%> <%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;"> <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 -%> <%- 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 -%> <%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>"> <div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=tab.name%>">
<%- end -%> <%- end -%>
<table class="cbi-section-table"> <table class="table cbi-section-table">
<tr class="cbi-section-table-titles"> <tr class="tr cbi-section-table-titles">
<%- if not self.anonymous then -%> <%- if not self.anonymous then -%>
<%- if self.sectionhead 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 -%> <%- else -%>
<th>&#160;</th> <th>&#160;</th>
<%- end -%> <%- end -%>
<%- end -%> <%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%> <%- for i, k in pairs(self.children) do if not k.optional then -%>
<%- if i == 1 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 -%> <%- 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 -%> <%- 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-%> <%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%> <%- if k.titleref then -%></a><%- end -%>
</th> </th>
<%- count = count + 1; end; end; if self.sortable then -%> <%- 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 -%> <%- 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 -%> <%- count = count + 1; end -%>
</tr> </tr>
<tr class="cbi-section-table-descr"> <tr class="tr cbi-section-table-descr">
<%- if not self.anonymous then -%> <%- if not self.anonymous then -%>
<%- if self.sectiondesc 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 -%> <%- else -%>
<th></th> <th class="th cbi-section-table-cell"></th>
<%- end -%> <%- end -%>
<%- end -%> <%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%> <%- 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 -%> <%- 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 -%> <%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"></th> <th class="th cbi-section-table-cell"></th>
<%- end -%> <%- end -%>
</tr> </tr>
<%- local isempty = true <%- local isempty = true
local num = 1 local num = 1
for i, k in ipairs(self:cfgsections()) do for i, k in ipairs(self:cfgsections()) do
section = k local section = k
while true do local should_render = false
if not uci:get("openclash", section, "config") then local section_name
uci:set("openclash", section, "config", "all") if self.sectiontype == "dns_servers" then
uci:save("openclash") section_name = uci:get("openclash", section, "group")
end else
if uci:get("openclash", section, "config") ~= o.name then section_name = uci:get("openclash", section, "config")
break end
end if section_name == tab.name then
should_render = true
end
if should_render then
isempty = false isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } 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%>"> <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 -%> <%- if not self.anonymous then -%>
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th> <th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
<%- end %> <%- end -%>
<td class="cbi-section-table-cell"> <td class="td cbi-section-table-cell">
<p><%=num%></p> <p><%=num%></p>
<% num = num + 1 -%> <%- num = num + 1 -%>
</td> </td>
<%- <%-
for k, node in ipairs(self.children) do for k, node in ipairs(self.children) do
@@ -344,14 +375,14 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
end end
-%> -%>
<%- if self.sortable then -%> <%- 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-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%>" /> <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> </td>
<%- end -%> <%- end -%>
<%- if self.extedit or self.addremove then -%> <%- if self.extedit or self.addremove then -%>
<td class="cbi-section-table-cell"> <td class="td cbi-section-table-cell">
<%- if self.extedit then -%> <%- if self.extedit then -%>
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>" <input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
<%- if type(self.extedit) == "string" then <%- 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%>()" %> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- end <%- end
%> alt="<%:Edit%>" title="<%:Edit%>" /> %> 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%>" /> <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 -%> <%- end -%>
</td> </td>
<%- end -%> <%- end -%>
<%- <%-
break
end end
-%> -%>
</tr> </tr>
<%- end -%> <%- end -%>
<%- if isempty then -%> <%- if isempty then -%>
<tr class="cbi-section-table-row"> <tr class="tr cbi-section-table-row placeholder">
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td> <td class="td" colspan="<%=count%>"><em><%:This section contains no values yet%></em></td>
</tr> </tr>
<%- end -%> <%- end -%>
</table> </table>
<% if self.error then %> <%- if self.error then -%>
<div class="cbi-section-error"> <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> <li><%=pcdata(e):gsub("\n","<br />")%></li>
<%- end end %></ul> <%- end end -%></ul>
</div> </div>
<% end %> <%- end -%>
<%- if self.addremove then -%> <%- 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"> <div class="cbi-section-create cbi-tblsection-create">
<% if self.anonymous then %> <%- 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%>" /> <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 %> <%- else -%>
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %> <% 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 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 -%> <% if self.invalid_cts then -%>
<br /><%:Invalid%></div> <br /><%:Invalid%></div>
<%- end %> <%- end %>
<% end %> <%- end %>
</div> </div>
<%- end %> <%- end -%>
<%- end -%> <%- end -%>
</div> </div>
<%- end -%> <%- 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> </div>
</fieldset> </fieldset>
<!-- /tblsection --> <!-- /tblsection -->
@@ -452,17 +485,20 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
return luminance < 128; 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(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if ( type == 'create' ) { for(var j=0; j < titles<%=sectiontype%>.length; j++){
localStorage.setItem("titles<%=sectiontype%>", 0); if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
} else { localStorage.setItem("titles<%=sectiontype%>", j);
for(var j=0; j < titles<%=sectiontype%>.length; j++){ break;
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;
} }
} }
@@ -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>
@@ -144,7 +144,7 @@
function restore_config(btn) function restore_config(btn)
{ {
btn.value = '<%:Restore Default Config%>'; btn.value = '<%:Restore Default%>';
btn.disabled = true; btn.disabled = true;
var r = confirm("<%:Are you sure want to restore the default config?%>") var r = confirm("<%:Are you sure want to restore the default config?%>")
if (r == true) { if (r == true) {
@@ -1,146 +1,132 @@
<style> <style>
.cbi-input-select { .cbi-input-select {
width: auto !important; width: auto !important;
} }
</style> </style>
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<table width="100%"> <table width="100%">
<tr><td width="100%" colspan="6"> <tr>
<p align="center" id="update_tip"> <td width="100%" colspan="6">
<b><%:Note: if the update fails, you can manually download and upload%></b> <p align="center" id="update_tip" class="oc" style="background-color: unset;">
</p> <b style="color: var(--info-color);"><%:Note: if the update fails, you can manually download and upload%></b>
</td></tr> </p>
<tr><td width="16.6%" align="right"><%:Compiled Version%></td> </td>
<td width="16.6%" align="left"> </tr>
<select class="cbi-input-select" name="CORE_VERSION" id="CORE_VERSION"> <tr>
<option value="linux-386"><%:linux-386%></option> <td width="16.6%" align="right"><%:Compiled Version%></td>
<option value="linux-amd64-v1"><%:linux-amd64-v1(x86-64)%></option> <td width="16.6%" align="left">
<option value="linux-amd64-v2"><%:linux-amd64-v2(x86-64)%></option> <select class="cbi-input-select" name="CORE_VERSION" id="CORE_VERSION">
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option> <option value="linux-386"><%:linux-386%></option>
<option value="linux-armv5"><%:linux-armv5%></option> <option value="linux-amd64-v1"><%:linux-amd64-v1(x86-64)%></option>
<option value="linux-armv6"><%:linux-armv6%></option> <option value="linux-amd64-v2"><%:linux-amd64-v2(x86-64)%></option>
<option value="linux-armv7"><%:linux-armv7%></option> <option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
<option value="linux-arm64"><%:linux-arm64(armv8)%></option> <option value="linux-armv5"><%:linux-armv5%></option>
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option> <option value="linux-armv6"><%:linux-armv6%></option>
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option> <option value="linux-armv7"><%:linux-armv7%></option>
<option value="linux-riscv64"><%:linux-riscv64%></option> <option value="linux-arm64"><%:linux-arm64(armv8)%></option>
<option value="linux-s390x"><%:linux-s390x%></option> <option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option> <option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option> <option value="linux-riscv64"><%:linux-riscv64%></option>
<option value="linux-mips64"><%:linux-mips64%></option> <option value="linux-s390x"><%:linux-s390x%></option>
<option value="linux-mips64le"><%:linux-mips64le%></option> <option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option> <option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option> <option value="linux-mips64"><%:linux-mips64%></option>
<option value="0"><%:Not Set%></option> <option value="linux-mips64le"><%:linux-mips64le%></option>
</select> <option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
</td> <option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
<td width="16.6%" align="right"><%:Release Branch%></td> <option value="0"><%:Not Set%></option>
<td width="16.6%" align="left"><select class="cbi-input-select" name="RELEASE_BRANCH" id="RELEASE_BRANCH"> </select>
<option value="master">Master</option> </td>
<option value="dev">Developer</option> <td width="16.6%" align="right"><%:Release Branch%></td>
</select></td> <td width="16.6%" align="left">
<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> <select class="cbi-input-select" name="RELEASE_BRANCH" id="RELEASE_BRANCH">
<td width="16.6%" align="left"><select class="cbi-input-select" name="SMART_ENABLE" id="SMART_ENABLE"> <option value="master">Master</option>
<option value="0"><%:Disabled%></option> <option value="dev">Developer</option>
<option value="1"><%:Enable%></option> </select>
</select></td> </td>
</tr> <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> </table>
</fieldset> </fieldset>
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<table width="100%"> <table width="100%">
<tr><td width="100%" colspan="4"> <tr>
<p align="center"> <td width="100%" colspan="4">
<b><%:Core Update%></b> <p align="center">
</p> <b><%:Core Update%></b>
</td></tr> </p>
<tr><td width="100%" colspan="4"> </td>
</tr>
<tr> <tr>
<td width="25%"><%:CPU Architecture%></td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td> <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> <td width="25%"><%:Last Check Update%></td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td>
</tr> </tr>
<tr><td width="100%" colspan="4"> <tr>
<p align="center"> <td width="100%" colspan="4">
<b><%:Core path:%>/etc/openclash/core/clash_meta</b> <p align="center">
</p> <b><%:Core path:%>/etc/openclash/core/clash_meta</b>
</td></tr> </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%">[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> <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> </table>
</fieldset> </fieldset>
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<table width="100%"> <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> <tr>
<td width="25%"> <td width="100%" colspan="4">
<p align="center" id="backup"> <p align="center">
<%:Collecting data...%> <b><%:Client Update%></b>
</p> </p>
</td> </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>
</tr> </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> <tr>
<td width="25%"> <td width="25%" align="center">
<p align="center" id="backup_config_only"> <div style="display: inline-block; white-space: nowrap;">
<%:Collecting data...%> <select class="cbi-input-select" name="BACKUP_SELECT" id="BACKUP_SELECT">
</p> <option value="backup"><%:Backup File%></option>
</td> <option value="backup_ex_core"><%:Backup Exclude Cores%></option>
<td width="25%"> <option value="backup_only_core"><%:Backup Core%></option>
<p align="center" id="backup_rule_only"> <option value="backup_only_config"><%:Backup Config%></option>
<%:Collecting data...%> <option value="backup_only_rule"><%:Backup Rule Provider%></option>
</p> <option value="backup_only_proxy"><%:Backup Proxy Provider%></option>
</td> </select>
<td width="25%"> <span id="backup">
<p align="center" id="backup_proxy_only"> <%:Collecting data...%>
<%:Collecting data...%> </span>
</p> </div>
</td> </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> </tr>
</table> </table>
</fieldset> </fieldset>
@@ -160,11 +146,7 @@
var ma_op_up = document.getElementById('ma_op_up'); var ma_op_up = document.getElementById('ma_op_up');
var restore = document.getElementById('restore'); var restore = document.getElementById('restore');
var backup = document.getElementById('backup'); var backup = document.getElementById('backup');
var backup_ex_core = document.getElementById('backup_ex_core'); var backup_select = document.getElementById('BACKUP_SELECT');
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 one_key_update_cdn = document.getElementById('one_key_update_cdn'); var one_key_update_cdn = document.getElementById('one_key_update_cdn');
var remove_core = document.getElementById('remove_core'); var remove_core = document.getElementById('remove_core');
var release_branch = document.getElementById('RELEASE_BRANCH'); 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)"/>'; 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_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)"/>'; 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)"/>'; 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)"/>'; 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.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup File%>" onclick="return backup_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)"/>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) {
if ( x && x.status == 200 ) { if ( x && x.status == 200 ) {
if ( status.corever && status.corever != "0" && status.corever != "" ) { if ( status.corever && status.corever != "0" && status.corever != "" ) {
core_version.value = status.corever; core_version.value = status.corever;
} }
else { else {
core_version.value = "0"; core_version.value = "0";
} }
if ( status.release_branch && status.release_branch != "" ) { if ( status.release_branch && status.release_branch != "" ) {
release_branch.value = status.release_branch; release_branch.value = status.release_branch;
} }
else { else {
release_branch.value = "master"; release_branch.value = "master";
} }
if ( status.smart_enable && status.smart_enable != "" ) { if ( status.smart_enable && status.smart_enable != "" ) {
smart_enable.value = status.smart_enable; smart_enable.value = status.smart_enable;
@@ -215,190 +192,169 @@
}); });
function updateStatus(x, status) { function updateStatus(x, status) {
if ( x && x.status == 200 ) { 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>"; 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('.');
var maxLen = Math.max(ver1.length, ver2.length); if ( status.upchecktime != "1" ) {
while (ver1.length < maxLen) ver1.push('0'); checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
while (ver2.length < maxLen) ver2.push('0'); } 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 coremetalvis = status.corelv;
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) { if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "loading...") {
op_lv.innerHTML = "<b style=color:green>"+oplv+" <%:<New>%></b>"; core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+" <%:<New>%></b>";
} else { } else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "loading...") {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>"; 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 if (oplv != "" && oplv != "loading...") { } else {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>"; core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></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); 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) { function handleStartLog(x, status) {
if ( x && x.status == 200 ) { if ( x && x.status == 200 ) {
if ( status.startlog == "\n" || status.startlog == "" || status.startlog == "##FINISH##\n" ) { if ( status.startlog == "\n" || status.startlog == "" || status.startlog == "##FINISH##\n" ) {
var rdmdl = Math.floor(Math.random()*3)+1; var rdmdl = Math.floor(Math.random()*3)+1;
if(rdmdl == 1) { if(rdmdl == 1) {
update_tip.innerHTML = '<b><font><%:Note: if the update fails, you can manually download and upload%></font></b>'; 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) { 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>'; 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) { else if(rdmdl == 3) {
update_tip.innerHTML = '<b><font><%:Note: options will auto-save when you click to update or download%></font></b>'; 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")) {
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) {});
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {}); if ( status.startlog.match("level=fatal") ) {
if ( status.startlog.match("level=fatal") ) { alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]); }
} } else if ( status.startlog != "\n" && status.startlog != "" && status.startlog != "##FINISH##\n" ) {
else { for (var levelKey in window.levelTranslations) {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('FTL [Config] ')[1]); var translatedText = '[' + window.levelTranslations[levelKey] + ']';
} if (status.startlog.match(translatedText)) {
} update_tip.innerHTML = '<b style=color:var(--' + levelKey + '-color)>' + status.startlog + '</b>';
else if ( status.startlog != "\n" && status.startlog != "" && status.startlog != "##FINISH##\n" ) { return;
if ( status.startlog.match("Tip:") || status.startlog.match("提示:")) { }
update_tip.innerHTML = '<b style=color:#ff6f00>'+status.startlog+'</b>'; }
} update_tip.innerHTML = '<b style=color:var(--info-color)>' + 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>';
}
}
}
}
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) function core_update(btn,type) {
{ var v = core_version.value;
var v = core_version.value; var r = release_branch.value;
var r = release_branch.value;
var s = smart_enable.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) { 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) { if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', {core_type: type}, function(x, status) { 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; btn.disabled = false;
return false; return false;
}); });
} }
}); });
} }
function op_update(btn) function op_update(btn) {
{ var v = core_version.value;
var v = core_version.value; var r = release_branch.value;
var r = release_branch.value;
var s = smart_enable.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) { 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) { if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "opupdate")%>', null, function(x, status) { 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; btn.disabled = false;
return false; return false;
}); });
} }
}); });
} }
function ma_core_update(btn,type) function ma_core_update(btn,type) {
{ var v = core_version.value;
var v = core_version.value;
var r = release_branch.value; var r = release_branch.value;
var s = smart_enable.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) { 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) { if (x && x.status == 200) {
btn.value = '<%:Download%>'; btn.value = '<%:Download%>';
btn.disabled = false; btn.disabled = false;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) { XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
if ( x && x.status == 200 ) { if ( x && x.status == 200 ) {
if ( status.corever != "0" ) { if ( status.corever != "0" ) {
if (type == "Meta") { if (type == "Meta") {
if (s == "1") { if (s == "1") {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/smart/clash-'+status.corever+'.tar.gz'; url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/smart/clash-'+status.corever+'.tar.gz';
window.location.href=url4; window.location.href=url4;
} } else {
else { url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz';
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz'; window.location.href=url4;
window.location.href=url4; }
}
} else {
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
} }
} }
} });
else { return false;
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
}
} }
}); });
return false; }
}
});
}
function ma_op_update(btn) function ma_op_update(btn) {
{ btn.value = '<%:Download%>';
btn.value = '<%:Download%>'; btn.disabled = false;
btn.disabled = false; var v = core_version.value;
var v = core_version.value;
var r = release_branch.value; var r = release_branch.value;
var s = smart_enable.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) { 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 ( oplv != "" && oplv != "loading..." ) {
if (status.pkg_type == "apk") { if (status.pkg_type == "apk") {
url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash-'+oplv+'.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'; url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash_'+oplv+'_all.ipk';
} }
window.location.href=url2; window.location.href=url2;
} } else {
else {
alert('<%:Failed to get the latest version. Please try again later!%>') alert('<%:Failed to get the latest version. Please try again later!%>')
} }
} }
}); });
} }
}); });
return false; return false;
} }
function remove_all_core(btn) function remove_all_core(btn) {
{ btn.value = '<%:Remove Core%>';
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%>';
btn.disabled = true; 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; btn.disabled = false;
return false; return false;
} }
function backup_no_core(btn) function backup_file(btn) {
{ btn.value = '<%:Backup File%>';
btn.value = '<%:Backup Exclude Cores%>';
btn.disabled = true; btn.disabled = true;
window.location.href='<%="backup_ex_core"%>'; window.location.href=backup_select.value;
btn.disabled = false; btn.disabled = false;
return false; return false;
} }
function backup_only_core(btn) function all_one_key_update_cdn(btn) {
{ var v = core_version.value;
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;
var r = release_branch.value; var r = release_branch.value;
var s = smart_enable.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) { 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) { if (x && x.status == 200) {
btn.value = '<%:Check Update%>'; btn.value = '<%:Check Update%>';
btn.disabled = false; btn.disabled = false;
return select_git_cdn("one_key_update"); return select_git_cdn("one_key_update");
} }
}); });
} }
//]]></script> //]]></script>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -13,18 +13,14 @@ config openclash 'config'
option auto_update_time '0' option auto_update_time '0'
option cn_port '9090' option cn_port '9090'
option dashboard_forward_ssl '0' option dashboard_forward_ssl '0'
option rule_source '0'
option enable_custom_dns '0' option enable_custom_dns '0'
option ipv6_enable '0' option ipv6_enable '0'
option ipv6_dns '0' option ipv6_dns '0'
option enable_custom_clash_rules '0' option enable_custom_clash_rules '0'
option other_rule_auto_update '0'
option core_version '0' option core_version '0'
option en_mode 'fake-ip' option en_mode 'fake-ip'
option enable_redirect_dns '1' option enable_redirect_dns '1'
option servers_if_update '0'
option disable_masq_cache '1' option disable_masq_cache '1'
option servers_update '0'
option log_level '0' option log_level '0'
option proxy_mode 'rule' option proxy_mode 'rule'
option intranet_allowed '1' option intranet_allowed '1'
File diff suppressed because it is too large. Load diff
@@ -5,6 +5,6 @@
# This script is called by /etc/init.d/openclash # 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 # 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 exit 0
@@ -6,7 +6,7 @@
# This script is called by /etc/init.d/openclash # 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 # 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")) LOGTIME=$(echo $(date "+%Y-%m-%d %H:%M:%S"))
LOG_FILE="/tmp/openclash.log" LOG_FILE="/tmp/openclash.log"
#Config Path #Config Path
@@ -42,7 +42,7 @@ CONFIG_FILE="$1"
#2--key name #2--key name
#3--hash #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" "['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 #Array Edit Demo
#1--config path #1--config path
@@ -51,7 +51,7 @@ CONFIG_FILE="$1"
#4--match key value #4--match key value
#5--target key name #5--target key name
#6--target key value #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" #ruby_arr_edit "$CONFIG_FILE" "['dns']['nameserver']" "" "114.114.114.114" "" "119.29.29.29"
#Array Insert Value Demo: #Array Insert Value Demo:
@@ -103,7 +103,7 @@ CONFIG_FILE="$1"
# begin # begin
# Value = YAML.load_file('$CONFIG_FILE'); # Value = YAML.load_file('$CONFIG_FILE');
# rescue Exception => e # rescue Exception => e
# puts '${LOGTIME} Error: Load File Failed,【' + e.message + '】'; # puts '${LOGTIME} [error] Load File Failed,【' + e.message + '】';
# end; # end;
#General #General
@@ -117,7 +117,7 @@ CONFIG_FILE="$1"
# }.join; # }.join;
# rescue Exception => e # rescue Exception => e
# puts '${LOGTIME} Error: Set General Failed,【' + e.message + '】'; # puts '${LOGTIME} [error] Set General Failed,【' + e.message + '】';
# ensure # ensure
# File.open('$CONFIG_FILE','w') {|f| YAML.dump(Value, f)}; # File.open('$CONFIG_FILE','w') {|f| YAML.dump(Value, f)};
# end" 2>/dev/null >> $LOG_FILE # end" 2>/dev/null >> $LOG_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
@@ -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
@@ -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
@@ -1,4 +0,0 @@
payload:
# > ABC
- DOMAIN-SUFFIX,edgedatg.com
- DOMAIN-SUFFIX,go.com
@@ -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
@@ -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
@@ -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)\/
@@ -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
@@ -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
@@ -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
@@ -1,5 +0,0 @@
payload:
# > Apple TV
- DOMAIN,np-edge.itunes.apple.com
- DOMAIN,play-edge.itunes.apple.com
- DOMAIN-SUFFIX,tv.apple.com
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
File diff suppressed because it is too large. Load diff
@@ -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
@@ -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
@@ -1,6 +0,0 @@
payload:
# > Fox+ (HK|TW|SG)
# - USER-AGENT,FOXPlus*
- DOMAIN-SUFFIX,akamaized.net
- DOMAIN-SUFFIX,foxplus.com
- DOMAIN-SUFFIX,theplatform.com
@@ -1,6 +0,0 @@
payload:
# > Fox Now
# - USER-AGENT,FOX%20NOW*
- DOMAIN-SUFFIX,fox.com
- DOMAIN-SUFFIX,foxdcg.com
- DOMAIN-SUFFIX,uplynk.com
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Loaded 100 of 212 files, more files were not shown because too many files have changed in this diff. Show more