diff --git a/api/static/index.html b/api/static/index.html index 15ef2c0..fed8e47 100644 --- a/api/static/index.html +++ b/api/static/index.html @@ -1,287 +1,272 @@ - - - - - sub2sing-box - - - - + - -
+ + + + sub2sing-box + + + + + + + + +
+

- sub2sing-box + sub2sing-box

-
-
-
节点
-
- -
- 订阅链接 - -
+ + + + 亮色 + 暗色 + + 跟随系统 + + +
+ +
+

模板

+ +
- -
- 节点分享链接 - -
- - -
- 删除节点: - -
- - -
- 重命名节点 - -
- -
-
+
+ +
+

节点

+
+
- -
-
模板
-
- -
- -
-
+
+
- -
-
国家策略组
-
- -
- - -
- - -
- 类型 - -
- - -
- 排序依据 - -
- - -
- 排序方式 - -
-
+
+
-
-
生成链接
-
- -
- -
-
+
+ + + 重命名节点 + + + + + +
+ + +
+

策略组

+
+ +
+
+ +
+
+ + 节点名 + 节点数量 + +
+
+ + 升序 + 降序 + +
+
+ + +
+ +
- - - - - + const selects = document.querySelectorAll("mdui-select"); + for (let select of selects) { + select.addEventListener("change", generateLink); + } + } + + function cleanLisnter() { + const inputs = document.querySelectorAll("#form input, #form textarea"); + for (let input of inputs) { + input.removeEventListener("input", generateLink); + } + const selects = document.querySelectorAll("#form select"); + for (let select of selects) { + select.removeEventListener("change", generateLink); + } + } + + function addRenameField() { + cleanLisnter(); + const container = document.getElementById("list"); + const fieldHTML = ` + + + - + `; + container.insertAdjacentHTML("beforeend", fieldHTML); + listenInput(); + } + + function removeThisField(button) { + cleanLisnter(); + button.parentElement.remove(); + generateLink(); + listenInput(); + } + + function generateLink() { + const subscription = document + .getElementById("subscription") + .value.split("\n") + .filter((i) => i); + const proxy = document + .getElementById("proxy") + .value.split("\n") + .filter((i) => i); + const deleteRule = document.getElementById("delete").value; + const template = document.getElementById("template").value; + const renameFrom = Array.from( + document.getElementsByName("rename_from[]") + ).map((input) => input.value); + const renameTo = Array.from( + document.getElementsByName("rename_to[]") + ).map((input) => input.value); + const output = document.getElementById("output"); + const group = document.getElementById("group").checked; + const groupType = document.getElementById("group-type").value; + const sort = document.getElementById("sort").value; + const sortType = document.getElementById("sort-type").value; + + let rename = {}; + for (let i = 0; i < renameFrom.length; i++) { + if (renameFrom[i] && renameTo[i]) { + rename[renameFrom[i]] = renameTo[i]; + } + } + const data = { + subscription, + proxy, + delete: deleteRule, + template, + rename, + group, + "group-type": groupType, + sort, + "sort-type": sortType, + }; + + output.value = `${window.location.origin}/convert?data=${encodeBase64( + JSON.stringify(data) + )}`; + } + + + + \ No newline at end of file diff --git a/templates/tun-fakeip.json b/templates/tun-fakeip.json index 516d614..d5f57e5 100644 --- a/templates/tun-fakeip.json +++ b/templates/tun-fakeip.json @@ -184,13 +184,16 @@ }, "inbounds": [ { - "type": "tun", + "auto_route": true, "inet4_address": "172.19.0.1/30", "inet6_address": "fdfe:dcba:9876::1/126", - "auto_route": true, - "strict_route": true, "sniff": true, - "sniff_override_destination": false + "sniff_override_destination": true, + "strict_route": true, + "type": "tun", + "stack": "mixed", + "inet4_route_exclude_address": ["100.64.0.0/10"], + "inet6_route_exclude_address": ["fd7a:115c:a1e0::/48"] } ], "outbounds": [