Skip to content

Commit

Permalink
06191600
Browse files Browse the repository at this point in the history
  • Loading branch information
glzjin committed Jul 19, 2016
1 parent 8cf071a commit 4f26f73
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 26 deletions.
13 changes: 11 additions & 2 deletions app/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ function ($query) {
$node_prefix[$temp[0]]=array();
$node_order[$temp[0]]=$a;
$node_alive[$temp[0]]=0;
$node_method[$temp[0]]=$temp[1];

if(isset($temp[1]))
{
$node_method[$temp[0]]=$temp[1];
}

$a++;
}

Expand Down Expand Up @@ -520,14 +525,18 @@ public function nodeInfo($request, $response, $args)

$ssurl = str_replace("_compatible","",$user->obfs).":".str_replace("_compatible","",$user->protocol).":".$ary['method'] . ":" . $ary['password'] . "@" . $ary['server'] . ":" . $ary['server_port']."/".base64_encode($user->obfs_param);
$ssqr_s = "ss://" . base64_encode($ssurl);
$ssurl = $ary['server']. ":" . $ary['server_port'].":".str_replace("_compatible","",$user->protocol).":".$ary['method'].":".str_replace("_compatible","",$user->obfs).":".base64_encode($ary['password'])."/?obfsparam=".base64_encode($user->obfs_param)."&remarks=".base64_encode($node->name);
$ssqr_s_new = "ssr://" . base64_encode($ssurl);
$ssurl = $ary['method'] . ":" . $ary['password'] . "@" . $ary['server'] . ":" . $ary['server_port'];
$ssqr = "ss://" . base64_encode($ssurl);

}
else
{
$ssurl = $ary['method'] . ":" . $ary['password'] . "@" . $ary['server'] . ":" . $ary['server_port'];
$ssqr = "ss://" . base64_encode($ssurl);
$ssqr_s = "ss://" . base64_encode($ssurl);
$ssqr_s_new = "ss://" . base64_encode($ssurl);
}

$token_1 = LinkController::GenerateSurgeCode($ary['server'],$ary['server_port'],$this->user->id,0,$ary['method']);
Expand All @@ -537,7 +546,7 @@ public function nodeInfo($request, $response, $args)
$surge_proxy = "#!PROXY-OVERRIDE:ProxyBase.conf\n";
$surge_proxy .= "[Proxy]\n";
$surge_proxy .= "Proxy = custom," . $ary['server'] . "," . $ary['server_port'] . "," . $ary['method'] . "," . $ary['password'] . "," . Config::get('baseUrl') . "/downloads/SSEncrypt.module";
return $this->view()->assign('ary', $ary)->assign('node',$node)->assign('user',$this->user)->assign('json', $json)->assign('link1',Config::get('baseUrl')."/link/".$token_1)->assign('link2',Config::get('baseUrl')."/link/".$token_2)->assign('json_show', $json_show)->assign('ssqr', $ssqr)->assign('ssqr_s', $ssqr_s)->assign('surge_base', $surge_base)->assign('surge_proxy', $surge_proxy)->assign('info_server', $ary['server'])->assign('info_port', $this->user->port)->assign('info_method', $ary['method'])->assign('info_pass', $this->user->passwd)->display('user/nodeinfo.tpl');
return $this->view()->assign('ary', $ary)->assign('node',$node)->assign('user',$this->user)->assign('json', $json)->assign('link1',Config::get('baseUrl')."/link/".$token_1)->assign('link2',Config::get('baseUrl')."/link/".$token_2)->assign('json_show', $json_show)->assign('ssqr', $ssqr)->assign('ssqr_s_new',$ssqr_s_new)->assign('ssqr_s', $ssqr_s)->assign('surge_base', $surge_base)->assign('surge_proxy', $surge_proxy)->assign('info_server', $ary['server'])->assign('info_port', $this->user->port)->assign('info_method', $ary['method'])->assign('info_pass', $this->user->passwd)->display('user/nodeinfo.tpl');
}
break;

