Move admins into the node details card and exclude cached remote profiles from swarm user totals.
Hop-State: A_06FPDF36J60G1A7815FZXV8 Hop-Proposal: R_06FPDF2DBS4W91EHS4C1HHR Hop-Task: T_06FPDE1JPYKVAHGNQWNSMER Hop-Attempt: AT_06FPDE1JPWKP9WRN6NFR3A0
This commit is contained in:
@@ -173,6 +173,35 @@ export function RightSidebar() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{nodeInfo.admins.length > 0 && (
|
||||||
|
<div style={{ marginTop: '16px', paddingTop: '16px', borderTop: '1px solid var(--border-hover)' }}>
|
||||||
|
<h4 style={{ fontSize: '11px', fontWeight: 700, textTransform: 'uppercase', color: 'var(--foreground-tertiary)', marginBottom: '12px', letterSpacing: '0.05em' }}>
|
||||||
|
Admins
|
||||||
|
</h4>
|
||||||
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
||||||
|
{nodeInfo.admins.map((admin) => (
|
||||||
|
<Link
|
||||||
|
key={admin.handle}
|
||||||
|
href={`/u/${admin.handle}`}
|
||||||
|
style={{ display: 'flex', alignItems: 'center', gap: '10px', textDecoration: 'none', color: 'inherit' }}
|
||||||
|
>
|
||||||
|
<div className="avatar avatar-sm" style={{ flexShrink: 0 }}>
|
||||||
|
<AvatarImage avatarUrl={admin.avatarUrl} seed={admin.handle} isNsfw={admin.isNsfw} nodeIsNsfw={nodeInfo.isNsfw} alt={admin.displayName || admin.handle} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div style={{ fontWeight: 500, fontSize: '14px' }}>
|
||||||
|
{admin.displayName || admin.handle}
|
||||||
|
</div>
|
||||||
|
<div style={{ color: 'var(--foreground-tertiary)', fontSize: '12px' }}>
|
||||||
|
@{admin.handle}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -204,34 +233,6 @@ export function RightSidebar() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{nodeInfo.admins.length > 0 && (
|
|
||||||
<div style={{ marginTop: '16px', paddingTop: '16px', borderTop: '1px solid var(--border-hover)' }}>
|
|
||||||
<h4 style={{ fontSize: '11px', fontWeight: 700, textTransform: 'uppercase', color: 'var(--foreground-tertiary)', marginBottom: '12px', letterSpacing: '0.05em' }}>
|
|
||||||
Admins
|
|
||||||
</h4>
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
||||||
{nodeInfo.admins.map((admin) => (
|
|
||||||
<Link
|
|
||||||
key={admin.handle}
|
|
||||||
href={`/u/${admin.handle}`}
|
|
||||||
style={{ display: 'flex', alignItems: 'center', gap: '10px', textDecoration: 'none', color: 'inherit' }}
|
|
||||||
>
|
|
||||||
<div className="avatar avatar-sm" style={{ flexShrink: 0 }}>
|
|
||||||
<AvatarImage avatarUrl={admin.avatarUrl} seed={admin.handle} isNsfw={admin.isNsfw} nodeIsNsfw={nodeInfo.isNsfw} alt={admin.displayName || admin.handle} />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div style={{ fontWeight: 500, fontSize: '14px' }}>
|
|
||||||
{admin.displayName || admin.handle}
|
|
||||||
</div>
|
|
||||||
<div style={{ color: 'var(--foreground-tertiary)', fontSize: '12px' }}>
|
|
||||||
@{admin.handle}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ export async function buildAnnouncement(): Promise<SwarmAnnouncement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get counts
|
// Get counts
|
||||||
const userResult = await db.select({ count: sql<number>`count(*)` }).from(users);
|
const userResult = await db.select({ count: sql<number>`count(*)` })
|
||||||
|
.from(users)
|
||||||
|
.where(sql`${users.handle} NOT LIKE '%@%'`);
|
||||||
const postResult = await db.select({ count: sql<number>`count(*)` }).from(posts);
|
const postResult = await db.select({ count: sql<number>`count(*)` }).from(posts);
|
||||||
const mediaResult = await db.select({ count: sql<number>`count(*)` })
|
const mediaResult = await db.select({ count: sql<number>`count(*)` })
|
||||||
.from(media)
|
.from(media)
|
||||||
|
|||||||
@@ -361,7 +361,8 @@ export async function getSwarmStats() {
|
|||||||
const publicNodes = allNodes.filter(n => isPublicSwarmDomain(n.domain));
|
const publicNodes = allNodes.filter(n => isPublicSwarmDomain(n.domain));
|
||||||
|
|
||||||
const [localUsers, localPosts, localMedia] = await Promise.all([
|
const [localUsers, localPosts, localMedia] = await Promise.all([
|
||||||
db.select({ count: sql<number>`count(*)` }).from(users),
|
db.select({ count: sql<number>`count(*)` }).from(users)
|
||||||
|
.where(sql`${users.handle} NOT LIKE '%@%'`),
|
||||||
db.select({ count: sql<number>`count(*)` }).from(posts),
|
db.select({ count: sql<number>`count(*)` }).from(posts),
|
||||||
db.select({ count: sql<number>`count(*)` }).from(media).where(isNotNull(media.postId)),
|
db.select({ count: sql<number>`count(*)` }).from(media).where(isNotNull(media.postId)),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user