mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-03 10:59:34 +00:00
feat(clients): show last-online tooltip on the depleted tag too
The Online column already surfaced last-online on the offline tag; extend the same tooltip to the depleted (ended) tag so a depleted client's last activity is visible without enabling it.
This commit is contained in:
@@ -627,15 +627,20 @@ export default function ClientsPage() {
|
||||
width: 90,
|
||||
render: (_v, record) => {
|
||||
const bucket = clientBucket(record);
|
||||
if (bucket === 'depleted') return <Tag color="red">{t('depleted')}</Tag>;
|
||||
const lastOnline = record.traffic?.lastOnline ?? 0;
|
||||
const lastOnlineTitle = `${t('lastOnline')}: ${lastOnline > 0 ? IntlUtil.formatDate(lastOnline, datepicker) : '-'}`;
|
||||
if (bucket === 'depleted') return (
|
||||
<Tooltip title={lastOnlineTitle}>
|
||||
<Tag color="red">{t('depleted')}</Tag>
|
||||
</Tooltip>
|
||||
);
|
||||
if (record.enable && isOnline(record.email)) return (
|
||||
<Tag color="green"><span className="online-dot" />{t('pages.clients.online')}</Tag>
|
||||
);
|
||||
if (!record.enable) return <Tag>{t('disabled')}</Tag>;
|
||||
if (bucket === 'expiring') return <Tag color="orange">{t('depletingSoon')}</Tag>;
|
||||
const lastOnline = record.traffic?.lastOnline ?? 0;
|
||||
return (
|
||||
<Tooltip title={`${t('lastOnline')}: ${lastOnline > 0 ? IntlUtil.formatDate(lastOnline, datepicker) : '-'}`}>
|
||||
<Tooltip title={lastOnlineTitle}>
|
||||
<Tag>{t('pages.clients.offline')}</Tag>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user