Skip to content

Commit

Permalink
Fixed remark error
Browse files Browse the repository at this point in the history
Fixed remark error
  • Loading branch information
Zzm committed Jul 26, 2017
1 parent 5ac651a commit b165b35
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 48 deletions.
3 changes: 3 additions & 0 deletions Plugin/UnlimitedSocks/UnlimitedSocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ function UnlimitedSocks_ClientArea(array $params){
$y = 0;
$ress = array();
foreach($nodee as $nodet){
if($y == 0){
$nodet = base64_encode($nodet);
}
$ress[$y] = $nodet;
$y ++;
if($y == 2 and !$detect->isMobile() and $params['configoption6'] == 1){
Expand Down
2 changes: 1 addition & 1 deletion Plugin/UnlimitedSocks/lang/chinese.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

//Ping测试
$_LANG['ping_test'] = "PING测试";
$_LANG['test_user'] = "用户测试";
$_LANG['test_user'] = "用户测试(需要HTTP)";
$_LANG['test_server'] = "服务器测试";
$_LANG['do_not_test'] = "不要测试";
$_LANG['ping_test_description'] = "Ping测试选项";
Expand Down
2 changes: 1 addition & 1 deletion Plugin/UnlimitedSocks/lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

//PingTest
$_LANG['ping_test'] = "PING Test";
$_LANG['test_user'] = "User Test";
$_LANG['test_user'] = "User Test(HTTP Request)";
$_LANG['test_server'] = "Server Test";
$_LANG['do_not_test'] = "Do Not Test";
$_LANG['ping_test_description'] = "Ping Test options";
2 changes: 1 addition & 1 deletion Plugin/UnlimitedSocks/templates/details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ background-color: rgba(0, 0, 0, .3);
{$yy = 0}
{foreach $nodes as $node }
<tr>
<td>{$node[0]}</td>
<td>{base64_decode($node[0])}</td>
<td class="hidden-xs hidden-sm">{$node[7]}</td>
<td>{$node[1]}</td>
<td>{$node[2]}</td>
Expand Down
80 changes: 36 additions & 44 deletions Plugin/UnlimitedSocks/templates/static/js/SSRscript.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
/*
* ping.js - v0.1.0
* Ping Utilities in Javascript
* http://github.com/alfg/ping.js
*
* Made by Alfred Gutierrez
* Under MIT License
*/
/**
* Creates a Ping instance.
* @returns {Ping}
* @constructor
*/
var Ping = function() {};
/**
* Pings source and triggers a callback when completed.
* @param source Source of the website or server, including protocol and port.
* @param callback Callback function to trigger when completed.
* @param timeout Optional number of milliseconds to wait before aborting.
*/
Ping.prototype.ping = function(source, callback, timeout) {
var Ping = function(opt) {
this.opt = opt || {};
this.favicon = this.opt.favicon || "/favicon.ico";
this.timeout = this.opt.timeout || 0;
};
Ping.prototype.ping = function(source, callback) {
this.img = new Image();
timeout = timeout || 0;
var timer;
var start = new Date();
this.img.onload = this.img.onerror = pingCheck;
if (timeout) { timer = setTimeout(pingCheck, timeout); }
/**
* Times ping and triggers callback.
*/
function pingCheck() {
if (timer) { clearTimeout(timer);}


this.img.onload = pingCheck;
this.img.onerror = pingCheck;
if (this.timeout) { timer = setTimeout(pingCheck, this.timeout); }
var start = new Date();
function pingCheck(e) {
if (timer) { clearTimeout(timer); }
var pong = new Date() - start;

if (typeof callback === "function") {
callback(pong);
if (e.type === "error") {
console.error("error loading resource");
return callback("error", pong);
}
return callback(null, pong);
}
}
this.img.src = source + "/?" + (+new Date()); // Trigger image load with cache buster

this.img.src = source + this.favicon + "?" + (+new Date()); // Trigger image load with cache buster
};
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function base64encode(str) {
Expand Down Expand Up @@ -69,24 +59,24 @@ function base64encode(str) {
return out;
}
$(document).ready(function() {
/* Custom */
$('button[name="ping"]').on('click',function() {
var ping = new Ping();
var address = $(this).attr('data-host');
var timeout = 1000;
var _this = $(this);
ping.ping('http://' + address,function(data) {
if(data >= timeout) {
_this.parents('td').html('<span class="badge badge-danger">X</span>');
} else {
_this.parents('td').html('<span class="badge badge-primary">√</span>');
}
},timeout);
ping.ping('http://' + address,function(err,data) {
if (err) {
data = data + " " + err;
_this.parents('td').html('<span class="badge badge-danger">' + data + '</span>');
}else{
_this.parents('td').html('<span class="badge badge-primary">' + data + '</span>');
}
});
});
jQuery(document).ready(function($) {
$("button[name='qrcode']").on('click',function() {
if($(this).attr('data-type').indexOf("ssr")!=-1){
str = $(this).attr('data-params') + base64encode($(this).attr('data-pass')) + '/?obfsparam=' + base64encode($(this).attr('data-obfsparam')) + '&protoparam=' + base64encode($(this).attr('data-protoparam')) + '&remarks=' + base64encode($(this).attr('data-note')) ;
str = $(this).attr('data-params') + base64encode($(this).attr('data-pass')) + '/?obfsparam=' + base64encode($(this).attr('data-obfsparam')) + '&protoparam=' + base64encode($(this).attr('data-protoparam')) + '&remarks=' + $(this).attr('data-note') ;
} else {
str = $(this).attr('data-params-SS');
}
Expand All @@ -103,12 +93,14 @@ $(document).ready(function() {
});
$("button[name='url']").on('click',function() {
if($(this).attr('data-type').indexOf("ssr")!=-1){
str = $(this).attr('data-params') + base64encode($(this).attr('data-pass')) + '/?obfsparam=' + base64encode($(this).attr('data-obfsparam')) + '&protoparam=' + base64encode($(this).attr('data-protoparam')) + '&remarks=' + base64encode($(this).attr('data-note')) ;
str = $(this).attr('data-params') + base64encode($(this).attr('data-pass')) + '/?obfsparam=' + base64encode($(this).attr('data-obfsparam')) + '&protoparam=' + base64encode($(this).attr('data-protoparam')) + '&remarks=' + $(this).attr('data-note') ;
str = base64encode(str);
str = 'ssr://' + str;
} else {
str = $(this).attr('data-params-SS');
str = base64encode(str);
str = 'ss://' + str;
}
str = base64encode(str);
str = $(this).attr('data-type') + '://' + str;
layer.alert(str);
});
});
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* based on https://github.com/kesuki/whmcs-shadowsocks-plugin which is based on frankwei's project
* fixed QRcode support for ssr|已修复二维码支持
* added traffic chart support|添加用户流量图表
* fixed utf-8 error|修复中文备注乱码问题

## TO-DO List
* ~~Readd custom traffic module|重新添加自定义流量系统~~
Expand All @@ -12,7 +13,7 @@
* ~~Add Ping Test switch function|添加PING测试选项切换支持~~
* ~~Add Random Password Support|添加随机密码支持~~
* Add additional bandwidth|添加额外流量包功能
* Add Admin Dashboard|添加管理员面板
* Add Admin Dashboard|添加管理员面板(30%Progess|进程30%)

## Attentions
* You must add a server and select it in Product->Module Settings|请添加服务器并在产品->模块设置中选择服务器
Expand All @@ -26,6 +27,7 @@

## Other
# More Info in|更多详情请访问 http://www.mak-blog.com/whmcs-shadowsocks-plugin.html
# 或者 http://www.loli.ren/index.php/2017/07/24/unlimitedsocks%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95/ 密码 Zzm317!

* BTW I think a developer's most important ability is to obey the Open-Source Rules
* Not the coding level he can achieve

0 comments on commit b165b35

Please sign in to comment.