Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix errors #540

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed trunk/user/htop/htop-2.2.0.tar.gz
Binary file not shown.
Binary file added trunk/user/htop/htop-3.0.2.tar.gz
Binary file not shown.
28 changes: 21 additions & 7 deletions trunk/user/www/n56u_ribbon_fixed/Shadowsocks.asp
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,17 @@ setTimeout('document.getElementById("btn_ctime").style.display="none";',1000);
var nodeList = document.getElementById("nodeList"); // 获取节点
var unodeList = document.getElementById("u_nodeList"); // 获取节点
var s5nodeList = document.getElementById("s5_nodeList"); // 获取节点
$j(nodeList).find("option:gt(0)").remove();
$j(unodeList).find("option:gt(1)").remove();
$j(s5nodeList).find("option:gt(1)").remove();
for (var key in db_ss) { // 遍历对象
var optionObj = JSON.parse(db_ss[key]); // 字符串转为对象
//if(optionObj.ping != "failed"){ //过滤ping不通的节点
var optionObj = null;
try {
optionObj = JSON.parse(removeUselessChars(db_ss[key]));//字符串转为对象
} catch(e) {
optionObj = null;
}
if (optionObj == null) continue;
var text = '[ ' + (optionObj.type ? optionObj.type : "类型获取失败") + ' ] ' + (optionObj
.alias ? optionObj.alias : "名字获取失败"); // 判断下怕获取失败 ,括号是运算的问题
// 添加
Expand Down Expand Up @@ -517,7 +525,13 @@ setTimeout('document.getElementById("btn_ctime").style.display="none";',1000);
var myss = new Array();
var i = 0;
for (var key in db_ss) { // 遍历对象
var dbss = JSON.parse(db_ss[key])
var dbss = null;
try {
dbss = JSON.parse(removeUselessChars(db_ss[key]));//字符串转为对象
} catch(e) {
dbss = null;
}
if (dbss == null) continue;
dbss.ids = key.replace("ssconf_basic_json_", '');
myss[i] = dbss;
i = i + 1;
Expand Down Expand Up @@ -1050,7 +1064,7 @@ setTimeout('document.getElementById("btn_ctime").style.display="none";',1000);
url0 = sstr.substr(0, ploc);
param = sstr.substr(ploc + 2);
}
var ssm = JSON.parse(sstr);
var ssm = JSON.parse(removeUselessChars(sstr));
document.getElementById('ssp_name').value = ssm.ps;
document.getElementById('ssp_server').value = ssm.add;
document.getElementById('ssp_prot').value = ssm.port;
Expand Down Expand Up @@ -1271,17 +1285,17 @@ setTimeout('document.getElementById("btn_ctime").style.display="none";',1000);
}
function showsdlinkList() {
var key = "ssconf_basic_json_" + document.getElementById("nodeList").value;
var result = JSON.parse(db_ss[key]);
var result = JSON.parse(removeUselessChars(db_ss[key]));
document.getElementById("d_type").value = result.type;
}
function showsudlinkList() {
var key = "ssconf_basic_json_" + document.getElementById("u_nodeList").value;
var result = JSON.parse(db_ss[key]);
var result = JSON.parse(removeUselessChars(db_ss[key]));
document.getElementById("ud_type").value = result.type;
}
function shows5dlinkList() {
var key = "ssconf_basic_json_" + document.getElementById("s5_nodeList").value;
var result = JSON.parse(db_ss[key]);
var result = JSON.parse(removeUselessChars(db_ss[key]));
document.getElementById("s5_type").value = result.type;
}
</script>
Expand Down
12 changes: 12 additions & 0 deletions trunk/user/www/n56u_ribbon_fixed/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -1319,3 +1319,15 @@ function showhide_div(e, sh) {
else if (document.layers)
document.layers[e].display = status;
}
function removeUselessChars(str) {
str = str.replace(/\\/g, "\\\\");
str = str.replace(/\n/g, "\\n");
str = str.replace(/\r/g, "\\r");
str = str.replace(/\t/g, "\\t");
str = str.replace(/("")+/g, "\"\"");
str = str.replace(/\'/g, "&#39;");
str = str.replace(/ /g, "&nbsp;");
str = str.replace(/</g, "&lt;");
str = str.replace(/>/g, "&gt;");
return str;
}