feat: add ip.im link for source IP in admin account list (#841)

This commit is contained in:
Dream Hunter
2026-02-25 13:59:53 +08:00
committed by GitHub
parent 566c6536d1
commit 723e1fe75d
2 changed files with 16 additions and 1 deletions

View File

@@ -323,7 +323,21 @@ const columns = [
},
{
title: t('source_meta'),
key: "source_meta"
key: "source_meta",
render(row) {
const val = row.source_meta;
if (!val) return '';
const ipv4Regex = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
const ipv6Regex = /^[0-9a-fA-F:]+$/;
if (ipv4Regex.test(val) || (val.includes(':') && ipv6Regex.test(val) && !val.startsWith('tg:'))) {
return h('a', {
href: `https://ip.im/${val}`,
target: '_blank',
rel: 'noopener noreferrer'
}, val);
}
return val;
}
},
{
title: t('mail_count'),