diff --git a/frontend/src/components/admin/content/CartesianManager.tsx b/frontend/src/components/admin/content/CartesianManager.tsx new file mode 100644 index 0000000..62143ea --- /dev/null +++ b/frontend/src/components/admin/content/CartesianManager.tsx @@ -0,0 +1,79 @@ +// @ts-nocheck +import React, { useState, useEffect } from 'react'; +import { getDirectusClient } from '@/lib/directus/client'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; + +export default function CartesianManager() { + const [patterns, setPatterns] = useState([]); + const [loading, setLoading] = useState(true); + + useEffect(() => { + loadData(); + }, []); + + const loadData = async () => { + try { + const directus = await getDirectusClient(); + const response = await directus.request({ + method: 'GET', + path: '/items/cartesian_patterns' + }); + setPatterns(response.data || []); + setLoading(false); + } catch (error) { + console.error('Error loading cartesian patterns:', error); + setLoading(false); + } + }; + + if (loading) { + return
Loading Cartesian Patterns...
; + } + + return ( +
+
+ {patterns.map((group) => ( + + + + {group.pattern_key.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase())} + + {group.pattern_type} + + + + +
+ {(group.data || []).map((pattern, i) => ( +
+
+ + {pattern.id} + +
+
+
+
Formula
+ + {pattern.formula} + +
+
+
Example Output
+
+ "{pattern.example_output}" +
+
+
+
+ ))} +
+
+
+ ))} +
+
+ ); +} diff --git a/frontend/src/components/admin/content/GeoManager.tsx b/frontend/src/components/admin/content/GeoManager.tsx new file mode 100644 index 0000000..25e3f35 --- /dev/null +++ b/frontend/src/components/admin/content/GeoManager.tsx @@ -0,0 +1,78 @@ +// @ts-nocheck +import React, { useState, useEffect } from 'react'; +import { getDirectusClient } from '@/lib/directus/client'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; + +export default function GeoManager() { + const [clusters, setClusters] = useState([]); + const [loading, setLoading] = useState(true); + + useEffect(() => { + loadData(); + }, []); + + const loadData = async () => { + try { + const directus = await getDirectusClient(); + const response = await directus.request({ + method: 'GET', + path: '/items/geo_intelligence' + }); + setClusters(response.data || []); + setLoading(false); + } catch (error) { + console.error('Error loading geo clusters:', error); + setLoading(false); + } + }; + + if (loading) { + return
Loading Geo Intelligence...
; + } + + return ( +
+
+ {clusters.map((cluster) => ( + + + + {cluster.data?.cluster_name || cluster.cluster_key} + + + {cluster.cluster_key} + + + +
+
+
Target Cities
+
+ {(cluster.data?.cities || []).map((city, i) => ( +
+ + {city.city}, {city.state} + + {city.neighborhood && ( + + {city.neighborhood} + + )} + {city.zip_focus && ( + + {city.zip_focus} + + )} +
+ ))} +
+
+
+
+
+ ))} +
+
+ ); +} diff --git a/frontend/src/components/admin/content/LogViewer.tsx b/frontend/src/components/admin/content/LogViewer.tsx new file mode 100644 index 0000000..d20e6e6 --- /dev/null +++ b/frontend/src/components/admin/content/LogViewer.tsx @@ -0,0 +1,92 @@ +// @ts-nocheck +import React, { useState, useEffect } from 'react'; +import { getDirectusClient } from '@/lib/directus/client'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'; + +export default function LogViewer() { + const [logs, setLogs] = useState([]); + const [loading, setLoading] = useState(true); + + useEffect(() => { + loadLogs(); + }, []); + + const loadLogs = async () => { + try { + const directus = await getDirectusClient(); + const response = await directus.request({ + method: 'GET', + path: '/activity', + params: { + limit: 50, + sort: '-timestamp' + } + }); + setLogs(response.data || []); + setLoading(false); + } catch (error) { + console.error('Error loading logs:', error); + setLoading(false); + } + }; + + if (loading) { + return
Loading System Logs...
; + } + + return ( + + + + Recent Activity + + Last 50 Events + + + + +
+ + + + Action + Collection + Timestamp + User/IP + + + + {logs.map((log) => ( + + + + {log.action} + + + + {log.collection} + + + {new Date(log.timestamp).toLocaleString()} + + +
{log.ip}
+
+
+ ))} +
+
+
+
+
+ ); +} diff --git a/frontend/src/components/admin/content/SpintaxManager.tsx b/frontend/src/components/admin/content/SpintaxManager.tsx new file mode 100644 index 0000000..d144f08 --- /dev/null +++ b/frontend/src/components/admin/content/SpintaxManager.tsx @@ -0,0 +1,61 @@ +// @ts-nocheck +import React, { useState, useEffect } from 'react'; +import { getDirectusClient } from '@/lib/directus/client'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; + +export default function SpintaxManager() { + const [dictionaries, setDictionaries] = useState([]); + const [loading, setLoading] = useState(true); + + useEffect(() => { + loadData(); + }, []); + + const loadData = async () => { + try { + const directus = await getDirectusClient(); + const response = await directus.request({ + method: 'GET', + path: '/items/spintax_dictionaries' + }); + setDictionaries(response.data || []); + setLoading(false); + } catch (error) { + console.error('Error loading spintax dictionaries:', error); + setLoading(false); + } + }; + + if (loading) { + return
Loading Spintax Dictionaries...
; + } + + return ( +
+
+ {dictionaries.map((dict) => ( + + + + {dict.category} + + {(dict.data || []).length} Terms + + + + +
+ {(dict.data || []).map((term, i) => ( + + {term} + + ))} +
+
+
+ ))} +
+
+ ); +} diff --git a/frontend/src/pages/admin/content/cartesian_patterns.astro b/frontend/src/pages/admin/content/cartesian_patterns.astro index 7850020..301c5b6 100644 --- a/frontend/src/pages/admin/content/cartesian_patterns.astro +++ b/frontend/src/pages/admin/content/cartesian_patterns.astro @@ -1,13 +1,14 @@ --- import Layout from '@/layouts/AdminLayout.astro'; +import CartesianManager from '@/components/admin/content/CartesianManager'; ---
-

