✨ Sync 2026-03-24 20:29:24

This commit is contained in:
github-actions[bot] committed 2026-03-24 20:29:24 +08:00
1 parent 6ab1ed486a
commit bc5ced2168
6 files changed
+82 -10

No files matched your search

@@ -5,6 +5,10 @@ local api = require "luci.passwall.api"
<script type="text/javascript">
//<![CDATA[
function ajax_add_node(link, group) {
const dom = document.getElementById('modal-mask');
dom.style.display = 'block';
dom.innerHTML = '<div style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;"><%:Processing, please wait…%></div>';
const chunkSize = 1000; // 分片发送以突破uhttpd的限制,每块1000字符
const totalChunks = Math.ceil(link.length / chunkSize);
let currentChunk = 0;
@@ -19,11 +23,15 @@ local api = require "luci.passwall.api"
currentChunk++;
sendNextChunk();
} else {
dom.innerHTML = '';
dom.style.display = 'none';
alert("<%:Error%>");
return;
}
};
xhr.onerror = function () {
dom.innerHTML = '';
dom.style.display = 'none';
alert("<%:Network Error%>");
return;
};
@@ -93,6 +101,7 @@ local api = require "luci.passwall.api"
nodes_link = decodeIfBase64(nodes_link);
let s = nodes_link.split('://');
if (s.length > 1) {
close_add_link_div();
ajax_add_node(nodes_link, group);
} else {
alert("<%:Please enter the correct link.%>");
@@ -399,11 +399,16 @@ table td, .table .td {
}
}
if (ids.length > 0) {
if (confirm('<%:Are you sure to delete select nodes?%>') == true){
const dom = document.getElementById('modal-mask');
if (confirm('<%:Are you sure to delete select nodes?%>') == true) {
dom.style.display = 'block';
dom.innerHTML = '<div style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;"><%:Processing, please wait…%></div>';
XHR.get('<%=api.url("delete_select_nodes")%>', {
ids: ids.join()
},
function(x, data) {
dom.innerHTML = '';
dom.style.display = 'none';
if (x && x.status == 200) {
/*
for (var i = 0 ; i < ids.length; i++) {
@@ -413,8 +418,7 @@ table td, .table .td {
*/
ajaxAbortAll();
window.location.href = '<%=api.url("node_list")%>';
}
else {
} else {
alert("<%:Error%>");
}
});