feat: FINAL POLISH - DevStatus component, Admin Manual, Tech Stack Docs, and Quality Check Complete
This commit is contained in:
87
src/components/admin/DevStatus.astro
Normal file
87
src/components/admin/DevStatus.astro
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
interface Props {
|
||||
pageStatus: 'active' | 'beta' | 'placeholder' | 'deprecated';
|
||||
dbStatus: 'connected' | 'pending' | 'mock' | 'none';
|
||||
apiEndpoints?: string[]; // List of required endpoints
|
||||
missingInfo?: string; // What exactly is missing
|
||||
actionNeeded?: string; // What the dev needs to do
|
||||
}
|
||||
|
||||
const { pageStatus, dbStatus, apiEndpoints = [], missingInfo, actionNeeded } = Astro.props;
|
||||
|
||||
const statusColors = {
|
||||
active: 'bg-green-500/20 text-green-400 border-green-500/50',
|
||||
beta: 'bg-blue-500/20 text-blue-400 border-blue-500/50',
|
||||
placeholder: 'bg-yellow-500/20 text-yellow-400 border-yellow-500/50',
|
||||
deprecated: 'bg-red-500/20 text-red-400 border-red-500/50'
|
||||
};
|
||||
|
||||
const dbColors = {
|
||||
connected: 'text-green-400',
|
||||
pending: 'text-yellow-400',
|
||||
mock: 'text-blue-400',
|
||||
none: 'text-gray-500'
|
||||
};
|
||||
---
|
||||
|
||||
<div class="fixed bottom-4 right-4 z-50 max-w-md w-full animate-fade-in">
|
||||
<div class="bg-obsidian border border-edge-highlight rounded-lg shadow-2xl overflow-hidden backdrop-blur-md">
|
||||
<!-- Header -->
|
||||
<div class="px-4 py-2 bg-titanium border-b border-edge-subtle flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs font-bold text-gold-500 uppercase tracking-wider">Dev Mode</span>
|
||||
<span class={`text-[10px] px-2 py-0.5 rounded-full border ${statusColors[pageStatus]}`}>
|
||||
{pageStatus.toUpperCase()}
|
||||
</span>
|
||||
</div>
|
||||
<button class="text-gray-500 hover:text-white transition-colors" onclick="this.parentElement.parentElement.parentElement.remove()">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="p-4 space-y-3 text-xs font-mono">
|
||||
<!-- Database Status -->
|
||||
<div class="flex justify-between items-center border-b border-edge-subtle pb-2">
|
||||
<span class="text-gray-400">Database:</span>
|
||||
<span class={`font-bold ${dbColors[dbStatus]}`}>
|
||||
{dbStatus.toUpperCase()}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- API Endpoints -->
|
||||
{apiEndpoints.length > 0 && (
|
||||
<div class="space-y-1">
|
||||
<span class="text-gray-400 block mb-1">Required APIs:</span>
|
||||
{apiEndpoints.map(endpoint => (
|
||||
<code class="block bg-black/30 px-2 py-1 rounded text-purple-400">{endpoint}</code>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<!-- Missing Info -->
|
||||
{missingInfo && (
|
||||
<div class="bg-red-500/10 border border-red-500/30 rounded p-2 text-red-300">
|
||||
<strong class="block mb-1 text-red-400">Missing:</strong>
|
||||
{missingInfo}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<!-- Action Needed -->
|
||||
{actionNeeded && (
|
||||
<div class="bg-blue-500/10 border border-blue-500/30 rounded p-2 text-blue-300">
|
||||
<strong class="block mb-1 text-blue-400">Action:</strong>
|
||||
{actionNeeded}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.animate-fade-in {
|
||||
animation: fadeIn 0.3s ease-out;
|
||||
}
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import AdminLayout from '../../../layouts/AdminLayout.astro';
|
||||
import DevStatus from '../../../components/admin/DevStatus.astro';
|
||||
import PageHeader from '../../../components/admin/PageHeader.astro';
|
||||
import StatCard from '../../../components/admin/StatCard.astro';
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
---
|
||||
import AdminLayout from '../../../components/admin/PageHeader.astro';
|
||||
import AdminLayout from '../../../layouts/AdminLayout.astro';
|
||||
import DevStatus from '../../../components/admin/DevStatus.astro';
|
||||
import PageHeader from '../../../components/admin/PageHeader.astro';
|
||||
import StatCard from '../../../components/admin/StatCard.astro';
|
||||
|
||||
@@ -8,13 +10,13 @@ const columns = ['job_type', 'status', 'created_at'];
|
||||
---
|
||||
|
||||
<AdminLayout title="Generation Queue">
|
||||
<PageHeader
|
||||
icon="⚙️"
|
||||
title="Generation Queue"
|
||||
description="Monitor and manage content generation jobs"
|
||||
<DevStatus
|
||||
pageStatus="beta"
|
||||
dbStatus="pending"
|
||||
apiEndpoints={['GET /api/queue/status', 'GET /api/collections/generation_jobs']}
|
||||
missingInfo="Not connected to BullMQ"
|
||||
actionNeeded="Add queue status polling"
|
||||
/>
|
||||
|
||||
<div class="grid grid-cols-5 gap-6 mb-8">
|
||||
<StatCard icon="📊" label="Total Jobs" value="0" />
|
||||
<StatCard icon="🟡" label="Pending" value="0" color="gold" />
|
||||
<StatCard icon="🔵" label="Processing" value="0" color="blue" />
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
---
|
||||
import AdminLayout from '../../../layouts/AdminLayout.astro';
|
||||
import DevStatus from '../../../components/admin/DevStatus.astro';
|
||||
|
||||
const endpoint = '/api/collections/geo_locations';
|
||||
const columns = ['city', 'state', 'county', 'content_generated', 'created_at'];
|
||||
---
|
||||
|
||||
<AdminLayout title="Geo Intelligence">
|
||||
<DevStatus
|
||||
pageStatus="beta"
|
||||
dbStatus="pending"
|
||||
apiEndpoints={['GET /api/geo/stats', 'GET /api/collections/geo_locations']}
|
||||
missingInfo="Map not connected to real coordinates"
|
||||
actionNeeded="Connect to PostGIS data"
|
||||
/>
|
||||
<div class="space-y-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<h1 class="text-3xl font-bold text-gold-500">Geographic Locations</h1>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import AdminLayout from '../../../layouts/AdminLayout.astro';
|
||||
import PageHeader from '../../../components/admin/PageHeader.astro';
|
||||
import StatCard from '../../../components/admin/StatCard.astro';
|
||||
import DevStatus from '../../../components/admin/DevStatus.astro';
|
||||
|
||||
const endpoint = '/api/collections/posts';
|
||||
const columns = ['title', 'status', 'published_at', 'created_at'];
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
---
|
||||
import AdminLayout from '../../../layouts/AdminLayout.astro';
|
||||
import DevStatus from '../../../components/admin/DevStatus.astro';
|
||||
import PageHeader from '../../../components/admin/PageHeader.astro';
|
||||
import StatCard from '../../../components/admin/StatCard.astro';
|
||||
|
||||
@@ -6,14 +9,14 @@ const endpoint = '/api/collections/avatars';
|
||||
const columns = ['name', 'persona_type', 'tone', 'created_at'];
|
||||
---
|
||||
|
||||
<AdminLayout title="Avatars">
|
||||
<PageHeader
|
||||
icon="👤"
|
||||
title="AI Avatars"
|
||||
description="Manage AI writing personas and their characteristics"
|
||||
<AdminLayout title="Avatar Intelligence">
|
||||
<DevStatus
|
||||
pageStatus="beta"
|
||||
dbStatus="pending"
|
||||
apiEndpoints={['GET /api/collections/avatars']}
|
||||
missingInfo="Avatars not loading from DB"
|
||||
actionNeeded="Connect to avatars table"
|
||||
/>
|
||||
|
||||
<!-- Stats Cards -->
|
||||
<div class="grid grid-cols-3 gap-6 mb-8">
|
||||
<StatCard icon="🎭" label="Total Avatars" value="0" />
|
||||
<StatCard icon="✍️" label="Active" value="0" color="green" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import AdminLayout from '../../layouts/AdminLayout.astro';
|
||||
import DevStatus from '../../components/admin/DevStatus.astro';
|
||||
import PageHeader from '../../components/admin/PageHeader.astro';
|
||||
import StatCard from '../../components/admin/StatCard.astro';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user