Cartesian Patterns

-

Headline and Hook Formulas.

-
-

🚧 Intelligence Station Under Construction

+
+

Cartesian Patterns

+

Headline and Hook Formulas for the Multiplication Engine.

+
diff --git a/frontend/src/pages/admin/content/geo_clusters.astro b/frontend/src/pages/admin/content/geo_clusters.astro index c110959..f749184 100644 --- a/frontend/src/pages/admin/content/geo_clusters.astro +++ b/frontend/src/pages/admin/content/geo_clusters.astro @@ -1,13 +1,14 @@ --- import Layout from '@/layouts/AdminLayout.astro'; +import GeoManager from '@/components/admin/content/GeoManager'; ---
-

Geo Clusters

-

Manage Geographic Intelligence (Silicon Valleys, Growth Havens).

-
-

🚧 Intelligence Station Under Construction

+
+

Geo Clusters

+

Manage Geographic Intelligence (Silicon Valleys, Growth Havens) for localized content.

+
diff --git a/frontend/src/pages/admin/content/spintax_dictionaries.astro b/frontend/src/pages/admin/content/spintax_dictionaries.astro index e4e09bf..7275b6c 100644 --- a/frontend/src/pages/admin/content/spintax_dictionaries.astro +++ b/frontend/src/pages/admin/content/spintax_dictionaries.astro @@ -1,13 +1,14 @@ --- import Layout from '@/layouts/AdminLayout.astro'; +import SpintaxManager from '@/components/admin/content/SpintaxManager'; ---
-

Spintax Dictionaries

-

Global Search & Replace Dictionaries.

-
-

🚧 Intelligence Station Under Construction

+
+

Spintax Dictionaries

+

Global Search & Replace Dictionaries for content randomization.

+
diff --git a/frontend/src/pages/admin/content/work_log.astro b/frontend/src/pages/admin/content/work_log.astro index eb17fd3..c8b2192 100644 --- a/frontend/src/pages/admin/content/work_log.astro +++ b/frontend/src/pages/admin/content/work_log.astro @@ -1,13 +1,14 @@ --- import Layout from '@/layouts/AdminLayout.astro'; +import LogViewer from '@/components/admin/content/LogViewer'; ---
-

System Work Log

-

Backend Execution Logs.

-
-

🚧 Log Viewer Under Construction

+
+

System Work Log

+

Real-time backend execution and activity logs.

+