refactor: localize analytics metrics and overhaul UI components and dashboard layouts
This commit is contained in:
parent
acdc78f8bd
commit
3ae4a3653a
72 changed files with 953 additions and 833 deletions
|
|
@ -44,10 +44,10 @@ public function fetchPostMetrics(PostPlatform $postPlatform): array
|
|||
$post = data_get($response->json(), 'posts.0', []);
|
||||
|
||||
return [
|
||||
['label' => 'Likes', 'value' => data_get($post, 'likeCount', 0)],
|
||||
['label' => 'Reposts', 'value' => data_get($post, 'repostCount', 0)],
|
||||
['label' => 'Quotes', 'value' => data_get($post, 'quoteCount', 0)],
|
||||
['label' => 'Replies', 'value' => data_get($post, 'replyCount', 0)],
|
||||
['label' => __('analytics.metrics.likes'), 'value' => data_get($post, 'likeCount', 0)],
|
||||
['label' => __('analytics.metrics.reposts'), 'value' => data_get($post, 'repostCount', 0)],
|
||||
['label' => __('analytics.metrics.quotes'), 'value' => data_get($post, 'quoteCount', 0)],
|
||||
['label' => __('analytics.metrics.replies'), 'value' => data_get($post, 'replyCount', 0)],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,11 +106,11 @@ private function fetchMetricsFromApi(SocialAccount $account, CarbonInterface $si
|
|||
$total = collect($values)->sum('value');
|
||||
|
||||
$label = match ($name) {
|
||||
'page_total_media_view_unique' => 'Page Reach',
|
||||
'post_total_media_view_unique' => 'Posts Reach',
|
||||
'page_post_engagements' => 'Posts Engagement',
|
||||
'page_daily_follows' => 'Page Followers',
|
||||
'page_media_view' => 'Page Views',
|
||||
'page_total_media_view_unique' => __('analytics.metrics.page_reach'),
|
||||
'post_total_media_view_unique' => __('analytics.metrics.posts_reach'),
|
||||
'page_post_engagements' => __('analytics.metrics.posts_engagement'),
|
||||
'page_daily_follows' => __('analytics.metrics.page_followers'),
|
||||
'page_media_view' => __('analytics.metrics.page_views'),
|
||||
default => ucfirst(str_replace('_', ' ', $name)),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@ private function fetchTimeSeriesMetrics(SocialAccount $account, CarbonInterface
|
|||
$total = collect($values)->sum('value');
|
||||
|
||||
$label = match ($name) {
|
||||
'reach' => 'Reach',
|
||||
'follower_count' => 'Followers',
|
||||
'reach' => __('analytics.metrics.reach'),
|
||||
'follower_count' => __('analytics.metrics.followers'),
|
||||
default => ucfirst(str_replace('_', ' ', $name)),
|
||||
};
|
||||
|
||||
|
|
@ -181,7 +181,12 @@ private function fetchTotalValueMetrics(SocialAccount $account, CarbonInterface
|
|||
$value = data_get($metric, 'total_value.value', 0);
|
||||
|
||||
$label = match ($name) {
|
||||
'total_interactions' => 'Interactions',
|
||||
'total_interactions' => __('analytics.metrics.interactions'),
|
||||
'likes' => __('analytics.metrics.likes'),
|
||||
'comments' => __('analytics.metrics.comments'),
|
||||
'shares' => __('analytics.metrics.shares'),
|
||||
'saves' => __('analytics.metrics.saves'),
|
||||
'views' => __('analytics.metrics.views'),
|
||||
default => ucfirst(str_replace('_', ' ', $name)),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public function fetchPostMetrics(PostPlatform $postPlatform): array
|
|||
$data = $response->json();
|
||||
|
||||
return [
|
||||
['label' => 'Likes', 'value' => (int) data_get($data, 'likesSummary.totalLikes', 0)],
|
||||
['label' => 'Comments', 'value' => (int) data_get($data, 'commentsSummary.aggregatedTotalComments', 0)],
|
||||
['label' => __('analytics.metrics.likes'), 'value' => (int) data_get($data, 'likesSummary.totalLikes', 0)],
|
||||
['label' => __('analytics.metrics.comments'), 'value' => (int) data_get($data, 'commentsSummary.aggregatedTotalComments', 0)],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ private function fetchPageStatistics(string $orgUrn, string $timeInterval): arra
|
|||
$totalPageViews += data_get($element, 'totalPageStatistics.views.allPageViews.pageViews', 0);
|
||||
}
|
||||
|
||||
return $totalPageViews > 0 ? [['label' => 'Page Views', 'value' => $totalPageViews]] : [];
|
||||
return $totalPageViews > 0 ? [['label' => __('analytics.metrics.page_views'), 'value' => $totalPageViews]] : [];
|
||||
}
|
||||
|
||||
private function fetchFollowerStatistics(string $orgUrn, string $timeInterval): array
|
||||
|
|
@ -164,11 +164,11 @@ private function fetchFollowerStatistics(string $orgUrn, string $timeInterval):
|
|||
$metrics = [];
|
||||
|
||||
if ($organicFollowers > 0) {
|
||||
$metrics[] = ['label' => 'Organic Followers', 'value' => $organicFollowers];
|
||||
$metrics[] = ['label' => __('analytics.metrics.organic_followers'), 'value' => $organicFollowers];
|
||||
}
|
||||
|
||||
if ($paidFollowers > 0) {
|
||||
$metrics[] = ['label' => 'Paid Followers', 'value' => $paidFollowers];
|
||||
$metrics[] = ['label' => __('analytics.metrics.paid_followers'), 'value' => $paidFollowers];
|
||||
}
|
||||
|
||||
return $metrics;
|
||||
|
|
@ -207,19 +207,19 @@ private function fetchShareStatistics(string $orgUrn, string $timeInterval): arr
|
|||
$metrics = [];
|
||||
|
||||
if ($totalImpressions > 0) {
|
||||
$metrics[] = ['label' => 'Impressions', 'value' => $totalImpressions];
|
||||
$metrics[] = ['label' => __('analytics.metrics.impressions'), 'value' => $totalImpressions];
|
||||
}
|
||||
if ($totalClicks > 0) {
|
||||
$metrics[] = ['label' => 'Clicks', 'value' => $totalClicks];
|
||||
$metrics[] = ['label' => __('analytics.metrics.clicks'), 'value' => $totalClicks];
|
||||
}
|
||||
if ($totalLikes > 0) {
|
||||
$metrics[] = ['label' => 'Likes', 'value' => $totalLikes];
|
||||
$metrics[] = ['label' => __('analytics.metrics.likes'), 'value' => $totalLikes];
|
||||
}
|
||||
if ($totalComments > 0) {
|
||||
$metrics[] = ['label' => 'Comments', 'value' => $totalComments];
|
||||
$metrics[] = ['label' => __('analytics.metrics.comments'), 'value' => $totalComments];
|
||||
}
|
||||
if ($totalShares > 0) {
|
||||
$metrics[] = ['label' => 'Shares', 'value' => $totalShares];
|
||||
$metrics[] = ['label' => __('analytics.metrics.shares'), 'value' => $totalShares];
|
||||
}
|
||||
|
||||
return $metrics;
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ public function fetchPostMetrics(PostPlatform $postPlatform): array
|
|||
$status = $response->json();
|
||||
|
||||
return [
|
||||
['label' => 'Favourites', 'value' => data_get($status, 'favourites_count', 0)],
|
||||
['label' => 'Reblogs', 'value' => data_get($status, 'reblogs_count', 0)],
|
||||
['label' => 'Replies', 'value' => data_get($status, 'replies_count', 0)],
|
||||
['label' => __('analytics.metrics.favourites'), 'value' => data_get($status, 'favourites_count', 0)],
|
||||
['label' => __('analytics.metrics.reblogs'), 'value' => data_get($status, 'reblogs_count', 0)],
|
||||
['label' => __('analytics.metrics.replies'), 'value' => data_get($status, 'replies_count', 0)],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ public function fetchPostMetrics(PostPlatform $postPlatform): array
|
|||
$data = data_get($response->json(), 'all.summary_metrics', []);
|
||||
|
||||
$rows = [
|
||||
'IMPRESSION' => 'Impressions',
|
||||
'SAVE' => 'Saves',
|
||||
'PIN_CLICK' => 'Pin clicks',
|
||||
'OUTBOUND_CLICK' => 'Outbound clicks',
|
||||
'VIDEO_MRC_VIEW' => 'Video views',
|
||||
'IMPRESSION' => __('analytics.metrics.impressions'),
|
||||
'SAVE' => __('analytics.metrics.saves'),
|
||||
'PIN_CLICK' => __('analytics.metrics.pin_clicks'),
|
||||
'OUTBOUND_CLICK' => __('analytics.metrics.outbound_clicks'),
|
||||
'VIDEO_MRC_VIEW' => __('analytics.metrics.video_views'),
|
||||
];
|
||||
|
||||
return collect($rows)
|
||||
|
|
@ -148,11 +148,11 @@ private function fetchMetricsFromApi(SocialAccount $account, CarbonInterface $si
|
|||
$avgClickRate = $count > 0 ? round($totals['PIN_CLICK_RATE'] / $count, 4) : 0;
|
||||
|
||||
return [
|
||||
['label' => 'Impressions', 'value' => $totals['IMPRESSION']],
|
||||
['label' => 'Pin Clicks', 'value' => $totals['PIN_CLICK']],
|
||||
['label' => 'Engagement', 'value' => $totals['ENGAGEMENT']],
|
||||
['label' => 'Saves', 'value' => $totals['SAVE']],
|
||||
['label' => 'Pin Click Rate', 'value' => $avgClickRate],
|
||||
['label' => __('analytics.metrics.impressions'), 'value' => $totals['IMPRESSION']],
|
||||
['label' => __('analytics.metrics.pin_clicks'), 'value' => $totals['PIN_CLICK']],
|
||||
['label' => __('analytics.metrics.engagement'), 'value' => $totals['ENGAGEMENT']],
|
||||
['label' => __('analytics.metrics.saves'), 'value' => $totals['SAVE']],
|
||||
['label' => __('analytics.metrics.pin_click_rate'), 'value' => $avgClickRate],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,14 @@ private function fetchMetricsFromApi(SocialAccount $account, CarbonInterface $si
|
|||
$value = collect($values)->sum('value');
|
||||
}
|
||||
|
||||
$label = ucfirst(str_replace('_', ' ', $name));
|
||||
$label = match ($name) {
|
||||
'views' => __('analytics.metrics.views'),
|
||||
'likes' => __('analytics.metrics.likes'),
|
||||
'replies' => __('analytics.metrics.replies'),
|
||||
'reposts' => __('analytics.metrics.reposts'),
|
||||
'quotes' => __('analytics.metrics.quotes'),
|
||||
default => ucfirst(str_replace('_', ' ', $name)),
|
||||
};
|
||||
|
||||
$metrics[] = ['label' => $label, 'value' => $value];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,19 +75,19 @@ private function fetchUserStats(): array
|
|||
$metrics = [];
|
||||
|
||||
if (($value = data_get($user, 'follower_count')) !== null) {
|
||||
$metrics[] = ['label' => 'Followers', 'value' => $value];
|
||||
$metrics[] = ['label' => __('analytics.metrics.followers'), 'value' => $value];
|
||||
}
|
||||
|
||||
if (($value = data_get($user, 'following_count')) !== null) {
|
||||
$metrics[] = ['label' => 'Following', 'value' => $value];
|
||||
$metrics[] = ['label' => __('analytics.metrics.following'), 'value' => $value];
|
||||
}
|
||||
|
||||
if (($value = data_get($user, 'likes_count')) !== null) {
|
||||
$metrics[] = ['label' => 'Total Likes', 'value' => $value];
|
||||
$metrics[] = ['label' => __('analytics.metrics.total_likes'), 'value' => $value];
|
||||
}
|
||||
|
||||
if (($value = data_get($user, 'video_count')) !== null) {
|
||||
$metrics[] = ['label' => 'Videos', 'value' => $value];
|
||||
$metrics[] = ['label' => __('analytics.metrics.videos'), 'value' => $value];
|
||||
}
|
||||
|
||||
return $metrics;
|
||||
|
|
@ -148,10 +148,10 @@ private function fetchVideoMetrics(): array
|
|||
}
|
||||
|
||||
return [
|
||||
['label' => 'Views', 'value' => $totalViews],
|
||||
['label' => 'Recent Likes', 'value' => $totalLikes],
|
||||
['label' => 'Recent Comments', 'value' => $totalComments],
|
||||
['label' => 'Recent Shares', 'value' => $totalShares],
|
||||
['label' => __('analytics.metrics.views'), 'value' => $totalViews],
|
||||
['label' => __('analytics.metrics.recent_likes'), 'value' => $totalLikes],
|
||||
['label' => __('analytics.metrics.recent_comments'), 'value' => $totalComments],
|
||||
['label' => __('analytics.metrics.recent_shares'), 'value' => $totalShares],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -146,12 +146,12 @@ private function fetchTweetMetrics(array $tweetIds): array
|
|||
}
|
||||
|
||||
return [
|
||||
['label' => 'Impressions', 'value' => $totals['impression_count']],
|
||||
['label' => 'Likes', 'value' => $totals['like_count']],
|
||||
['label' => 'Retweets', 'value' => $totals['retweet_count']],
|
||||
['label' => 'Replies', 'value' => $totals['reply_count']],
|
||||
['label' => 'Quotes', 'value' => $totals['quote_count']],
|
||||
['label' => 'Bookmarks', 'value' => $totals['bookmark_count']],
|
||||
['label' => __('analytics.metrics.impressions'), 'value' => $totals['impression_count']],
|
||||
['label' => __('analytics.metrics.likes'), 'value' => $totals['like_count']],
|
||||
['label' => __('analytics.metrics.retweets'), 'value' => $totals['retweet_count']],
|
||||
['label' => __('analytics.metrics.replies'), 'value' => $totals['reply_count']],
|
||||
['label' => __('analytics.metrics.quotes'), 'value' => $totals['quote_count']],
|
||||
['label' => __('analytics.metrics.bookmarks'), 'value' => $totals['bookmark_count']],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -186,12 +186,12 @@ public function fetchPostMetrics(PostPlatform $postPlatform): array
|
|||
$metrics = data_get($response->json(), 'data.public_metrics', []);
|
||||
|
||||
return [
|
||||
['label' => 'Impressions', 'value' => data_get($metrics, 'impression_count', 0)],
|
||||
['label' => 'Likes', 'value' => data_get($metrics, 'like_count', 0)],
|
||||
['label' => 'Retweets', 'value' => data_get($metrics, 'retweet_count', 0)],
|
||||
['label' => 'Replies', 'value' => data_get($metrics, 'reply_count', 0)],
|
||||
['label' => 'Quotes', 'value' => data_get($metrics, 'quote_count', 0)],
|
||||
['label' => 'Bookmarks', 'value' => data_get($metrics, 'bookmark_count', 0)],
|
||||
['label' => __('analytics.metrics.impressions'), 'value' => data_get($metrics, 'impression_count', 0)],
|
||||
['label' => __('analytics.metrics.likes'), 'value' => data_get($metrics, 'like_count', 0)],
|
||||
['label' => __('analytics.metrics.retweets'), 'value' => data_get($metrics, 'retweet_count', 0)],
|
||||
['label' => __('analytics.metrics.replies'), 'value' => data_get($metrics, 'reply_count', 0)],
|
||||
['label' => __('analytics.metrics.quotes'), 'value' => data_get($metrics, 'quote_count', 0)],
|
||||
['label' => __('analytics.metrics.bookmarks'), 'value' => data_get($metrics, 'bookmark_count', 0)],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,12 +81,12 @@ public function fetchPostMetrics(PostPlatform $postPlatform): array
|
|||
$row = data_get($data, 'rows.0', []);
|
||||
|
||||
$labels = [
|
||||
'views' => 'Views',
|
||||
'estimatedMinutesWatched' => 'Minutes watched',
|
||||
'averageViewDuration' => 'Avg view duration (s)',
|
||||
'likes' => 'Likes',
|
||||
'comments' => 'Comments',
|
||||
'shares' => 'Shares',
|
||||
'views' => __('analytics.metrics.views'),
|
||||
'estimatedMinutesWatched' => __('analytics.metrics.minutes_watched'),
|
||||
'averageViewDuration' => __('analytics.metrics.avg_view_duration'),
|
||||
'likes' => __('analytics.metrics.likes'),
|
||||
'comments' => __('analytics.metrics.comments'),
|
||||
'shares' => __('analytics.metrics.shares'),
|
||||
];
|
||||
|
||||
return collect($columns)
|
||||
|
|
@ -141,13 +141,13 @@ private function fetchMetricsFromApi(SocialAccount $account, CarbonInterface $si
|
|||
$value = data_get($values, $index, 0);
|
||||
|
||||
$label = match ($name) {
|
||||
'views' => 'Views',
|
||||
'estimatedMinutesWatched' => 'Minutes Watched',
|
||||
'averageViewDuration' => 'Avg. View Duration (s)',
|
||||
'averageViewPercentage' => 'Avg. View Percentage',
|
||||
'subscribersGained' => 'Subscribers Gained',
|
||||
'subscribersLost' => 'Subscribers Lost',
|
||||
'likes' => 'Likes',
|
||||
'views' => __('analytics.metrics.views'),
|
||||
'estimatedMinutesWatched' => __('analytics.metrics.minutes_watched'),
|
||||
'averageViewDuration' => __('analytics.metrics.avg_view_duration'),
|
||||
'averageViewPercentage' => __('analytics.metrics.avg_view_percentage'),
|
||||
'subscribersGained' => __('analytics.metrics.subscribers_gained'),
|
||||
'subscribersLost' => __('analytics.metrics.subscribers_lost'),
|
||||
'likes' => __('analytics.metrics.likes'),
|
||||
default => ucfirst(str_replace('_', ' ', $name)),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,52 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'channels' => 'Channels',
|
||||
'no_accounts' => 'No connected accounts with analytics.',
|
||||
'no_accounts_match' => 'No accounts match.',
|
||||
'search_account' => 'Search account…',
|
||||
'select_account' => 'Select an account to view analytics.',
|
||||
'no_data' => 'No analytics data available.',
|
||||
|
||||
'metrics' => [
|
||||
'avg_view_duration' => 'Avg. View Duration (s)',
|
||||
'avg_view_percentage' => 'Avg. View Percentage',
|
||||
'bookmarks' => 'Bookmarks',
|
||||
'clicks' => 'Clicks',
|
||||
'comments' => 'Comments',
|
||||
'engagement' => 'Engagement',
|
||||
'favourites' => 'Favourites',
|
||||
'followers' => 'Followers',
|
||||
'following' => 'Following',
|
||||
'impressions' => 'Impressions',
|
||||
'interactions' => 'Interactions',
|
||||
'likes' => 'Likes',
|
||||
'minutes_watched' => 'Minutes Watched',
|
||||
'organic_followers' => 'Organic Followers',
|
||||
'outbound_clicks' => 'Outbound Clicks',
|
||||
'page_followers' => 'Page Followers',
|
||||
'page_reach' => 'Page Reach',
|
||||
'page_views' => 'Page Views',
|
||||
'paid_followers' => 'Paid Followers',
|
||||
'pin_click_rate' => 'Pin Click Rate',
|
||||
'pin_clicks' => 'Pin Clicks',
|
||||
'posts_engagement' => 'Posts Engagement',
|
||||
'posts_reach' => 'Posts Reach',
|
||||
'quotes' => 'Quotes',
|
||||
'reach' => 'Reach',
|
||||
'reblogs' => 'Reblogs',
|
||||
'recent_comments' => 'Recent Comments',
|
||||
'recent_likes' => 'Recent Likes',
|
||||
'recent_shares' => 'Recent Shares',
|
||||
'replies' => 'Replies',
|
||||
'reposts' => 'Reposts',
|
||||
'retweets' => 'Retweets',
|
||||
'saves' => 'Saves',
|
||||
'shares' => 'Shares',
|
||||
'subscribers_gained' => 'Subscribers Gained',
|
||||
'subscribers_lost' => 'Subscribers Lost',
|
||||
'total_likes' => 'Total Likes',
|
||||
'video_views' => 'Video Views',
|
||||
'videos' => 'Videos',
|
||||
'views' => 'Views',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -27,6 +27,21 @@
|
|||
'select' => 'Select date',
|
||||
],
|
||||
|
||||
'date_range_picker' => [
|
||||
'placeholder' => 'Pick a date range',
|
||||
'today' => 'Today',
|
||||
'yesterday' => 'Yesterday',
|
||||
'last_7_days' => 'Last 7 days',
|
||||
'last_30_days' => 'Last 30 days',
|
||||
'last_3_months' => 'Last 3 months',
|
||||
'last_6_months' => 'Last 6 months',
|
||||
'last_12_months' => 'Last 12 months',
|
||||
'this_month' => 'This month',
|
||||
'last_month' => 'Last month',
|
||||
'year_to_date' => 'Year to date',
|
||||
'last_year' => 'Last year',
|
||||
],
|
||||
|
||||
'cancel' => 'Cancel',
|
||||
'clear' => 'Clear',
|
||||
'close' => 'Close',
|
||||
|
|
|
|||
|
|
@ -1,8 +1,52 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'channels' => 'Canales',
|
||||
'no_accounts' => 'No hay cuentas conectadas con analytics.',
|
||||
'no_accounts_match' => 'Ninguna cuenta coincide.',
|
||||
'search_account' => 'Buscar cuenta…',
|
||||
'select_account' => 'Selecciona una cuenta para ver analytics.',
|
||||
'no_data' => 'No hay datos de analytics disponibles.',
|
||||
|
||||
'metrics' => [
|
||||
'avg_view_duration' => 'Duración Media (s)',
|
||||
'avg_view_percentage' => 'Porcentaje Medio de Visualización',
|
||||
'bookmarks' => 'Guardados',
|
||||
'clicks' => 'Clics',
|
||||
'comments' => 'Comentarios',
|
||||
'engagement' => 'Engagement',
|
||||
'favourites' => 'Favoritos',
|
||||
'followers' => 'Seguidores',
|
||||
'following' => 'Siguiendo',
|
||||
'impressions' => 'Impresiones',
|
||||
'interactions' => 'Interacciones',
|
||||
'likes' => 'Me gusta',
|
||||
'minutes_watched' => 'Minutos Vistos',
|
||||
'organic_followers' => 'Seguidores Orgánicos',
|
||||
'outbound_clicks' => 'Clics Externos',
|
||||
'page_followers' => 'Seguidores de la Página',
|
||||
'page_reach' => 'Alcance de la Página',
|
||||
'page_views' => 'Vistas de la Página',
|
||||
'paid_followers' => 'Seguidores Pagados',
|
||||
'pin_click_rate' => 'Tasa de Clics en Pines',
|
||||
'pin_clicks' => 'Clics en Pines',
|
||||
'posts_engagement' => 'Engagement de Publicaciones',
|
||||
'posts_reach' => 'Alcance de Publicaciones',
|
||||
'quotes' => 'Citas',
|
||||
'reach' => 'Alcance',
|
||||
'reblogs' => 'Reblogs',
|
||||
'recent_comments' => 'Comentarios Recientes',
|
||||
'recent_likes' => 'Me Gusta Recientes',
|
||||
'recent_shares' => 'Compartidos Recientes',
|
||||
'replies' => 'Respuestas',
|
||||
'reposts' => 'Reposts',
|
||||
'retweets' => 'Retweets',
|
||||
'saves' => 'Guardados',
|
||||
'shares' => 'Compartidos',
|
||||
'subscribers_gained' => 'Suscriptores Ganados',
|
||||
'subscribers_lost' => 'Suscriptores Perdidos',
|
||||
'total_likes' => 'Total de Me gusta',
|
||||
'video_views' => 'Vistas de Vídeo',
|
||||
'videos' => 'Vídeos',
|
||||
'views' => 'Vistas',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -27,6 +27,21 @@
|
|||
'select' => 'Seleccionar fecha',
|
||||
],
|
||||
|
||||
'date_range_picker' => [
|
||||
'placeholder' => 'Elige un período',
|
||||
'today' => 'Hoy',
|
||||
'yesterday' => 'Ayer',
|
||||
'last_7_days' => 'Últimos 7 días',
|
||||
'last_30_days' => 'Últimos 30 días',
|
||||
'last_3_months' => 'Últimos 3 meses',
|
||||
'last_6_months' => 'Últimos 6 meses',
|
||||
'last_12_months' => 'Últimos 12 meses',
|
||||
'this_month' => 'Este mes',
|
||||
'last_month' => 'Mes pasado',
|
||||
'year_to_date' => 'Desde inicio del año',
|
||||
'last_year' => 'Año pasado',
|
||||
],
|
||||
|
||||
'cancel' => 'Cancelar',
|
||||
'clear' => 'Limpiar',
|
||||
'close' => 'Cerrar',
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,52 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'channels' => 'Canais',
|
||||
'no_accounts' => 'Nenhuma conta conectada com analytics.',
|
||||
'no_accounts_match' => 'Nenhuma conta corresponde.',
|
||||
'search_account' => 'Buscar conta…',
|
||||
'select_account' => 'Selecione uma conta para ver analytics.',
|
||||
'no_data' => 'Nenhum dado de analytics disponível.',
|
||||
|
||||
'metrics' => [
|
||||
'avg_view_duration' => 'Duração Média (s)',
|
||||
'avg_view_percentage' => 'Visualização Média',
|
||||
'bookmarks' => 'Salvos',
|
||||
'clicks' => 'Cliques',
|
||||
'comments' => 'Comentários',
|
||||
'engagement' => 'Engajamento',
|
||||
'favourites' => 'Favoritos',
|
||||
'followers' => 'Seguidores',
|
||||
'following' => 'Seguindo',
|
||||
'impressions' => 'Impressões',
|
||||
'interactions' => 'Interações',
|
||||
'likes' => 'Curtidas',
|
||||
'minutes_watched' => 'Minutos Assistidos',
|
||||
'organic_followers' => 'Seguidores Orgânicos',
|
||||
'outbound_clicks' => 'Cliques Externos',
|
||||
'page_followers' => 'Seguidores da Página',
|
||||
'page_reach' => 'Alcance da Página',
|
||||
'page_views' => 'Visualizações da Página',
|
||||
'paid_followers' => 'Seguidores Pagos',
|
||||
'pin_click_rate' => 'Taxa de Clique em Pins',
|
||||
'pin_clicks' => 'Cliques em Pins',
|
||||
'posts_engagement' => 'Engajamento dos Posts',
|
||||
'posts_reach' => 'Alcance dos Posts',
|
||||
'quotes' => 'Citações',
|
||||
'reach' => 'Alcance',
|
||||
'reblogs' => 'Reblogs',
|
||||
'recent_comments' => 'Comentários Recentes',
|
||||
'recent_likes' => 'Curtidas Recentes',
|
||||
'recent_shares' => 'Compartilhamentos Recentes',
|
||||
'replies' => 'Respostas',
|
||||
'reposts' => 'Reposts',
|
||||
'retweets' => 'Retweets',
|
||||
'saves' => 'Salvos',
|
||||
'shares' => 'Compartilhamentos',
|
||||
'subscribers_gained' => 'Inscritos Ganhos',
|
||||
'subscribers_lost' => 'Inscritos Perdidos',
|
||||
'total_likes' => 'Curtidas Totais',
|
||||
'video_views' => 'Visualizações de Vídeo',
|
||||
'videos' => 'Vídeos',
|
||||
'views' => 'Visualizações',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -27,6 +27,21 @@
|
|||
'select' => 'Selecionar data',
|
||||
],
|
||||
|
||||
'date_range_picker' => [
|
||||
'placeholder' => 'Escolha um período',
|
||||
'today' => 'Hoje',
|
||||
'yesterday' => 'Ontem',
|
||||
'last_7_days' => 'Últimos 7 dias',
|
||||
'last_30_days' => 'Últimos 30 dias',
|
||||
'last_3_months' => 'Últimos 3 meses',
|
||||
'last_6_months' => 'Últimos 6 meses',
|
||||
'last_12_months' => 'Últimos 12 meses',
|
||||
'this_month' => 'Este mês',
|
||||
'last_month' => 'Mês passado',
|
||||
'year_to_date' => 'Desde o início do ano',
|
||||
'last_year' => 'Ano passado',
|
||||
],
|
||||
|
||||
'cancel' => 'Cancelar',
|
||||
'clear' => 'Limpar',
|
||||
'close' => 'Fechar',
|
||||
|
|
|
|||
|
|
@ -1,18 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import Breadcrumbs from '@/components/Breadcrumbs.vue';
|
||||
import { SidebarTrigger } from '@/components/ui/sidebar';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
title?: string;
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
}>(),
|
||||
{
|
||||
title: '',
|
||||
breadcrumbs: () => [],
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -21,16 +8,7 @@ withDefaults(
|
|||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<SidebarTrigger class="-ml-1" />
|
||||
<slot name="left">
|
||||
<Breadcrumbs v-if="breadcrumbs.length > 0" :breadcrumbs="breadcrumbs" />
|
||||
<h2
|
||||
v-else-if="title"
|
||||
class="text-lg text-foreground"
|
||||
style="font-family: var(--font-display)"
|
||||
>
|
||||
{{ title }}
|
||||
</h2>
|
||||
</slot>
|
||||
<slot name="left" />
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<slot name="right" />
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ const handleCreateWorkspace = () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Sidebar collapsible="icon" variant="inset">
|
||||
<Sidebar collapsible="icon">
|
||||
<SidebarHeader>
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ onBeforeUnmount(() => {
|
|||
<IconBell class="size-4" />
|
||||
<span
|
||||
v-if="unreadCount > 0"
|
||||
class="absolute -top-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-destructive text-[8px] font-bold text-destructive-foreground"
|
||||
class="absolute -right-1 -top-1 inline-flex size-4 items-center justify-center rounded-full border-2 border-foreground bg-rose-100 text-[9px] font-bold text-rose-700 shadow-2xs"
|
||||
>
|
||||
{{ unreadCount > 9 ? '9+' : unreadCount }}
|
||||
</span>
|
||||
|
|
@ -214,20 +214,22 @@ onBeforeUnmount(() => {
|
|||
<div
|
||||
v-if="show"
|
||||
ref="panel"
|
||||
class="fixed left-[17rem] bottom-2 z-50 w-[22rem] h-[32rem] flex flex-col rounded-xl border border-border bg-card shadow-lg"
|
||||
class="fixed bottom-2 left-[17rem] z-50 flex h-[32rem] w-[22rem] flex-col overflow-hidden rounded-xl border-2 border-foreground bg-card shadow-md"
|
||||
>
|
||||
<!-- Header -->
|
||||
<div class="flex items-center justify-between px-4 pt-3 pb-2">
|
||||
<h3 class="text-sm font-semibold">{{ $t('sidebar.notifications') }}</h3>
|
||||
<div class="flex items-center gap-0.5">
|
||||
<div class="flex items-center justify-between gap-2 border-b-2 border-foreground/10 px-4 py-3">
|
||||
<h3 class="text-[11px] font-black uppercase tracking-widest text-foreground/60">
|
||||
{{ $t('sidebar.notifications') }}
|
||||
</h3>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<Tooltip v-if="notifications.length > 0">
|
||||
<TooltipTrigger as-child>
|
||||
<button
|
||||
type="button"
|
||||
class="p-1 text-muted-foreground hover:text-foreground transition-colors rounded"
|
||||
class="inline-flex size-7 cursor-pointer items-center justify-center rounded-md border-2 border-foreground bg-card text-foreground shadow-2xs transition-all hover:bg-violet-100"
|
||||
@click="handleMarkAllAsRead"
|
||||
>
|
||||
<IconChecks class="size-4" />
|
||||
<IconChecks class="size-3.5" stroke-width="2.5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{{ $t('sidebar.mark_all_read') }}</TooltipContent>
|
||||
|
|
@ -236,67 +238,69 @@ onBeforeUnmount(() => {
|
|||
<TooltipTrigger as-child>
|
||||
<button
|
||||
type="button"
|
||||
class="p-1 text-muted-foreground hover:text-foreground transition-colors rounded"
|
||||
class="inline-flex size-7 cursor-pointer items-center justify-center rounded-md border-2 border-foreground bg-card text-foreground shadow-2xs transition-all hover:bg-violet-100"
|
||||
@click="handleArchiveAll"
|
||||
>
|
||||
<IconArchive class="size-4" />
|
||||
<IconArchive class="size-3.5" stroke-width="2.5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{{ $t('sidebar.archive_all') }}</TooltipContent>
|
||||
</Tooltip>
|
||||
<button
|
||||
type="button"
|
||||
class="p-1 text-muted-foreground hover:text-foreground transition-colors rounded"
|
||||
class="inline-flex size-7 cursor-pointer items-center justify-center rounded-full border-2 border-foreground bg-card text-foreground shadow-2xs transition-all hover:-rotate-90 hover:bg-rose-100"
|
||||
@click="close"
|
||||
>
|
||||
<IconX class="size-4" />
|
||||
<IconX class="size-3.5" stroke-width="2.5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notification list -->
|
||||
<div class="flex-1 overflow-y-auto">
|
||||
<div v-if="notifications.length > 0" class="divide-y divide-border">
|
||||
<div
|
||||
<div v-if="notifications.length > 0" class="divide-y-2 divide-dashed divide-foreground/15">
|
||||
<button
|
||||
v-for="notification in notifications"
|
||||
:key="notification.id"
|
||||
class="px-3 py-2.5 flex items-start gap-2.5 hover:bg-muted/50 transition-colors cursor-pointer"
|
||||
type="button"
|
||||
class="flex w-full cursor-pointer items-start gap-2.5 px-3 py-3 text-left transition-colors hover:bg-foreground/5"
|
||||
:class="!notification.read_at ? 'bg-violet-100/40' : ''"
|
||||
@click="handleNotificationClick(notification)"
|
||||
>
|
||||
<div class="flex items-center mt-1.5 shrink-0">
|
||||
<div
|
||||
:class="[
|
||||
'size-1.5 rounded-full',
|
||||
!notification.read_at ? 'bg-primary' : 'bg-transparent',
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
class="mt-1.5 inline-block size-2 shrink-0 rounded-full"
|
||||
:class="!notification.read_at ? 'bg-violet-500 ring-2 ring-violet-200' : 'bg-transparent'"
|
||||
/>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="text-xs font-medium truncate">{{ notification.title }}</p>
|
||||
<p class="text-xs text-muted-foreground truncate">{{ notification.body }}</p>
|
||||
<p class="text-[11px] text-muted-foreground/70 mt-0.5">{{ formatTime(notification.created_at) }}</p>
|
||||
<p class="truncate text-sm font-bold text-foreground">{{ notification.title }}</p>
|
||||
<p class="truncate text-xs text-foreground/70">{{ notification.body }}</p>
|
||||
<p class="mt-0.5 text-[11px] font-medium text-foreground/50">{{ formatTime(notification.created_at) }}</p>
|
||||
</div>
|
||||
<div class="shrink-0" @click.stop>
|
||||
<Tooltip v-if="!notification.read_at">
|
||||
<TooltipTrigger as-child>
|
||||
<button
|
||||
type="button"
|
||||
class="p-1 text-muted-foreground hover:text-foreground transition-colors rounded"
|
||||
class="inline-flex size-7 cursor-pointer items-center justify-center rounded-md text-foreground/60 transition-colors hover:bg-foreground/10 hover:text-foreground"
|
||||
@click="handleMarkAsRead(notification)"
|
||||
>
|
||||
<IconCheck class="size-3.5" />
|
||||
<IconCheck class="size-3.5" stroke-width="2.5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{{ $t('sidebar.mark_as_read') }}</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Empty state -->
|
||||
<div v-else-if="!loading" class="flex flex-col items-center justify-center py-12 px-6 text-center">
|
||||
<IconInbox class="size-8 text-muted-foreground/50 mb-3" />
|
||||
<p class="text-sm font-medium">{{ $t('sidebar.no_notifications') }}</p>
|
||||
<div v-else-if="!loading" class="flex flex-col items-center justify-center gap-3 px-6 py-12 text-center">
|
||||
<div class="inline-flex size-12 -rotate-3 items-center justify-center rounded-2xl border-2 border-foreground bg-violet-200 shadow-2xs">
|
||||
<IconInbox class="size-6 text-foreground" stroke-width="2" />
|
||||
</div>
|
||||
<p class="text-base font-bold text-foreground" style="font-family: var(--font-display)">
|
||||
{{ $t('sidebar.no_notifications') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,14 @@ defineProps<{
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<h2 class="text-xl font-semibold tracking-tight">
|
||||
<header class="space-y-1">
|
||||
<h1
|
||||
class="text-4xl font-semibold leading-tight text-foreground"
|
||||
style="font-family: var(--font-display)"
|
||||
>
|
||||
{{ title }}
|
||||
<span v-if="total != null && total > 0" class="text-muted-foreground">({{ total }})</span>
|
||||
</h2>
|
||||
<p v-if="description" class="text-sm text-muted-foreground">{{ description }}</p>
|
||||
</div>
|
||||
<span v-if="total != null && total > 0" class="text-foreground/40">({{ total }})</span>
|
||||
</h1>
|
||||
<p v-if="description" class="text-sm text-foreground/70">{{ description }}</p>
|
||||
</header>
|
||||
</template>
|
||||
|
|
|
|||
124
resources/js/components/analytics/AnalyticsAccountSelector.vue
Normal file
124
resources/js/components/analytics/AnalyticsAccountSelector.vue
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<script setup lang="ts">
|
||||
import { IconChevronDown } from '@tabler/icons-vue';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
Command,
|
||||
CommandEmpty,
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandList,
|
||||
} from '@/components/ui/command';
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||
import { getPlatformLabel, getPlatformLogo } from '@/composables/usePlatformLogo';
|
||||
|
||||
import type { AnalyticsAccount } from './types';
|
||||
|
||||
const props = defineProps<{
|
||||
accounts: AnalyticsAccount[];
|
||||
selectedId: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
select: [accountId: string];
|
||||
}>();
|
||||
|
||||
const open = ref(false);
|
||||
|
||||
const selected = computed(() =>
|
||||
props.accounts.find((a) => a.id === props.selectedId) ?? null,
|
||||
);
|
||||
|
||||
const select = (account: AnalyticsAccount) => {
|
||||
emit('select', account.id);
|
||||
open.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Popover v-model:open="open">
|
||||
<PopoverTrigger as-child>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
role="combobox"
|
||||
:aria-expanded="open"
|
||||
:disabled="accounts.length === 0"
|
||||
class="h-auto min-w-[240px] justify-start gap-3 px-3 py-2 text-left font-medium"
|
||||
>
|
||||
<template v-if="selected">
|
||||
<div class="relative shrink-0">
|
||||
<Avatar class="size-7 rounded-full border-2 border-foreground shadow-2xs">
|
||||
<AvatarImage v-if="selected.avatar_url" :src="selected.avatar_url" :alt="selected.display_name" />
|
||||
<AvatarFallback class="rounded-full bg-violet-100 text-xs font-bold text-foreground">
|
||||
{{ selected.display_name?.charAt(0) }}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<span class="absolute -bottom-1 -right-1 inline-flex size-4 items-center justify-center overflow-hidden rounded-full border-2 border-foreground bg-card shadow-2xs">
|
||||
<img
|
||||
:src="getPlatformLogo(selected.platform)"
|
||||
:alt="selected.platform"
|
||||
class="size-full object-cover"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<span class="min-w-0 flex-1 truncate">
|
||||
<span class="font-bold text-foreground">{{ selected.display_name }}</span>
|
||||
<span v-if="selected.username" class="ml-1.5 text-xs font-medium text-foreground/60">
|
||||
@{{ selected.username }}
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-foreground/60">{{ $t('analytics.select_account') }}</span>
|
||||
</template>
|
||||
<IconChevronDown class="ml-auto size-4 shrink-0 text-foreground/60" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
|
||||
<PopoverContent class="w-[320px] overflow-hidden p-0" align="start">
|
||||
<Command class="rounded-[10px]">
|
||||
<CommandInput :placeholder="trans('analytics.search_account')" />
|
||||
<CommandList>
|
||||
<CommandEmpty>{{ $t('analytics.no_accounts_match') }}</CommandEmpty>
|
||||
<CommandGroup>
|
||||
<CommandItem
|
||||
v-for="account in accounts"
|
||||
:key="account.id"
|
||||
:value="account.id"
|
||||
class="gap-3"
|
||||
@select="select(account)"
|
||||
>
|
||||
<div class="relative shrink-0">
|
||||
<Avatar class="size-9 rounded-full border-2 border-foreground shadow-2xs">
|
||||
<AvatarImage v-if="account.avatar_url" :src="account.avatar_url" :alt="account.display_name" />
|
||||
<AvatarFallback class="rounded-full bg-violet-100 font-bold text-foreground">
|
||||
{{ account.display_name?.charAt(0) }}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<span class="absolute -bottom-1 -right-1 inline-flex size-5 items-center justify-center overflow-hidden rounded-full border-2 border-foreground bg-card shadow-2xs">
|
||||
<img
|
||||
:src="getPlatformLogo(account.platform)"
|
||||
:alt="account.platform"
|
||||
class="size-full object-cover"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate font-bold text-foreground">{{ account.display_name }}</p>
|
||||
<p v-if="account.username" class="truncate text-xs font-medium text-foreground/60">
|
||||
@{{ account.username }}
|
||||
</p>
|
||||
</div>
|
||||
<span class="sr-only">{{ getPlatformLabel(account.platform) }}</span>
|
||||
</CommandItem>
|
||||
</CommandGroup>
|
||||
</CommandList>
|
||||
</Command>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</template>
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||
import { getPlatformLogo } from '@/composables/usePlatformLogo';
|
||||
|
||||
export interface AnalyticsAccount {
|
||||
id: string;
|
||||
platform: string;
|
||||
display_name: string;
|
||||
username: string | null;
|
||||
avatar_url: string | null;
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
accounts: AnalyticsAccount[];
|
||||
selectedId: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
select: [accountId: string];
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-full w-64 shrink-0 flex-col border-r-2 border-foreground/10">
|
||||
<div class="border-b-2 border-foreground/10 px-4 py-3">
|
||||
<h2 class="text-[11px] font-black uppercase tracking-widest text-foreground/60">
|
||||
{{ $t('analytics.channels') }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="flex-1 space-y-1 overflow-y-auto p-2">
|
||||
<div v-if="accounts.length === 0" class="px-2 py-8 text-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_accounts') }}
|
||||
</div>
|
||||
<button
|
||||
v-for="account in accounts"
|
||||
:key="account.id"
|
||||
type="button"
|
||||
class="flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors"
|
||||
:class="selectedId === account.id ? 'bg-violet-100 text-foreground' : 'text-foreground/80 hover:bg-foreground/5 hover:text-foreground'"
|
||||
@click="emit('select', account.id)"
|
||||
>
|
||||
<div class="relative shrink-0">
|
||||
<Avatar class="size-9 rounded-full border-2 border-foreground shadow-2xs">
|
||||
<AvatarImage v-if="account.avatar_url" :src="account.avatar_url" :alt="account.display_name" />
|
||||
<AvatarFallback class="rounded-full bg-violet-100 font-bold text-foreground">
|
||||
{{ account.display_name?.charAt(0) }}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<span class="absolute -bottom-1 -right-1 inline-flex size-5 items-center justify-center overflow-hidden rounded-full border-2 border-foreground bg-card shadow-2xs">
|
||||
<img
|
||||
:src="getPlatformLogo(account.platform)"
|
||||
:alt="account.platform"
|
||||
class="size-full object-cover"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate font-bold text-foreground">{{ account.display_name }}</p>
|
||||
<p v-if="account.username" class="truncate text-xs font-medium text-foreground/60">
|
||||
@{{ account.username }}
|
||||
</p>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
138
resources/js/components/analytics/MetricsGrid.vue
Normal file
138
resources/js/components/analytics/MetricsGrid.vue
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
<script setup lang="ts">
|
||||
import {
|
||||
IconActivity,
|
||||
IconBookmark,
|
||||
IconChartBar,
|
||||
IconClick,
|
||||
IconClock,
|
||||
IconEye,
|
||||
IconHeart,
|
||||
IconMessage,
|
||||
IconPlayerPlay,
|
||||
IconPointer,
|
||||
IconQuote,
|
||||
IconRepeat,
|
||||
IconShare,
|
||||
IconThumbUp,
|
||||
IconUserPlus,
|
||||
IconUsers,
|
||||
} from '@tabler/icons-vue';
|
||||
import type { FunctionalComponent } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
|
||||
interface MetricItem {
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
metrics: MetricItem[];
|
||||
loading?: boolean;
|
||||
emptyLabel?: string;
|
||||
skeletonCount?: number;
|
||||
}>(),
|
||||
{
|
||||
loading: false,
|
||||
emptyLabel: '',
|
||||
skeletonCount: 8,
|
||||
},
|
||||
);
|
||||
|
||||
// Loose keyword match. Backend metric labels are derived from raw API names
|
||||
// (English regardless of UI locale), so substring matching covers things
|
||||
// like "Profile views", "Video views", "Total likes", etc. without a
|
||||
// per-platform mapping.
|
||||
type StickerTone = { bg: string; rotate: string };
|
||||
|
||||
const TONES = {
|
||||
eye: { bg: 'bg-violet-200', rotate: '-rotate-2' },
|
||||
heart: { bg: 'bg-rose-200', rotate: 'rotate-2' },
|
||||
chat: { bg: 'bg-sky-200', rotate: '-rotate-1' },
|
||||
share: { bg: 'bg-emerald-200', rotate: 'rotate-1' },
|
||||
star: { bg: 'bg-amber-200', rotate: '-rotate-2' },
|
||||
play: { bg: 'bg-fuchsia-200', rotate: 'rotate-1' },
|
||||
users: { bg: 'bg-cyan-200', rotate: '-rotate-1' },
|
||||
default: { bg: 'bg-foreground/10', rotate: 'rotate-1' },
|
||||
} satisfies Record<string, StickerTone>;
|
||||
|
||||
interface Mapping {
|
||||
icon: FunctionalComponent;
|
||||
tone: StickerTone;
|
||||
}
|
||||
|
||||
// Multi-locale keyword matching. Keys are lowercased substrings of metric labels
|
||||
// across English, Portuguese, and Spanish so icons render correctly regardless
|
||||
// of the active locale. Order matters — earlier rules win.
|
||||
const MATCHES: Array<{ keys: string[]; mapping: Mapping }> = [
|
||||
{ keys: ['view', 'visualiz', 'vista', 'impress', 'impres', 'reach', 'alcanc'], mapping: { icon: IconEye, tone: TONES.eye } },
|
||||
{ keys: ['like', 'curtid', 'me gust', 'favour', 'favorit', 'reaction', 'love'], mapping: { icon: IconHeart, tone: TONES.heart } },
|
||||
{ keys: ['reply', 'replies', 'respost', 'respue', 'comment', 'coment'], mapping: { icon: IconMessage, tone: TONES.chat } },
|
||||
{ keys: ['repost', 'reblog', 'retweet'], mapping: { icon: IconRepeat, tone: TONES.share } },
|
||||
{ keys: ['quote', 'cita'], mapping: { icon: IconQuote, tone: TONES.share } },
|
||||
{ keys: ['save', 'salv', 'guardad', 'bookmark'], mapping: { icon: IconBookmark, tone: TONES.star } },
|
||||
{ keys: ['watch', 'duration', 'duraç', 'duración', 'minut', 'tempo', 'time'], mapping: { icon: IconClock, tone: TONES.play } },
|
||||
{ keys: ['video', 'vídeo', 'play'], mapping: { icon: IconPlayerPlay, tone: TONES.play } },
|
||||
{ keys: ['follower', 'seguidor', 'subscriber', 'inscrit', 'suscrip', 'audience'], mapping: { icon: IconUserPlus, tone: TONES.users } },
|
||||
{ keys: ['profile', 'perfil', 'visit'], mapping: { icon: IconUsers, tone: TONES.users } },
|
||||
{ keys: ['click', 'cliqu', 'clic'], mapping: { icon: IconClick, tone: TONES.share } },
|
||||
{ keys: ['tap', 'pointer'], mapping: { icon: IconPointer, tone: TONES.share } },
|
||||
{ keys: ['engage', 'engaj', 'engagement', 'interacti', 'interaç'], mapping: { icon: IconActivity, tone: TONES.heart } },
|
||||
{ keys: ['thumb'], mapping: { icon: IconThumbUp, tone: TONES.share } },
|
||||
{ keys: ['shar', 'compart'], mapping: { icon: IconShare, tone: TONES.share } },
|
||||
];
|
||||
|
||||
const matchMetric = (label: string): Mapping => {
|
||||
const haystack = label.toLowerCase();
|
||||
for (const { keys, mapping } of MATCHES) {
|
||||
if (keys.some((k) => haystack.includes(k))) return mapping;
|
||||
}
|
||||
return { icon: IconChartBar, tone: TONES.default };
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="loading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in skeletonCount" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<Skeleton class="h-4 w-24" />
|
||||
<Skeleton class="size-10 rounded-2xl" />
|
||||
</div>
|
||||
<Skeleton class="mt-3 h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<span
|
||||
:class="[
|
||||
'inline-flex size-10 shrink-0 items-center justify-center rounded-2xl border-2 border-foreground shadow-2xs',
|
||||
matchMetric(metric.label).tone.bg,
|
||||
matchMetric(metric.label).tone.rotate,
|
||||
]"
|
||||
>
|
||||
<component :is="matchMetric(metric.label).icon" class="size-5 text-foreground" stroke-width="2" />
|
||||
</span>
|
||||
</div>
|
||||
<p class="mt-3 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ emptyLabel }}
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -47,30 +46,5 @@ defineExpose({ supportsDateRange: false });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { useHttp } from '@inertiajs/vue3';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import MetricsGrid from '@/components/analytics/MetricsGrid.vue';
|
||||
import dayjs from '@/dayjs';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { show as showAnalytics } from '@/routes/app/analytics';
|
||||
|
||||
interface MetricItem {
|
||||
|
|
@ -58,30 +57,5 @@ defineExpose({ supportsDateRange: true });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Loading -->
|
||||
<div v-if="isLoading" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="i in 8" :key="i">
|
||||
<CardContent class="p-6">
|
||||
<Skeleton class="mb-3 h-4 w-24" />
|
||||
<Skeleton class="h-8 w-32" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- Metrics -->
|
||||
<div v-else-if="metrics.length > 0" class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="metric in metrics" :key="metric.label">
|
||||
<CardContent class="p-6">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">{{ metric.label }}</p>
|
||||
<p class="mt-2 text-3xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{{ formatNumber(metric.value) }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<!-- No Data -->
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
<MetricsGrid :metrics="metrics" :loading="isLoading" :empty-label="trans('analytics.no_data')" />
|
||||
</template>
|
||||
|
|
|
|||
7
resources/js/components/analytics/types.ts
Normal file
7
resources/js/components/analytics/types.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export interface AnalyticsAccount {
|
||||
id: string;
|
||||
platform: string;
|
||||
display_name: string;
|
||||
username: string | null;
|
||||
avatar_url: string | null;
|
||||
}
|
||||
88
resources/js/components/settings/UsageMetricCard.vue
Normal file
88
resources/js/components/settings/UsageMetricCard.vue
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
<script setup lang="ts">
|
||||
import type { FunctionalComponent } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
|
||||
type Tone = 'violet' | 'amber' | 'emerald' | 'sky' | 'rose' | 'fuchsia' | 'cyan';
|
||||
type Rotate = '-rotate-2' | '-rotate-1' | 'rotate-1' | 'rotate-2';
|
||||
|
||||
interface Props {
|
||||
label: string;
|
||||
icon: FunctionalComponent;
|
||||
current: number;
|
||||
limit?: number;
|
||||
tone?: Tone;
|
||||
rotate?: Rotate;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
tone: 'violet',
|
||||
rotate: '-rotate-2',
|
||||
});
|
||||
|
||||
const TONE_BG: Record<Tone, string> = {
|
||||
violet: 'bg-violet-200',
|
||||
amber: 'bg-amber-200',
|
||||
emerald: 'bg-emerald-200',
|
||||
sky: 'bg-sky-200',
|
||||
rose: 'bg-rose-200',
|
||||
fuchsia: 'bg-fuchsia-200',
|
||||
cyan: 'bg-cyan-200',
|
||||
};
|
||||
|
||||
const hasLimit = computed(() => props.limit !== undefined);
|
||||
|
||||
const percentage = computed(() => {
|
||||
if (! hasLimit.value || props.limit === 0) {
|
||||
return 0;
|
||||
}
|
||||
return Math.min(100, (props.current / (props.limit as number)) * 100);
|
||||
});
|
||||
|
||||
const isOverLimit = computed(
|
||||
() => hasLimit.value && props.current >= (props.limit as number),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-4 rounded-xl border-2 border-foreground bg-card p-5 shadow-2xs">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<p class="text-[11px] font-black uppercase tracking-widest text-foreground/60">
|
||||
{{ label }}
|
||||
</p>
|
||||
<span
|
||||
:class="[
|
||||
'inline-flex size-10 shrink-0 items-center justify-center rounded-2xl border-2 border-foreground shadow-2xs',
|
||||
TONE_BG[tone],
|
||||
rotate,
|
||||
]"
|
||||
>
|
||||
<component :is="icon" class="size-5 text-foreground" stroke-width="2" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="space-y-3">
|
||||
<p class="tabular-nums">
|
||||
<span
|
||||
class="text-3xl font-bold tracking-tight"
|
||||
:class="isOverLimit ? 'text-rose-600' : 'text-foreground'"
|
||||
>{{ formatNumber(current) }}</span>
|
||||
<span v-if="hasLimit" class="text-base font-bold text-foreground/40">
|
||||
/ {{ formatNumber(limit as number) }}
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<div
|
||||
v-if="hasLimit"
|
||||
class="h-2 overflow-hidden rounded-full border-2 border-foreground bg-foreground/5"
|
||||
>
|
||||
<div
|
||||
class="h-full rounded-full transition-all duration-700 ease-out"
|
||||
:class="isOverLimit ? 'bg-rose-400' : 'bg-violet-400'"
|
||||
:style="{ width: `${percentage}%` }"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
|
||||
type Props = {
|
||||
label: string;
|
||||
current: number;
|
||||
limit?: number;
|
||||
};
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const RING_RADIUS = 8;
|
||||
const RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS;
|
||||
|
||||
const hasLimit = computed(() => props.limit !== undefined);
|
||||
|
||||
const percentage = computed(() => {
|
||||
if (!hasLimit.value || props.limit === 0) {
|
||||
return 0;
|
||||
}
|
||||
return Math.min(100, (props.current / (props.limit as number)) * 100);
|
||||
});
|
||||
|
||||
const isOverLimit = computed(
|
||||
() => hasLimit.value && props.current >= (props.limit as number),
|
||||
);
|
||||
|
||||
const dashoffset = computed(
|
||||
() => RING_CIRCUMFERENCE * (1 - percentage.value / 100),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex items-center gap-3 py-3">
|
||||
<svg class="size-5 shrink-0 -rotate-90" viewBox="0 0 20 20">
|
||||
<circle
|
||||
cx="10"
|
||||
cy="10"
|
||||
:r="RING_RADIUS"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2.5"
|
||||
class="opacity-10"
|
||||
/>
|
||||
<circle
|
||||
v-if="hasLimit"
|
||||
cx="10"
|
||||
cy="10"
|
||||
:r="RING_RADIUS"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2.5"
|
||||
stroke-linecap="round"
|
||||
class="transition-all duration-700 ease-out"
|
||||
:class="isOverLimit ? 'text-destructive' : ''"
|
||||
:stroke-dasharray="RING_CIRCUMFERENCE"
|
||||
:stroke-dashoffset="dashoffset"
|
||||
/>
|
||||
</svg>
|
||||
<span class="text-sm">{{ label }}</span>
|
||||
<span class="ml-auto text-sm tabular-nums">
|
||||
<span
|
||||
class="font-medium"
|
||||
:class="isOverLimit ? 'text-destructive' : ''"
|
||||
>
|
||||
{{ formatNumber(current) }}
|
||||
</span>
|
||||
<span v-if="hasLimit" class="text-muted-foreground">
|
||||
/ {{ formatNumber(limit as number) }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -14,7 +14,7 @@ const props = withDefaults(defineProps<PrimitiveProps & { class?: HTMLAttributes
|
|||
data-slot="breadcrumb-link"
|
||||
:as="as"
|
||||
:as-child="asChild"
|
||||
:class="cn('hover:text-foreground transition-colors', props.class)"
|
||||
:class="cn('text-[11px] font-black uppercase tracking-widest text-foreground/60 transition-colors hover:text-foreground', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</Primitive>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const props = defineProps<{
|
|||
<template>
|
||||
<ol
|
||||
data-slot="breadcrumb-list"
|
||||
:class="cn('text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5', props.class)"
|
||||
:class="cn('flex flex-wrap items-center gap-2 break-words sm:gap-3', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</ol>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ const props = defineProps<{
|
|||
role="link"
|
||||
aria-disabled="true"
|
||||
aria-current="page"
|
||||
:class="cn('text-foreground font-normal', props.class)"
|
||||
style="font-family: var(--font-display)"
|
||||
:class="cn('text-base leading-none text-foreground', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ const props = defineProps<{
|
|||
data-slot="breadcrumb-separator"
|
||||
role="presentation"
|
||||
aria-hidden="true"
|
||||
:class="cn('[&>svg]:size-3.5', props.class)"
|
||||
:class="cn('inline-flex items-center text-foreground/30 [&>svg]:size-3.5', props.class)"
|
||||
>
|
||||
<slot>
|
||||
<IconChevronRight />
|
||||
<IconChevronRight stroke-width="2.5" />
|
||||
</slot>
|
||||
</li>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import {
|
|||
getLocalTimeZone,
|
||||
} from "@internationalized/date"
|
||||
import { IconCalendar } from "@tabler/icons-vue"
|
||||
import { trans } from "laravel-vue-i18n"
|
||||
import { computed, nextTick, ref, watch } from "vue"
|
||||
import { useWindowSize } from "@vueuse/core"
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
|
@ -20,6 +21,7 @@ import dayjs from "@/dayjs"
|
|||
|
||||
const props = defineProps<{
|
||||
modelValue: { start: Date, end: Date }
|
||||
triggerClass?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
@ -54,25 +56,25 @@ const range = (start: dayjs.Dayjs, end: dayjs.Dayjs) => ({
|
|||
end: toCalendarDate(end.toDate()),
|
||||
})
|
||||
|
||||
const presetGroups = [
|
||||
const presetGroups = computed(() => [
|
||||
[
|
||||
{ label: "Today", getValue: () => range(dayjs(), dayjs()) },
|
||||
{ label: "Yesterday", getValue: () => range(dayjs().subtract(1, "day"), dayjs().subtract(1, "day")) },
|
||||
{ label: trans('common.date_range_picker.today'), getValue: () => range(dayjs(), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.yesterday'), getValue: () => range(dayjs().subtract(1, "day"), dayjs().subtract(1, "day")) },
|
||||
],
|
||||
[
|
||||
{ label: "Last 7 days", getValue: () => range(dayjs().subtract(6, "day"), dayjs()) },
|
||||
{ label: "Last 30 days", getValue: () => range(dayjs().subtract(29, "day"), dayjs()) },
|
||||
{ label: "Last 3 months", getValue: () => range(dayjs().subtract(3, "month"), dayjs()) },
|
||||
{ label: "Last 6 months", getValue: () => range(dayjs().subtract(6, "month"), dayjs()) },
|
||||
{ label: "Last 12 months", getValue: () => range(dayjs().subtract(12, "month").add(1, "day"), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.last_7_days'), getValue: () => range(dayjs().subtract(6, "day"), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.last_30_days'), getValue: () => range(dayjs().subtract(29, "day"), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.last_3_months'), getValue: () => range(dayjs().subtract(3, "month"), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.last_6_months'), getValue: () => range(dayjs().subtract(6, "month"), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.last_12_months'), getValue: () => range(dayjs().subtract(12, "month").add(1, "day"), dayjs()) },
|
||||
],
|
||||
[
|
||||
{ label: "This month", getValue: () => range(dayjs().startOf("month"), dayjs().endOf("month")) },
|
||||
{ label: "Last month", getValue: () => range(dayjs().subtract(1, "month").startOf("month"), dayjs().subtract(1, "month").endOf("month")) },
|
||||
{ label: "Year to date", getValue: () => range(dayjs().startOf("year"), dayjs()) },
|
||||
{ label: "Last year", getValue: () => range(dayjs().subtract(1, "year").startOf("year"), dayjs().subtract(1, "year").endOf("year")) },
|
||||
{ label: trans('common.date_range_picker.this_month'), getValue: () => range(dayjs().startOf("month"), dayjs().endOf("month")) },
|
||||
{ label: trans('common.date_range_picker.last_month'), getValue: () => range(dayjs().subtract(1, "month").startOf("month"), dayjs().subtract(1, "month").endOf("month")) },
|
||||
{ label: trans('common.date_range_picker.year_to_date'), getValue: () => range(dayjs().startOf("year"), dayjs()) },
|
||||
{ label: trans('common.date_range_picker.last_year'), getValue: () => range(dayjs().subtract(1, "year").startOf("year"), dayjs().subtract(1, "year").endOf("year")) },
|
||||
],
|
||||
]
|
||||
])
|
||||
|
||||
type Preset = { label: string, getValue: () => { start: any, end: any } }
|
||||
|
||||
|
|
@ -118,37 +120,38 @@ watch(
|
|||
<Button
|
||||
variant="outline"
|
||||
:class="cn(
|
||||
'w-full justify-start text-left font-normal sm:w-auto',
|
||||
!value && 'text-muted-foreground',
|
||||
'w-full justify-start text-left font-medium sm:w-auto',
|
||||
!value && 'text-foreground/60',
|
||||
props.triggerClass,
|
||||
)"
|
||||
>
|
||||
<template v-if="value.start">
|
||||
<template v-if="value.end">
|
||||
{{ dayjs(toDate(value.start)).format('MMM D, YYYY') }} -
|
||||
{{ dayjs(toDate(value.end)).format('MMM D, YYYY') }}
|
||||
{{ dayjs(toDate(value.start)).format('D MMM YYYY') }} -
|
||||
{{ dayjs(toDate(value.end)).format('D MMM YYYY') }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ dayjs(toDate(value.start)).format('MMM D, YYYY') }}
|
||||
{{ dayjs(toDate(value.start)).format('D MMM YYYY') }}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
Pick a date range
|
||||
{{ $t('common.date_range_picker.placeholder') }}
|
||||
</template>
|
||||
<IconCalendar class="ml-auto size-4 opacity-50" />
|
||||
<IconCalendar class="ml-auto size-4 text-foreground/60" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent class="w-auto p-0" align="end">
|
||||
<div class="flex flex-col sm:flex-row">
|
||||
<div class="hidden flex-col border-b border-border py-2 sm:flex sm:w-[150px] sm:shrink-0 sm:border-b-0 sm:border-r">
|
||||
<div class="hidden flex-col border-b-2 border-foreground py-2 sm:flex sm:w-[170px] sm:shrink-0 sm:border-b-0 sm:border-r-2">
|
||||
<template v-for="(group, groupIndex) in presetGroups" :key="groupIndex">
|
||||
<div v-if="groupIndex > 0" class="border-t border-border my-1" />
|
||||
<div v-if="groupIndex > 0" class="my-1 border-t-2 border-dashed border-foreground/20" />
|
||||
<div class="space-y-0.5 px-2">
|
||||
<Button
|
||||
v-for="preset in group"
|
||||
:key="preset.label"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
class="w-full justify-start text-xs font-normal h-7"
|
||||
class="h-7 w-full justify-start text-xs font-bold text-foreground hover:bg-violet-100 hover:text-foreground"
|
||||
@click="applyPreset(preset)"
|
||||
>
|
||||
{{ preset.label }}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,10 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|||
:class="cn('p-3', props.class)"
|
||||
v-bind="forwarded"
|
||||
>
|
||||
<RangeCalendarHeader>
|
||||
<RangeCalendarHeader class="justify-between gap-2">
|
||||
<RangeCalendarPrevButton />
|
||||
<RangeCalendarHeading />
|
||||
|
||||
<div class="flex items-center gap-1">
|
||||
<RangeCalendarPrevButton />
|
||||
<RangeCalendarNextButton />
|
||||
</div>
|
||||
<RangeCalendarNextButton />
|
||||
</RangeCalendarHeader>
|
||||
|
||||
<div class="flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|||
<template>
|
||||
<RangeCalendarCell
|
||||
data-slot="range-calendar-cell"
|
||||
:class="cn('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-accent first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md', props.class)"
|
||||
:class="cn('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-violet-100 first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md', props.class)"
|
||||
v-bind="forwardedProps"
|
||||
>
|
||||
<slot />
|
||||
|
|
|
|||
|
|
@ -20,16 +20,17 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|||
data-slot="range-calendar-trigger"
|
||||
:class="cn(
|
||||
buttonVariants({ variant: 'ghost' }),
|
||||
'h-8 w-8 p-0 font-normal data-[selected]:opacity-100',
|
||||
'[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground',
|
||||
// Selection Start
|
||||
'data-[selection-start]:bg-primary data-[selection-start]:text-primary-foreground data-[selection-start]:hover:bg-primary data-[selection-start]:hover:text-primary-foreground data-[selection-start]:focus:bg-primary data-[selection-start]:focus:text-primary-foreground',
|
||||
// Selection End
|
||||
'data-[selection-end]:bg-primary data-[selection-end]:text-primary-foreground data-[selection-end]:hover:bg-primary data-[selection-end]:hover:text-primary-foreground data-[selection-end]:focus:bg-primary data-[selection-end]:focus:text-primary-foreground',
|
||||
'size-8 cursor-pointer p-0 font-medium hover:bg-foreground/5 data-[selected]:opacity-100',
|
||||
// Today (not selected): violet pastel pill
|
||||
'[&[data-today]:not([data-selected])]:bg-violet-100 [&[data-today]:not([data-selected])]:text-foreground [&[data-today]:not([data-selected])]:font-bold',
|
||||
// Selection start: ink primary pill
|
||||
'data-[selection-start]:bg-primary data-[selection-start]:text-primary-foreground data-[selection-start]:font-bold data-[selection-start]:hover:bg-primary data-[selection-start]:hover:text-primary-foreground data-[selection-start]:focus:bg-primary data-[selection-start]:focus:text-primary-foreground',
|
||||
// Selection end
|
||||
'data-[selection-end]:bg-primary data-[selection-end]:text-primary-foreground data-[selection-end]:font-bold data-[selection-end]:hover:bg-primary data-[selection-end]:hover:text-primary-foreground data-[selection-end]:focus:bg-primary data-[selection-end]:focus:text-primary-foreground',
|
||||
// Outside months
|
||||
'data-[outside-view]:text-muted-foreground',
|
||||
'data-[outside-view]:text-foreground/40',
|
||||
// Disabled
|
||||
'data-[disabled]:text-muted-foreground data-[disabled]:opacity-50',
|
||||
'data-[disabled]:text-foreground/40 data-[disabled]:opacity-50',
|
||||
// Unavailable
|
||||
'data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through',
|
||||
props.class,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|||
<template>
|
||||
<RangeCalendarHeadCell
|
||||
data-slot="range-calendar-head-cell"
|
||||
:class="cn('w-8 rounded-md text-[0.8rem] font-normal text-muted-foreground', props.class)"
|
||||
:class="cn('w-8 rounded-md text-[0.7rem] font-bold uppercase tracking-wider text-foreground/60', props.class)"
|
||||
v-bind="forwardedProps"
|
||||
>
|
||||
<slot />
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|||
<RangeCalendarHeading
|
||||
v-slot="{ headingValue }"
|
||||
data-slot="range-calendar-heading"
|
||||
:class="cn('text-sm font-medium', props.class)"
|
||||
:class="cn('text-sm font-bold capitalize text-foreground', props.class)"
|
||||
v-bind="forwardedProps"
|
||||
>
|
||||
<slot :heading-value>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|||
data-slot="range-calendar-next-button"
|
||||
:class="cn(
|
||||
buttonVariants({ variant: 'outline' }),
|
||||
'absolute right-1',
|
||||
'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
|
||||
'size-7 p-0',
|
||||
props.class,
|
||||
)"
|
||||
v-bind="forwardedProps"
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|||
data-slot="range-calendar-prev-button"
|
||||
:class="cn(
|
||||
buttonVariants({ variant: 'outline' }),
|
||||
'absolute left-1',
|
||||
'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
|
||||
'size-7 p-0',
|
||||
props.class,
|
||||
)"
|
||||
v-bind="forwardedProps"
|
||||
|
|
|
|||
|
|
@ -1,22 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
import AppLayout from '@/layouts/app/AppSidebarLayout.vue';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
type Props = {
|
||||
title?: string;
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
fullWidth?: boolean;
|
||||
};
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
title: '',
|
||||
breadcrumbs: () => [],
|
||||
fullWidth: false,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :title="title" :breadcrumbs="breadcrumbs" :full-width="fullWidth">
|
||||
<AppLayout :full-width="fullWidth">
|
||||
<template v-if="$slots['header']" #header>
|
||||
<slot name="header" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -5,23 +5,18 @@ import { onBeforeUnmount, onMounted } from 'vue';
|
|||
import AppHeader from '@/components/AppHeader.vue';
|
||||
import AppSidebar from '@/components/AppSidebar.vue';
|
||||
import Toast from '@/components/Toast.vue';
|
||||
import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';
|
||||
import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
|
||||
import UpgradeDialog from '@/components/UpgradeDialog.vue';
|
||||
import { heartbeat as heartbeatRoute } from '@/routes/app/presence';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
const page = usePage();
|
||||
const isOpen = page.props.sidebarOpen;
|
||||
|
||||
type Props = {
|
||||
title?: string;
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
fullWidth?: boolean;
|
||||
};
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
title: '',
|
||||
breadcrumbs: () => [],
|
||||
fullWidth: false,
|
||||
});
|
||||
|
||||
|
|
@ -48,11 +43,7 @@ onBeforeUnmount(() => {
|
|||
<SidebarProvider :default-open="isOpen">
|
||||
<AppSidebar />
|
||||
<SidebarInset class="overflow-x-hidden">
|
||||
<AppHeader
|
||||
v-if="$slots['header'] || $slots['header-actions'] || title || breadcrumbs.length > 0"
|
||||
:title="$slots['header'] ? '' : title"
|
||||
:breadcrumbs="breadcrumbs"
|
||||
>
|
||||
<AppHeader v-if="$slots['header'] || $slots['header-actions']">
|
||||
<template v-if="$slots['header']" #left>
|
||||
<slot name="header" />
|
||||
</template>
|
||||
|
|
@ -60,6 +51,10 @@ onBeforeUnmount(() => {
|
|||
<slot name="header-actions" />
|
||||
</template>
|
||||
</AppHeader>
|
||||
<SidebarTrigger
|
||||
v-else
|
||||
class="absolute left-2 top-2 z-30 size-9 rounded-md border-2 border-foreground bg-card text-foreground shadow-2xs md:hidden"
|
||||
/>
|
||||
<div
|
||||
:class="
|
||||
fullWidth
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import date from '@/date';
|
|||
import debounce from '@/debounce';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { disconnect as disconnectAccount, toggle as toggleAccount } from '@/routes/app/accounts';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface SocialAccount {
|
||||
id: string;
|
||||
|
|
@ -75,8 +74,6 @@ interface Props {
|
|||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [{ title: trans('accounts.page_title') }]);
|
||||
|
||||
const isAddDialogOpen = ref(false);
|
||||
const deleteModal = ref<InstanceType<typeof ConfirmDeleteModal> | null>(null);
|
||||
const searchQuery = ref(props.filters.search);
|
||||
|
|
@ -128,8 +125,8 @@ const handleDisconnect = (accountId: string) => {
|
|||
<template>
|
||||
<Head :title="$t('accounts.page_title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="flex h-full flex-1 flex-col gap-4 p-4">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col gap-6 px-6 py-8">
|
||||
<PageHeader :title="$t('accounts.page_title')" />
|
||||
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Head } from '@inertiajs/vue3';
|
|||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import AnalyticsSidebar, { type AnalyticsAccount } from '@/components/analytics/AnalyticsSidebar.vue';
|
||||
import AnalyticsAccountSelector from '@/components/analytics/AnalyticsAccountSelector.vue';
|
||||
import FacebookAnalytics from '@/components/analytics/FacebookAnalytics.vue';
|
||||
import InstagramAnalytics from '@/components/analytics/InstagramAnalytics.vue';
|
||||
import LinkedInPageAnalytics from '@/components/analytics/LinkedInPageAnalytics.vue';
|
||||
|
|
@ -12,19 +12,16 @@ import ThreadsAnalytics from '@/components/analytics/ThreadsAnalytics.vue';
|
|||
import TikTokAnalytics from '@/components/analytics/TikTokAnalytics.vue';
|
||||
import XAnalytics from '@/components/analytics/XAnalytics.vue';
|
||||
import YouTubeAnalytics from '@/components/analytics/YouTubeAnalytics.vue';
|
||||
import type { AnalyticsAccount } from '@/components/analytics/types';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import { DateRangePicker } from '@/components/ui/date-range-picker';
|
||||
import dayjs from '@/dayjs';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
const props = defineProps<{
|
||||
accounts: AnalyticsAccount[];
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('sidebar.analytics') },
|
||||
]);
|
||||
|
||||
const selectedAccountId = ref<string | null>(props.accounts[0]?.id ?? null);
|
||||
|
||||
const dateRange = ref({
|
||||
|
|
@ -43,77 +40,83 @@ const platformSupportsDateRange = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :breadcrumbs="breadcrumbs" :full-width="true">
|
||||
<template #header-actions>
|
||||
<DateRangePicker v-if="platformSupportsDateRange" v-model="dateRange" />
|
||||
</template>
|
||||
|
||||
<AppLayout>
|
||||
<Head :title="trans('sidebar.analytics')" />
|
||||
|
||||
<div class="flex h-full">
|
||||
<AnalyticsSidebar
|
||||
:accounts="accounts"
|
||||
:selected-id="selectedAccountId"
|
||||
@select="selectedAccountId = $event"
|
||||
<div class="mx-auto flex h-full w-full max-w-6xl flex-col gap-6 px-6 py-8">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<PageHeader :title="$t('sidebar.analytics')" />
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<AnalyticsAccountSelector
|
||||
:accounts="accounts"
|
||||
:selected-id="selectedAccountId"
|
||||
@select="selectedAccountId = $event"
|
||||
/>
|
||||
<DateRangePicker
|
||||
v-if="platformSupportsDateRange"
|
||||
v-model="dateRange"
|
||||
trigger-class="h-auto gap-3 px-3 py-3 text-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="accounts.length === 0" class="flex flex-1 items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_accounts') }}
|
||||
</div>
|
||||
|
||||
<div v-else-if="!selectedAccountId" class="flex flex-1 items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.select_account') }}
|
||||
</div>
|
||||
|
||||
<TikTokAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'tiktok'"
|
||||
:account-id="selectedAccountId"
|
||||
/>
|
||||
|
||||
<div class="flex min-w-0 flex-1 flex-col">
|
||||
<div class="flex-1 overflow-y-auto p-6">
|
||||
<div v-if="!selectedAccountId" class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.select_account') }}
|
||||
</div>
|
||||
<InstagramAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'instagram' || selectedAccount?.platform === 'instagram-facebook'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<TikTokAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'tiktok'"
|
||||
:account-id="selectedAccountId"
|
||||
/>
|
||||
<ThreadsAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'threads'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<InstagramAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'instagram' || selectedAccount?.platform === 'instagram-facebook'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
<FacebookAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'facebook'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<ThreadsAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'threads'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
<XAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'x'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<FacebookAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'facebook'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
<LinkedInPageAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'linkedin-page'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<XAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'x'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
<PinterestAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'pinterest'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<LinkedInPageAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'linkedin-page'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
<YouTubeAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'youtube'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<PinterestAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'pinterest'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<YouTubeAnalytics
|
||||
v-else-if="selectedAccount?.platform === 'youtube'"
|
||||
:account-id="selectedAccountId"
|
||||
:date-range="dateRange"
|
||||
/>
|
||||
|
||||
<div v-else class="flex h-full items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="flex flex-1 items-center justify-center text-sm font-medium text-foreground/60">
|
||||
{{ $t('analytics.no_data') }}
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
|
|
|
|||
|
|
@ -6,16 +6,13 @@ import { computed } from 'vue';
|
|||
import GalleryBrowser from '@/components/assets/GalleryBrowser.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [{ title: trans('assets.title') }]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="$t('assets.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="flex h-full flex-1 flex-col gap-4 p-4">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col gap-6 px-6 py-8">
|
||||
<PageHeader :title="$t('assets.title')" />
|
||||
<GalleryBrowser mode="standalone" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import dayjs from '@/dayjs';
|
|||
import debounce from '@/debounce';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { destroy as labelsDestroy, index as labelsIndex } from '@/routes/app/labels';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Label {
|
||||
id: string;
|
||||
|
|
@ -57,10 +56,6 @@ const search = debounce(() => {
|
|||
|
||||
watch(searchQuery, () => search());
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('labels.title') },
|
||||
]);
|
||||
|
||||
const deleteModal = ref<InstanceType<typeof ConfirmDeleteModal> | null>(null);
|
||||
const isCreateDialogOpen = ref(false);
|
||||
const isEditDialogOpen = ref(false);
|
||||
|
|
@ -86,8 +81,8 @@ const hasActiveSearch = computed(() => Boolean(searchQuery.value?.trim()));
|
|||
<template>
|
||||
<Head :title="$t('labels.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="flex h-full flex-1 flex-col gap-4 p-4">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col gap-6 px-6 py-8">
|
||||
<PageHeader :title="$t('labels.title')" :description="$t('labels.description')" />
|
||||
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
|
|
|
|||
|
|
@ -50,11 +50,6 @@ const startFromScratch = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const breadcrumbs = computed(() => [
|
||||
{ title: trans('sidebar.posts.calendar'), href: calendar.url() },
|
||||
{ title: trans('posts.create.title'), href: '' },
|
||||
]);
|
||||
|
||||
const pageTitle = computed(() => trans('posts.create.title'));
|
||||
|
||||
const stepHeader = computed(() => {
|
||||
|
|
@ -69,7 +64,7 @@ const stepHeader = computed(() => {
|
|||
<template>
|
||||
<Head :title="pageTitle" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col p-4">
|
||||
<div class="mx-auto flex w-full max-w-2xl flex-col gap-6">
|
||||
<PageHeader :title="stepHeader.title" :description="stepHeader.description" />
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import dayjs from '@/dayjs';
|
|||
import debounce from '@/debounce';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { destroy as destroyPost, index as postsIndex, update as updatePost } from '@/routes/app/posts';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface MediaItem {
|
||||
id: string;
|
||||
|
|
@ -103,11 +102,6 @@ const props = defineProps<{
|
|||
|
||||
const post = computed(() => props.post);
|
||||
const isReadOnly = computed(() => ['publishing', 'published', 'partially_published'].includes(post.value.status));
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('posts.title'), href: postsIndex.url() },
|
||||
{ title: trans('posts.edit.title') },
|
||||
]);
|
||||
const isPublishing = computed(() => post.value.status === 'publishing');
|
||||
const isPublished = computed(() => ['published', 'partially_published'].includes(post.value.status));
|
||||
const isScheduled = computed(() => post.value.status === 'scheduled');
|
||||
|
|
@ -445,7 +439,7 @@ useEcho(`post.${post.value.id}`, '.PostCommentCreated', (e: any) => {
|
|||
<template>
|
||||
<Head :title="$t('posts.edit.title')" />
|
||||
|
||||
<AppLayout :full-width="true" :breadcrumbs="breadcrumbs">
|
||||
<AppLayout :full-width="true">
|
||||
<template #header-actions>
|
||||
<span v-if="isSaving" class="flex items-center gap-1.5 text-xs font-semibold text-foreground/70">
|
||||
<IconLoader2 class="size-3.5 animate-spin" />
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ import dayjs from '@/dayjs';
|
|||
import debounce from '@/debounce';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { copyToClipboard } from '@/lib/utils';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface SocialAccount {
|
||||
id: string;
|
||||
platform: string;
|
||||
|
|
@ -117,14 +115,6 @@ const pageTitle = computed(() => {
|
|||
return trans('posts.all_posts');
|
||||
});
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => {
|
||||
const items: BreadcrumbItem[] = [{ title: trans('posts.title'), href: postsIndex.url() }];
|
||||
if (props.currentStatus) {
|
||||
items.push({ title: trans(`posts.status.${props.currentStatus}`) });
|
||||
}
|
||||
return items;
|
||||
});
|
||||
|
||||
const formatDateTime = (date: string | null): string => {
|
||||
if (!date) return '—';
|
||||
return dayjs.utc(date).local().format('D MMM YYYY, HH:mm');
|
||||
|
|
@ -158,8 +148,8 @@ const hasActiveSearch = computed(() => Boolean(searchQuery.value?.trim()));
|
|||
<template>
|
||||
<Head :title="pageTitle" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="flex h-full flex-1 flex-col gap-4 p-4">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col gap-6 px-6 py-8">
|
||||
<PageHeader :title="pageTitle" />
|
||||
|
||||
<!-- Toolbar -->
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import { getPlatformStatusConfig, getPostStatusConfig } from '@/composables/useP
|
|||
import dayjs from '@/dayjs';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { index as postsIndex } from '@/routes/app/posts';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface MediaItem {
|
||||
id: string;
|
||||
|
|
@ -83,15 +82,6 @@ const pageTitle = computed(() => {
|
|||
return snippet ? `${trans('posts.show.title')} · ${snippet}${props.post.content.length > 60 ? '…' : ''}` : trans('posts.show.title');
|
||||
});
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('posts.title'), href: postsIndex.url() },
|
||||
{
|
||||
title: trans(`posts.status.${props.post.status}`),
|
||||
href: postsIndex.url(props.post.status),
|
||||
},
|
||||
{ title: trans('posts.show.title') },
|
||||
]);
|
||||
|
||||
const getDisplayName = (pp: PostPlatform): string => pp.display_name ?? pp.platform;
|
||||
|
||||
const getDisplayUsername = (pp: PostPlatform): string | null => pp.display_username;
|
||||
|
|
@ -123,7 +113,7 @@ useEcho(`post.${props.post.id}`, '.PostPlatformStatusUpdated', () => {
|
|||
<template>
|
||||
<Head :title="pageTitle" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs" full-width>
|
||||
<AppLayout full-width>
|
||||
<!-- Publishing state: clean centered loader, nothing else visible. -->
|
||||
<div v-if="isPublishing" class="flex flex-1 flex-col items-center justify-center gap-4 p-6">
|
||||
<div class="inline-flex size-14 -rotate-3 items-center justify-center rounded-2xl border-2 border-foreground bg-violet-200 shadow-2xs">
|
||||
|
|
|
|||
|
|
@ -168,19 +168,14 @@ const applyTemplate = async (template: PostTemplate) => {
|
|||
}
|
||||
};
|
||||
|
||||
const breadcrumbs = computed(() => [
|
||||
{ title: trans('sidebar.posts.calendar'), href: calendar.url() },
|
||||
{ title: trans('posts.templates.browser_title'), href: '' },
|
||||
]);
|
||||
|
||||
const pageTitle = computed(() => trans('posts.templates.browser_title'));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="pageTitle" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="flex h-full flex-1 flex-col gap-4 p-4">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col gap-6 px-6 py-8">
|
||||
<PageHeader :title="pageTitle" :description="$t('posts.templates.browser_description')" />
|
||||
|
||||
<!-- Filters: platform + search -->
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { Head, Link } from '@inertiajs/vue3';
|
||||
import { IconBuildingCommunity, IconChevronRight, IconCreditCard, IconUser } from '@tabler/icons-vue';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { edit as accountEdit } from '@/routes/app/account';
|
||||
import { edit as profileEdit } from '@/routes/app/profile';
|
||||
import { settings as workspaceSettings } from '@/routes/app/workspace';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Permissions {
|
||||
canManageProfile: boolean;
|
||||
|
|
@ -19,25 +16,17 @@ interface Permissions {
|
|||
defineProps<{
|
||||
permissions: Permissions;
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title') },
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="$t('settings.hub.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<div class="space-y-2">
|
||||
<h1 class="text-3xl text-foreground" style="font-family: var(--font-display)">
|
||||
{{ $t('settings.hub.title') }}
|
||||
</h1>
|
||||
<p class="text-sm text-foreground/70">
|
||||
{{ $t('settings.hub.description') }}
|
||||
</p>
|
||||
</div>
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
<Link
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { computed } from 'vue';
|
|||
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
|
|
@ -14,7 +15,6 @@ import { settings as settingsHub } from '@/routes/app';
|
|||
import { edit as accountEdit, update as accountUpdate } from '@/routes/app/account';
|
||||
import { index as billingIndex } from '@/routes/app/billing';
|
||||
import { index as usageIndex } from '@/routes/app/usage';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface AccountData {
|
||||
id: string;
|
||||
|
|
@ -27,11 +27,6 @@ defineProps<{
|
|||
selfHosted: boolean;
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.account.title') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'account', label: trans('settings.account.tabs.account'), href: accountEdit().url },
|
||||
{ name: 'usage', label: trans('settings.account.tabs.usage'), href: usageIndex().url },
|
||||
|
|
@ -42,8 +37,13 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('settings.account.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-6 px-4 py-6">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="account" />
|
||||
|
||||
<section class="space-y-12">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { IconDownload, IconFileText } from '@tabler/icons-vue';
|
|||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
|
@ -14,7 +15,6 @@ import { settings as settingsHub } from '@/routes/app';
|
|||
import { edit as accountEdit } from '@/routes/app/account';
|
||||
import { index as billingIndex, portal } from '@/routes/app/billing';
|
||||
import { index as usageIndex } from '@/routes/app/usage';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Plan {
|
||||
name: string;
|
||||
|
|
@ -52,12 +52,6 @@ defineProps<{
|
|||
defaultPaymentMethod: PaymentMethod | null;
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.account.title'), href: accountEdit().url },
|
||||
{ title: trans('settings.account.tabs.billing') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'account', label: trans('settings.account.tabs.account'), href: accountEdit().url },
|
||||
{ name: 'usage', label: trans('settings.account.tabs.usage'), href: usageIndex().url },
|
||||
|
|
@ -75,8 +69,13 @@ const { openUpgrade } = useUpgradeDialog();
|
|||
<template>
|
||||
<Head :title="$t('billing.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-6 px-4 py-6">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="billing" />
|
||||
|
||||
<section class="space-y-12">
|
||||
|
|
|
|||
|
|
@ -1,16 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
import {
|
||||
IconAffiliate,
|
||||
IconBuildingCommunity,
|
||||
IconSparkles,
|
||||
IconUsers,
|
||||
} from '@tabler/icons-vue';
|
||||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import UsageMetricRow from '@/components/settings/UsageMetricRow.vue';
|
||||
import UsageMetricCard from '@/components/settings/UsageMetricCard.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { settings as settingsHub } from '@/routes/app';
|
||||
import { edit as accountEdit } from '@/routes/app/account';
|
||||
import { index as billingIndex } from '@/routes/app/billing';
|
||||
import { index as usageIndex } from '@/routes/app/usage';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Plan {
|
||||
name: string;
|
||||
|
|
@ -33,12 +40,6 @@ defineProps<{
|
|||
usage: UsageData;
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.account.title'), href: accountEdit().url },
|
||||
{ title: trans('settings.account.tabs.usage') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'account', label: trans('settings.account.tabs.account'), href: accountEdit().url },
|
||||
{ name: 'usage', label: trans('settings.account.tabs.usage'), href: usageIndex().url },
|
||||
|
|
@ -49,53 +50,66 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('usage.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-6 px-4 py-6">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="usage" />
|
||||
|
||||
<section class="space-y-12">
|
||||
<div class="grid grid-cols-1 gap-8 md:grid-cols-[280px_1fr] md:gap-16">
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold tracking-tight">{{ $t('usage.section_account') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
{{ $t('usage.section_account_description', { plan: plan?.name ?? 'Free' }) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<HeadingSmall
|
||||
:title="$t('usage.section_account')"
|
||||
:description="$t('usage.section_account_description', { plan: plan?.name ?? 'Free' })"
|
||||
/>
|
||||
|
||||
<div class="divide-y">
|
||||
<UsageMetricRow
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<UsageMetricCard
|
||||
:label="$t('usage.workspaces')"
|
||||
:icon="IconBuildingCommunity"
|
||||
:current="usage.workspaceCount"
|
||||
:limit="usage.workspaceLimit"
|
||||
tone="violet"
|
||||
rotate="-rotate-2"
|
||||
/>
|
||||
|
||||
<UsageMetricRow
|
||||
<UsageMetricCard
|
||||
:label="$t('usage.social_accounts')"
|
||||
:icon="IconAffiliate"
|
||||
:current="usage.socialAccountCount"
|
||||
:limit="usage.socialAccountLimit"
|
||||
tone="amber"
|
||||
rotate="rotate-1"
|
||||
/>
|
||||
|
||||
<UsageMetricRow
|
||||
<UsageMetricCard
|
||||
:label="$t('usage.members')"
|
||||
:icon="IconUsers"
|
||||
:current="usage.memberCount"
|
||||
:limit="usage.memberLimit"
|
||||
tone="emerald"
|
||||
rotate="-rotate-1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-8 md:grid-cols-[280px_1fr] md:gap-16">
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold tracking-tight">{{ $t('usage.section_ai') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
{{ $t('usage.section_ai_description') }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<HeadingSmall
|
||||
:title="$t('usage.section_ai')"
|
||||
:description="$t('usage.section_ai_description')"
|
||||
/>
|
||||
|
||||
<div class="divide-y">
|
||||
<UsageMetricRow
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<UsageMetricCard
|
||||
:label="$t('usage.credits')"
|
||||
:icon="IconSparkles"
|
||||
:current="usage.creditsUsed"
|
||||
:limit="usage.monthlyCreditsLimit"
|
||||
tone="fuchsia"
|
||||
rotate="rotate-1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import AuthenticationController from '@/actions/App/Http/Controllers/App/Setting
|
|||
import DeleteUser from '@/components/DeleteUser.vue';
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
|
|
@ -29,7 +30,6 @@ import { settings as settingsHub } from '@/routes/app';
|
|||
import { connectProvider, edit as editAuthentication } from '@/routes/app/authentication';
|
||||
import { preferences as notificationPreferences } from '@/routes/app/notifications';
|
||||
import { edit as editProfile } from '@/routes/app/profile';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
type Session = {
|
||||
id: string;
|
||||
|
|
@ -52,12 +52,6 @@ const props = defineProps<{
|
|||
connectedAccounts: ConnectedAccount[];
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.profile.title'), href: editProfile().url },
|
||||
{ title: trans('settings.authentication.title') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'profile', label: trans('settings.nav.profile'), href: editProfile().url },
|
||||
{ name: 'authentication', label: trans('settings.nav.authentication'), href: editAuthentication().url },
|
||||
|
|
@ -83,8 +77,13 @@ const logoutDialogOpen = ref(false);
|
|||
<template>
|
||||
<Head :title="$t('settings.authentication.page_title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="authentication" />
|
||||
|
||||
<section class="space-y-12">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { trans } from 'laravel-vue-i18n';
|
|||
import { computed, ref } from 'vue';
|
||||
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
|
@ -13,7 +14,6 @@ import { settings as settingsHub } from '@/routes/app';
|
|||
import { edit as editAuthentication } from '@/routes/app/authentication';
|
||||
import { preferences as preferencesRoute } from '@/routes/app/notifications';
|
||||
import { edit as editProfile } from '@/routes/app/profile';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Preferences {
|
||||
post_published: boolean;
|
||||
|
|
@ -32,12 +32,6 @@ const postFailed = ref(props.preferences.post_failed);
|
|||
const accountDisconnected = ref(props.preferences.account_disconnected);
|
||||
const processing = ref(false);
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.profile.title'), href: editProfile().url },
|
||||
{ title: trans('settings.nav.notifications') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'profile', label: trans('settings.nav.profile'), href: editProfile().url },
|
||||
{ name: 'authentication', label: trans('settings.nav.authentication'), href: editAuthentication().url },
|
||||
|
|
@ -63,8 +57,13 @@ const submit = () => {
|
|||
<template>
|
||||
<Head :title="$t('settings.notifications.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="notifications" />
|
||||
|
||||
<section class="space-y-12">
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { computed } from 'vue';
|
|||
import ProfileController from '@/actions/App/Http/Controllers/App/Settings/ProfileController';
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import PhotoUpload from '@/components/PhotoUpload.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
|
@ -18,7 +19,6 @@ import { edit as editAuthentication } from '@/routes/app/authentication';
|
|||
import { preferences as notificationPreferences } from '@/routes/app/notifications';
|
||||
import { deletePhoto, edit as editProfile, uploadPhoto } from '@/routes/app/profile';
|
||||
import { send } from '@/routes/verification';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Props {
|
||||
mustVerifyEmail: boolean;
|
||||
|
|
@ -30,11 +30,6 @@ defineProps<Props>();
|
|||
const page = usePage();
|
||||
const user = computed(() => page.props.auth.user);
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.profile.title') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'profile', label: trans('settings.nav.profile'), href: editProfile().url },
|
||||
{ name: 'authentication', label: trans('settings.nav.authentication'), href: editAuthentication().url },
|
||||
|
|
@ -45,8 +40,13 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('settings.profile.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="profile" />
|
||||
|
||||
<section class="space-y-12">
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import CreateApiKeyDialog from '@/components/api-keys/CreateApiKeyDialog.vue';
|
|||
import ConfirmDeleteModal from '@/components/ConfirmDeleteModal.vue';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import HeadingSmall from '@/components/HeadingSmall.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
|
|
@ -32,7 +33,6 @@ import { copyToClipboard } from '@/lib/utils';
|
|||
import { members as membersRoute, settings as settingsHub } from '@/routes/app';
|
||||
import { index as apiKeysRoute } from '@/routes/app/api-keys';
|
||||
import { brand as brandRoute, settings as workspaceSettings } from '@/routes/app/workspace';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
interface ApiToken {
|
||||
id: string;
|
||||
name: string;
|
||||
|
|
@ -53,12 +53,6 @@ const newToken = computed(() => (page.props.flash as Record<string, unknown>)?.p
|
|||
const createDialogOpen = ref(false);
|
||||
const confirmDeleteModal = ref<InstanceType<typeof ConfirmDeleteModal> | null>(null);
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.workspace.title'), href: workspaceSettings.url() },
|
||||
{ title: trans('settings.workspace.tabs.api_keys') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'workspace', label: trans('settings.workspace.tabs.workspace'), href: workspaceSettings.url() },
|
||||
{ name: 'brand', label: trans('settings.workspace.tabs.brand'), href: brandRoute.url() },
|
||||
|
|
@ -70,8 +64,13 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('settings.api_keys.page_title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="api-keys" />
|
||||
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import { trans } from 'laravel-vue-i18n';
|
|||
import { computed } from 'vue';
|
||||
|
||||
import BrandTab from '@/components/settings/BrandTab.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { members as membersRoute, settings as settingsHub } from '@/routes/app';
|
||||
import { index as apiKeysRoute } from '@/routes/app/api-keys';
|
||||
import { brand as brandRoute, settings as workspaceSettings } from '@/routes/app/workspace';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Workspace {
|
||||
id: string;
|
||||
|
|
@ -30,12 +30,6 @@ defineProps<{
|
|||
availableFonts: string[];
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.workspace.title'), href: workspaceSettings.url() },
|
||||
{ title: trans('settings.workspace.tabs.brand') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'workspace', label: trans('settings.workspace.tabs.workspace'), href: workspaceSettings.url() },
|
||||
{ name: 'brand', label: trans('settings.workspace.tabs.brand'), href: brandRoute.url() },
|
||||
|
|
@ -47,8 +41,13 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('settings.workspace.tabs.brand')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="brand" />
|
||||
|
||||
<BrandTab :workspace="workspace" :available-fonts="availableFonts" />
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ import { Head } from '@inertiajs/vue3';
|
|||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import UsersTab from '@/components/settings/UsersTab.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { members as membersRoute, settings as settingsHub } from '@/routes/app';
|
||||
import { index as apiKeysRoute } from '@/routes/app/api-keys';
|
||||
import { brand as brandRoute, settings as workspaceSettings } from '@/routes/app/workspace';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Workspace {
|
||||
id: string;
|
||||
|
|
@ -42,12 +42,6 @@ defineProps<{
|
|||
roles: Role[];
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.workspace.title'), href: workspaceSettings.url() },
|
||||
{ title: trans('settings.workspace.tabs.users') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'workspace', label: trans('settings.workspace.tabs.workspace'), href: workspaceSettings.url() },
|
||||
{ name: 'brand', label: trans('settings.workspace.tabs.brand'), href: brandRoute.url() },
|
||||
|
|
@ -59,8 +53,13 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('settings.members.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="members" />
|
||||
|
||||
<UsersTab :members="members" :invitations="invites" />
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ import { Head } from '@inertiajs/vue3';
|
|||
import { trans } from 'laravel-vue-i18n';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import SettingsTabsNav from '@/components/settings/SettingsTabsNav.vue';
|
||||
import WorkspaceTab from '@/components/settings/WorkspaceTab.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { members as membersRoute, settings as settingsHub } from '@/routes/app';
|
||||
import { index as apiKeysRoute } from '@/routes/app/api-keys';
|
||||
import { brand as brandRoute, settings as workspaceSettings } from '@/routes/app/workspace';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Workspace {
|
||||
id: string;
|
||||
|
|
@ -27,11 +27,6 @@ defineProps<{
|
|||
workspace: Workspace;
|
||||
}>();
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('settings.hub.title'), href: settingsHub().url },
|
||||
{ title: trans('settings.workspace.title') },
|
||||
]);
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ name: 'workspace', label: trans('settings.workspace.tabs.workspace'), href: workspaceSettings.url() },
|
||||
{ name: 'brand', label: trans('settings.workspace.tabs.brand'), href: brandRoute.url() },
|
||||
|
|
@ -43,8 +38,13 @@ const tabs = computed(() => [
|
|||
<template>
|
||||
<Head :title="$t('settings.workspace.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-4 py-8">
|
||||
<AppLayout>
|
||||
<div class="mx-auto max-w-4xl space-y-8 px-6 py-8">
|
||||
<PageHeader
|
||||
:title="$t('settings.hub.title')"
|
||||
:description="$t('settings.hub.description')"
|
||||
/>
|
||||
|
||||
<SettingsTabsNav :tabs="tabs" active="workspace" />
|
||||
|
||||
<WorkspaceTab :workspace="workspace" />
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import dayjs from '@/dayjs';
|
|||
import debounce from '@/debounce';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { destroy as signaturesDestroy, index as signaturesIndex } from '@/routes/app/signatures';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
interface Workspace {
|
||||
id: string;
|
||||
|
|
@ -63,10 +62,6 @@ const search = debounce(() => {
|
|||
|
||||
watch(searchQuery, () => search());
|
||||
|
||||
const breadcrumbs = computed<BreadcrumbItem[]>(() => [
|
||||
{ title: trans('signatures.title') },
|
||||
]);
|
||||
|
||||
const deleteModal = ref<InstanceType<typeof ConfirmDeleteModal> | null>(null);
|
||||
const isCreateDialogOpen = ref(false);
|
||||
const isEditDialogOpen = ref(false);
|
||||
|
|
@ -92,8 +87,8 @@ const hasActiveSearch = computed(() => Boolean(searchQuery.value?.trim()));
|
|||
<template>
|
||||
<Head :title="$t('signatures.title')" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="flex h-full flex-1 flex-col gap-4 p-4">
|
||||
<AppLayout>
|
||||
<div class="flex h-full flex-1 flex-col gap-6 px-6 py-8">
|
||||
<PageHeader :title="$t('signatures.title')" />
|
||||
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
|
|
|
|||
Loading…
Reference in a new issue