mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +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:
parent
88a3677318
commit
cfd3b34362
1 changed files with 8 additions and 3 deletions
|
|
@ -627,15 +627,20 @@ export default function ClientsPage() {
|
||||||
width: 90,
|
width: 90,
|
||||||
render: (_v, record) => {
|
render: (_v, record) => {
|
||||||
const bucket = clientBucket(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 (
|
if (record.enable && isOnline(record.email)) return (
|
||||||
<Tag color="green"><span className="online-dot" />{t('pages.clients.online')}</Tag>
|
<Tag color="green"><span className="online-dot" />{t('pages.clients.online')}</Tag>
|
||||||
);
|
);
|
||||||
if (!record.enable) return <Tag>{t('disabled')}</Tag>;
|
if (!record.enable) return <Tag>{t('disabled')}</Tag>;
|
||||||
if (bucket === 'expiring') return <Tag color="orange">{t('depletingSoon')}</Tag>;
|
if (bucket === 'expiring') return <Tag color="orange">{t('depletingSoon')}</Tag>;
|
||||||
const lastOnline = record.traffic?.lastOnline ?? 0;
|
|
||||||
return (
|
return (
|
||||||
<Tooltip title={`${t('lastOnline')}: ${lastOnline > 0 ? IntlUtil.formatDate(lastOnline, datepicker) : '-'}`}>
|
<Tooltip title={lastOnlineTitle}>
|
||||||
<Tag>{t('pages.clients.offline')}</Tag>
|
<Tag>{t('pages.clients.offline')}</Tag>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue