metrics adn insihigts

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-15 06:51:14 +00:00
parent cff00f87ff
commit c61cf7c39f
21 changed files with 749 additions and 129 deletions

View File

@@ -420,28 +420,32 @@ export const createClustersPageConfig = (
],
headerMetrics: [
{
label: 'Total Clusters',
label: 'Clusters',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.totalCount || 0,
tooltip: 'Topic clusters organizing your keywords. Each cluster should have 3-7 related keywords.',
},
{
label: 'Active',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.clusters.filter((c: Cluster) => c.status === 'active').length,
},
{
label: 'Total Keywords',
label: 'New',
value: 0,
accentColor: 'amber' as const,
calculate: (data) => data.clusters.reduce((sum: number, c: Cluster) => sum + (c.keywords_count || 0), 0),
calculate: (data) => data.clusters.filter((c: Cluster) => (c.ideas_count || 0) === 0).length,
tooltip: 'Clusters without content ideas yet. Generate ideas for these clusters to move them into the pipeline.',
},
{
label: 'Total Volume',
label: 'Keywords',
value: 0,
accentColor: 'purple' as const,
calculate: (data) => data.clusters.reduce((sum: number, c: Cluster) => sum + (c.keywords_count || 0), 0),
tooltip: 'Total keywords organized across all clusters. More keywords = better topic coverage.',
},
{
label: 'Volume',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.clusters.reduce((sum: number, c: Cluster) => sum + (c.volume || 0), 0),
tooltip: 'Combined search volume across all clusters. Prioritize high-volume clusters for maximum traffic.',
},
],
};

View File

@@ -440,22 +440,32 @@ export const createContentPageConfig = (
],
headerMetrics: [
{
label: 'Total Content',
label: 'Content',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.totalCount || 0,
tooltip: 'Total content pieces generated. Includes drafts, review, and published content.',
},
{
label: 'Draft',
value: 0,
accentColor: 'amber' as const,
calculate: (data) => data.content.filter((c: Content) => c.status === 'draft').length,
tooltip: 'Content in draft stage. Edit and refine before moving to review.',
},
{
label: 'In Review',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.content.filter((c: Content) => c.status === 'review').length,
tooltip: 'Content awaiting review and approval. Review for quality before publishing.',
},
{
label: 'Published',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.content.filter((c: Content) => c.status === 'published').length,
tooltip: 'Published content ready for WordPress sync. Track your published library.',
},
],
};

View File

@@ -387,28 +387,32 @@ export const createIdeasPageConfig = (
],
headerMetrics: [
{
label: 'Total Ideas',
label: 'Ideas',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.totalCount || 0,
tooltip: 'Total content ideas generated. Ideas become tasks in the content queue for writing.',
},
{
label: 'New',
value: 0,
accentColor: 'amber' as const,
calculate: (data) => data.ideas.filter((i: ContentIdea) => i.status === 'new').length,
tooltip: 'New ideas waiting for review. Approve ideas to queue them for content creation.',
},
{
label: 'Queued',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.ideas.filter((i: ContentIdea) => i.status === 'queued').length,
tooltip: 'Ideas queued for content generation. These will be converted to writing tasks automatically.',
},
{
label: 'Completed',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.ideas.filter((i: ContentIdea) => i.status === 'published').length,
calculate: (data) => data.ideas.filter((i: ContentIdea) => i.status === 'completed').length,
tooltip: 'Ideas that have been successfully turned into content. Track your content creation progress.',
},
],
};

View File

@@ -217,28 +217,32 @@ export const createImagesPageConfig = (
],
headerMetrics: [
{
label: 'Total Content',
label: 'Content',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.totalCount || 0,
tooltip: 'Total content pieces with image generation. Track image coverage across all content.',
},
{
label: 'Complete',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.images.filter((i: ContentImagesGroup) => i.overall_status === 'complete').length,
tooltip: 'Content with all images generated. Ready for publishing with full visual coverage.',
},
{
label: 'Partial',
value: 0,
accentColor: 'info' as const,
accentColor: 'blue' as const,
calculate: (data) => data.images.filter((i: ContentImagesGroup) => i.overall_status === 'partial').length,
tooltip: 'Content with some images missing. Generate remaining images to complete visual assets.',
},
{
label: 'Pending',
value: 0,
accentColor: 'amber' as const,
calculate: (data) => data.images.filter((i: ContentImagesGroup) => i.overall_status === 'pending').length,
tooltip: 'Content waiting for image generation. Queue these to start creating visual assets.',
},
],
maxInArticleImages: maxImages,

View File

@@ -476,28 +476,32 @@ export const createKeywordsPageConfig = (
],
headerMetrics: [
{
label: 'Total Keywords',
label: 'Keywords',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.totalCount || 0,
tooltip: 'Total keywords added to site wrokflow. Minimum 5 Keywords are needed for clustering.',
},
{
label: 'Mapped',
label: 'Clustered',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.keywords.filter((k: Keyword) => k.cluster_id).length,
tooltip: 'Keywords grouped into topical clusters. Clustered keywords are ready for content ideation.',
},
{
label: 'Unmapped',
value: 0,
accentColor: 'amber' as const,
calculate: (data) => data.keywords.filter((k: Keyword) => !k.cluster_id).length,
tooltip: 'Unclustered keywords waiting to be organized. Select keywords and use Auto-Cluster to group them.',
},
{
label: 'Total Volume',
label: 'Volume',
value: 0,
accentColor: 'purple' as const,
calculate: (data) => data.keywords.reduce((sum: number, k: Keyword) => sum + (k.volume || 0), 0),
tooltip: 'Total monthly search volume across all keywords. Higher volume = more traffic potential.',
},
],
// bulkActions and rowActions are now global - defined in table-actions.config.ts

View File

@@ -305,15 +305,38 @@ export function createPublishedPageConfig(params: {
const headerMetrics: HeaderMetricConfig[] = [
{
label: 'Total Published',
label: 'Published',
accentColor: 'green',
calculate: (data: { totalCount: number }) => data.totalCount,
tooltip: 'Total published content. Track your complete content library.',
},
{
label: 'On WordPress',
label: 'Synced',
accentColor: 'blue',
calculate: (data: { content: Content[] }) =>
data.content.filter(c => c.external_id).length,
tooltip: 'Content synced to WordPress. Successfully published on your website.',
},
{
label: 'This Month',
accentColor: 'purple',
calculate: (data: { content: Content[] }) => {
const now = new Date();
const thisMonth = now.getMonth();
const thisYear = now.getFullYear();
return data.content.filter(c => {
const date = new Date(c.created_at);
return date.getMonth() === thisMonth && date.getFullYear() === thisYear;
}).length;
},
tooltip: 'Content published this month. Track your monthly publishing velocity.',
},
{
label: 'Pending Sync',
accentColor: 'amber',
calculate: (data: { content: Content[] }) =>
data.content.filter(c => !c.external_id).length,
tooltip: 'Published content not yet synced to WordPress. Sync these to make them live.',
},
];

View File

@@ -262,19 +262,28 @@ export function createReviewPageConfig(params: {
],
headerMetrics: [
{
label: 'Total Ready',
label: 'Ready',
accentColor: 'blue',
calculate: ({ totalCount }) => totalCount,
tooltip: 'Content ready for final review. Review quality, SEO, and images before publishing.',
},
{
label: 'Has Images',
label: 'Images',
accentColor: 'green',
calculate: ({ content }) => content.filter(c => c.has_generated_images).length,
tooltip: 'Content with generated images. Visual assets complete and ready for review.',
},
{
label: 'Optimized',
accentColor: 'purple',
calculate: ({ content }) => content.filter(c => (c as any).optimization_score >= 80).length,
calculate: ({ content }) => content.filter(c => c.optimization_scores && c.optimization_scores.overall_score >= 80).length,
tooltip: 'Content with high SEO optimization scores (80%+). Well-optimized for search engines.',
},
{
label: 'Sync Ready',
accentColor: 'amber',
calculate: ({ content }) => content.filter(c => c.has_generated_images && c.optimization_scores && c.optimization_scores.overall_score >= 70).length,
tooltip: 'Content ready for WordPress sync. Has images and good optimization score.',
},
],
};

View File

@@ -454,22 +454,39 @@ export const createTasksPageConfig = (
],
headerMetrics: [
{
label: 'Total Tasks',
label: 'Tasks',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.totalCount || 0,
tooltip: 'Total content generation tasks. Tasks process ideas into written content automatically.',
},
{
label: 'Queued',
label: 'In Queue',
value: 0,
accentColor: 'amber' as const,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'queued').length,
tooltip: 'Tasks queued for processing. These will be picked up by the content generation system.',
},
{
label: 'Processing',
value: 0,
accentColor: 'blue' as const,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'in_progress').length,
tooltip: 'Tasks currently being processed. Content is being generated by AI right now.',
},
{
label: 'Completed',
value: 0,
accentColor: 'green' as const,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'completed').length,
tooltip: 'Successfully completed tasks. Generated content is ready for review and publishing.',
},
{
label: 'Failed',
value: 0,
accentColor: 'red' as const,
calculate: (data) => data.tasks.filter((t: Task) => t.status === 'failed').length,
tooltip: 'Failed tasks that need attention. Review error logs and retry or modify the task.',
},
],
};