用户仪表盘显示设备在线数

This commit is contained in:
wyx2685 2023-10-19 02:38:16 +09:00
parent 24209b8ac1
commit 0c9aab2236
No known key found for this signature in database
GPG Key ID: 8827A30FF1DB1379
6 changed files with 30 additions and 4 deletions

View File

@ -153,6 +153,19 @@ class UserController extends Controller
abort(500, __('Subscription plan does not exist'));
}
}
//统计在线设备
$countalive = 0;
$ips_array = Cache::get('ALIVE_IP_USER_'. $request->user['id']);
if ($ips_array) {
foreach ($ips_array as $nodetypeid => $ip_array) {
foreach ($ip_array['aliveips'] as $ip) {
$countalive++;
}
}
}
$user['alive_ip'] = $countalive;
$user['subscribe_url'] = Helper::getSubscribeUrl("/api/v1/client/subscribe?token={$user['token']}");
$userService = new UserService();
$user['reset_day'] = $userService->getResetDay($user);

View File

@ -144,6 +144,7 @@ window.settings.i18n['en-US'] = {
'该订阅长期有效': 'The subscription is valid for an unlimited time',
'已过期': 'Expired',
'已用 {used} / 总计 {total}': '{used} Used / Total {total}',
'在线设备 {alive_ip}/{device_limit}': 'Online {alive_ip}/{device_limit} Device',
'重置订阅信息': 'Reset Subscription',
'没有可用节点,如果您未订阅或已过期请': 'No access points are available. If you have not subscribed or the subscription has expired, please',
'订阅': 'Subscription',
@ -274,4 +275,4 @@ window.settings.i18n['en-US'] = {
'三级分销比例': 'Three-level Distribution Ratio',
'累计获得佣金': 'Cumulative commission earned',
'您邀请的用户再次邀请用户将按照订单金额乘以分销等级的比例进行分成。': 'The users you invite to re-invite users will be divided according to the order amount multiplied by the distribution level.'
};
};

View File

@ -38,6 +38,7 @@ window.settings.i18n['ja-JP'] = {
'该订阅长期有效': '時間制限なし',
'已过期': '期限切れ',
'已用 {used} / 总计 {total}': '使用済み {used} / 合計 {total}',
'在线设备 {alive_ip}/{device_limit}': 'オンラインデバイス {alive_ip}/{device_limit}',
'查看订阅': 'プランを表示',
'邮箱': 'E-mail アドレス',
'邮箱验证码': '確認コード',
@ -274,4 +275,4 @@ window.settings.i18n['ja-JP'] = {
'三级分销比例': '3ティア比率',
'累计获得佣金': '累計獲得コミッション金額',
'您邀请的用户再次邀请用户将按照订单金额乘以分销等级的比例进行分成。': 'お客様に招待された方が更に別の方を招待された場合、お客様は支払われるオーダーからティア分配分の比率分を受け取ることができます。'
};
};

View File

@ -144,6 +144,7 @@ window.settings.i18n['zh-CN'] = {
'该订阅长期有效': '该订阅长期有效',
'已过期': '已过期',
'已用 {used} / 总计 {total}': '已用 {used} / 总计 {total}',
'在线设备 {alive_ip}/{device_limit}' : '在线设备 {alive_ip}/{device_limit}',
'重置订阅信息': '重置订阅信息',
'没有可用节点,如果您未订阅或已过期请': '没有可用节点,如果您未订阅或已过期请',
'订阅': '订阅',
@ -274,4 +275,4 @@ window.settings.i18n['zh-CN'] = {
'三级分销比例': '三级分销比例',
'累计获得佣金': '累计获得佣金',
'您邀请的用户再次邀请用户将按照订单金额乘以分销等级的比例进行分成。': '您邀请的用户再次邀请用户将按照订单金额乘以分销等级的比例进行分成。'
};
};

View File

@ -38,6 +38,7 @@ window.settings.i18n['zh-TW'] = {
'该订阅长期有效': '該訂閱長期有效',
'已过期': '已過期',
'已用 {used} / 总计 {total}': '已用 {used} / 總計 {total}',
'在线设备 {alive_ip}/{device_limit}': '在線設備 {alive_ip}/{device_limit}',
'查看订阅': '查看訂閱',
'邮箱': '郵箱',
'邮箱验证码': '郵箱驗證碼',
@ -274,4 +275,4 @@ window.settings.i18n['zh-TW'] = {
'三级分销比例': '三级分销比例',
'累计获得佣金': '累计获得佣金',
'您邀请的用户再次邀请用户将按照订单金额乘以分销等级的比例进行分成。': '您邀请的用户再次邀请用户将按照订单金额乘以分销等级的比例进行分成。'
};
};

View File

@ -30872,6 +30872,15 @@
}, {
used: Object(p["b"])(d.u + d.d),
total: Object(p["b"])(d.transfer_enable)
})),l.a.createElement("span",{
className: "font-w700"
}," "), l.a.createElement("span", {
className: "font-w700"
}, Object(b["formatMessage"])({
id: "\u5728\u7ebf\u8bbe\u5907 {alive_ip}/{device_limit}"
}, {
alive_ip: d.alive_ip,
device_limit: d.device_limit == null ? "-" : d.device_limit
})))), y >= 80 && !Object(p["h"])(d.expired_at) && (null === d || void 0 === d ? void 0 : null === (e = d.plan) || void 0 === e ? void 0 : e.reset_price) && l.a.createElement("div", {
className: "mb-4"
}, l.a.createElement(i["a"], {