feat: show user vpn connection activity

This commit is contained in:
3252a8
2026-06-05 16:14:34 +03:00
parent 4cbd4dedf5
commit 6890b58ced
6 changed files with 172 additions and 3 deletions
@@ -90,6 +90,17 @@
return at("user_hwid_limit_count", { count: base }, `${base}`);
}
function vpnLastConnectionLabel(detail) {
const connectedAt = detail?.last_vpn_connected_at;
const status = detail?.vpn_connection_status;
if (connectedAt) return fmtDate(connectedAt);
if (status === "never") return at("user_vpn_never_connected", {}, "Никогда");
if (status === "connected") {
return at("user_vpn_connected_no_time", {}, "Подключался, время неизвестно");
}
return "—";
}
const usersStore = getContext("usersStore");
$: ({
@@ -274,6 +285,10 @@
>{fmtDate(openedUser.registration_date)}</strong
>
</li>
<li>
<span>{at("user_label_vpn_last_connected", {}, "Последнее VPN-подключение")}</span
><strong>{vpnLastConnectionLabel(openedUserDetail)}</strong>
</li>
<li>
<span>{at("user_label_ref_code", {}, "Реф. код")}</span><strong
>{openedUserDetail.referral?.code ||