mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
feature: add a subscription information panel to Surge and Surfboard for easy viewing
This commit is contained in:
parent
a82b78d770
commit
3e0abe93ab
@ -64,6 +64,14 @@ class Surfboard
|
|||||||
$config = str_replace('$subs_domain', $subsDomain, $config);
|
$config = str_replace('$subs_domain', $subsDomain, $config);
|
||||||
$config = str_replace('$proxies', $proxies, $config);
|
$config = str_replace('$proxies', $proxies, $config);
|
||||||
$config = str_replace('$proxy_group', rtrim($proxyGroup, ', '), $config);
|
$config = str_replace('$proxy_group', rtrim($proxyGroup, ', '), $config);
|
||||||
|
|
||||||
|
$upload = round($user['u'] / (1024*1024*1024), 2);
|
||||||
|
$download = round($user['d'] / (1024*1024*1024), 2);
|
||||||
|
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
||||||
|
$expireDate = $user['expired_at'] === NULL ? '长期有效' : date('Y-m-d H:i:s', $user['expired_at']);
|
||||||
|
$subscribeInfo = "title=\"{$appName}订阅信息\", content=\"上传流量:{$upload}GB\\n下载流量:{$download}GB\\n已用总流量:{$totalTraffic}GB\\n到期时间:{$expireDate}\"";
|
||||||
|
$config = str_replace('$subscribe_info', $subscribeInfo, $config);
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,14 @@ class Surge
|
|||||||
$config = str_replace('$subs_domain', $subsDomain, $config);
|
$config = str_replace('$subs_domain', $subsDomain, $config);
|
||||||
$config = str_replace('$proxies', $proxies, $config);
|
$config = str_replace('$proxies', $proxies, $config);
|
||||||
$config = str_replace('$proxy_group', rtrim($proxyGroup, ', '), $config);
|
$config = str_replace('$proxy_group', rtrim($proxyGroup, ', '), $config);
|
||||||
|
|
||||||
|
$upload = round($user['u'] / (1024*1024*1024), 2);
|
||||||
|
$download = round($user['d'] / (1024*1024*1024), 2);
|
||||||
|
$totalTraffic = round($user['transfer_enable'] / (1024*1024*1024), 2);
|
||||||
|
$expireDate = $user['expired_at'] === NULL ? '长期有效' : date('Y-m-d H:i:s', $user['expired_at']);
|
||||||
|
$subscribeInfo = "title=\"{$appName}订阅信息\", content=\"上传流量:{$upload}GB\\n下载流量:{$download}GB\\n已用总流量:{$totalTraffic}GB\\n到期时间:{$expireDate}\"";
|
||||||
|
$config = str_replace('$subscribe_info', $subscribeInfo, $config);
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ test-timeout = 5
|
|||||||
internet-test-url = http://bing.com
|
internet-test-url = http://bing.com
|
||||||
proxy-test-url = http://bing.com
|
proxy-test-url = http://bing.com
|
||||||
|
|
||||||
|
[Panel]
|
||||||
|
SubscribeInfo = $subscribe_info, style=info
|
||||||
|
|
||||||
# Surfboard 的服务器和策略组配置方式与 Surge 类似, 可以参考 Surge 的规则配置手册: https://manual.nssurge.com/
|
# Surfboard 的服务器和策略组配置方式与 Surge 类似, 可以参考 Surge 的规则配置手册: https://manual.nssurge.com/
|
||||||
|
|
||||||
[Proxy]
|
[Proxy]
|
||||||
|
@ -36,6 +36,9 @@ hide-crashlytics-request = true
|
|||||||
use-keyword-filter = false
|
use-keyword-filter = false
|
||||||
hide-udp = false
|
hide-udp = false
|
||||||
|
|
||||||
|
[Panel]
|
||||||
|
SubscribeInfo = $subscribe_info, style=info
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Surge 的几种策略配置规范,请参考 https://manual.nssurge.com/policy/proxy.html
|
# Surge 的几种策略配置规范,请参考 https://manual.nssurge.com/policy/proxy.html
|
||||||
# 不同的代理策略有*很多*可选参数,请参考上方连接的 Parameters 一段,根据需求自行添加参数。
|
# 不同的代理策略有*很多*可选参数,请参考上方连接的 Parameters 一段,根据需求自行添加参数。
|
||||||
|
Loading…
Reference in New Issue
Block a user