feat(db,admin): Add logo URL support and refactor bot schema with owner relationships

- Add logo_url column to nodes table for custom branding
- Refactor bots table to use owner_id foreign key relationship with users
- Add is_bot and bot_owner_id columns to users table for bot account tracking
- Add bot_id foreign key to posts table for bot-generated content tracking
- Create database indexes on owner_id, bot_id, is_bot, and bot_owner_id for query performance
- Remove bot handle, bio, avatar_url, and cryptographic keys from bots table (moved to user accounts)
- Update bot_content_sources schema and remove fetch_interval_minutes column
- Fix bot_content_items foreign key constraint with set null on delete
- Remove hardcoded NODE_NAME and NODE_DESCRIPTION from environment configuration
- Update admin panel, bot settings, and layout components to support new schema
- Add AccentColorContext and ToastContext for improved UI state management
- Update PostCard, Sidebar, RightSidebar, and LayoutWrapper components for context integration
This commit is contained in:
AskIt
2026-01-25 20:15:35 +01:00
parent d36c1c93e5
commit b9316552c2
16 changed files with 3386 additions and 61 deletions
+18 -1
View File
@@ -1,5 +1,6 @@
'use client';
import { useState, useEffect } from 'react';
import Link from 'next/link';
import Image from 'next/image';
import { usePathname } from 'next/navigation';
@@ -10,6 +11,18 @@ import { formatFullHandle } from '@/lib/utils/handle';
export function Sidebar() {
const { user, isAdmin } = useAuth();
const pathname = usePathname();
const [customLogoUrl, setCustomLogoUrl] = useState<string | null>(null);
useEffect(() => {
fetch('/api/node')
.then(res => res.json())
.then(data => {
if (data.logoUrl) {
setCustomLogoUrl(data.logoUrl);
}
})
.catch(() => {});
}, []);
// Home is exact match
const isHome = pathname === '/';
@@ -17,7 +30,11 @@ export function Sidebar() {
return (
<aside className="sidebar">
<Link href="/" className="logo">
<Image src="/logotext.png" alt="Synapsis" width={185} height={42} priority />
{customLogoUrl ? (
<img src={customLogoUrl} alt="Logo" style={{ maxWidth: '200px', maxHeight: '50px', objectFit: 'contain' }} />
) : (
<Image src="/logotext.png" alt="Synapsis" width={185} height={42} priority />
)}
</Link>
<nav>
<Link href="/" className={`nav-item ${isHome ? 'active' : ''}`}>