推送远程分支前的排查和修复代码
This commit is contained in:
22
src/app/admin/_components/addr.tsx
Normal file
22
src/app/admin/_components/addr.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import {Badge} from '@/components/ui/badge'
|
||||
import {Channel} from '@/lib/models'
|
||||
import {isBefore} from 'date-fns'
|
||||
|
||||
export default function Addr({channel}: {
|
||||
channel: Channel
|
||||
}) {
|
||||
const ip = channel.host
|
||||
const port = channel.port
|
||||
const expired = isBefore(channel.expired_at, new Date())
|
||||
|
||||
return (
|
||||
<div className={`${expired ? 'text-weak' : ''}`}>
|
||||
<span>{ip}:{port}</span>
|
||||
{expired && (
|
||||
<Badge variant="secondary">
|
||||
已过期
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user