Expand Down
7 changes: 4 additions & 3 deletions app/Utils/QQWry.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ class QQWry {
private $totalip;


public function __construct($filename = BASE_PATH."/app/Utils/qqwry.dat") {

$this->fp = 0;
public function __construct() {
$filename = BASE_PATH."/app/Utils/qqwry.dat"
$this->fp = 0;
if (($this->fp = fopen($filename, 'rb')) !== false) {
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// BASE_PATH
define('BASE_PATH', __DIR__);
define('VERSION', '201607191030');
define('VERSION', '201607191600');

// Vendor Autoload
require BASE_PATH.'/vendor/autoload.php';
Expand Down
7 changes: 3 additions & 4 deletions fix_bom.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ function checkBOM ($filename) {
if ($auto == 1) {
$rest = substr($contents, 3);
rewrite ($filename, $rest);
return ("<font color=red>BOM found,
automatically removed.</font>");
return ("BOM found,
automatically removed.");
} else {
return ("<font color=red>BOM found.
</font>");
return ("BOM found.");
}
}
else return ("BOM Not Found.");
Expand Down
1 change: 1 addition & 0 deletions glzjin_23.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `user` CHANGE `protocol` `protocol` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'origin', CHANGE `obfs` `obfs` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'plain';
34 changes: 19 additions & 15 deletions resources/views/material/admin/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@
type: "doughnut",
showInLegend: true,
dataPoints: [
{
y: {(1-($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100}, legendText:"离线节点 {number_format((1-($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getTotalSSNode()-$sts->getAliveSSNode()}", indexLabel: "离线节点 {number_format((1-($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getTotalSSNode()-$sts->getAliveSSNode()}"
},
{
y: {(($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100}, legendText:"在线节点 {number_format((($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getAliveSSNode()}", indexLabel: "在线节点 {number_format((($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getAliveSSNode()}"
}
{if $sts->getTotalSSNode()!=0}
{
y: {(1-($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100}, legendText:"离线节点 {number_format((1-($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getTotalSSNode()-$sts->getAliveSSNode()}", indexLabel: "离线节点 {number_format((1-($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getTotalSSNode()-$sts->getAliveSSNode()}"
},
{
y: {(($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100}, legendText:"在线节点 {number_format((($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getAliveSSNode()}", indexLabel: "在线节点 {number_format((($sts->getAliveSSNode()/$sts->getTotalSSNode()))*100,2)}% {$sts->getAliveSSNode()}"
}
{/if}
]
}
]
Expand Down Expand Up @@ -233,15 +235,17 @@
type: "doughnut",
showInLegend: true,
dataPoints: [
{
y: {(($sts->getRawUnusedTrafficUsage()/$sts->getRawTotalTraffic()))*100}, legendText:"未使用的流量 {number_format((($sts->getRawUnusedTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getUnusedTrafficUsage()))}", indexLabel: "未使用的流量 {number_format((($sts->getRawUnusedTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getUnusedTrafficUsage()))}"
},
{
y: {(($sts->getRawLastTrafficUsage()/$sts->getRawTotalTraffic()))*100}, legendText:"已使用的流量 {number_format((($sts->getRawLastTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getLastTrafficUsage()))}", indexLabel: "已使用的流量 {number_format((($sts->getRawLastTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getLastTrafficUsage()))}"
},
{
y: {(($sts->getRawTodayTrafficUsage()/$sts->getRawTotalTraffic()))*100}, legendText:"今日使用的流量 {number_format((($sts->getRawTodayTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getTodayTrafficUsage()))}", indexLabel: "今日使用的流量 {number_format((($sts->getRawTodayTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getTodayTrafficUsage()))}"
}
{if $sts->getRawTotalTraffic()!=0}
{
y: {(($sts->getRawUnusedTrafficUsage()/$sts->getRawTotalTraffic()))*100}, legendText:"未使用的流量 {number_format((($sts->getRawUnusedTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getUnusedTrafficUsage()))}", indexLabel: "未使用的流量 {number_format((($sts->getRawUnusedTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getUnusedTrafficUsage()))}"
},
{
y: {(($sts->getRawLastTrafficUsage()/$sts->getRawTotalTraffic()))*100}, legendText:"已使用的流量 {number_format((($sts->getRawLastTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getLastTrafficUsage()))}", indexLabel: "已使用的流量 {number_format((($sts->getRawLastTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getLastTrafficUsage()))}"
},
{
y: {(($sts->getRawTodayTrafficUsage()/$sts->getRawTotalTraffic()))*100}, legendText:"今日使用的流量 {number_format((($sts->getRawTodayTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getTodayTrafficUsage()))}", indexLabel: "今日使用的流量 {number_format((($sts->getRawTodayTrafficUsage()/$sts->getRawTotalTraffic()))*100,2)}% {(($sts->getTodayTrafficUsage()))}"
}
{/if}
]
}
]
Expand Down
21 changes: 20 additions & 1 deletion resources/views/material/user/nodeinfo.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<div class="card">
<div class="card-main">
<div class="card-inner margin-bottom-no">
<p class="card-heading">RSS配置二维码</p>
<p class="card-heading">RSS旧版(3.8.3之前)配置二维码</p>
<div class="text-center">
<div id="ss-qr"></div>
</div>
Expand All @@ -121,6 +121,20 @@
</div>
</div>

<div class="col-lg-12 col-sm-12">
<div class="card">
<div class="card-main">
<div class="card-inner margin-bottom-no">
<p class="card-heading">RSS新版(3.8.3之后)配置二维码</p>
<div class="text-center">
<div id="ss-qr-n"></div>
</div>
</div>

</div>
</div>
</div>

{else}

<div class="col-lg-12 col-sm-12">
Expand Down Expand Up @@ -228,6 +242,11 @@
jQuery('#ss-qr-y').qrcode({
"text": text_qrcode1
});
var text_qrcode2 = '{$ssqr_s_new}';
jQuery('#ss-qr-n').qrcode({
"text": text_qrcode2
});
{/if}
var text_surge_base = jQuery('#surge-base-text').val();
Expand Down

0 comments on commit 4f26f73

Please sign in to comment.