diff --git a/apps/studio/components/interfaces/Home/ActivityStats.tsx b/apps/studio/components/interfaces/Home/ActivityStats.tsx deleted file mode 100644 index 3b54810f9fb..00000000000 --- a/apps/studio/components/interfaces/Home/ActivityStats.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import dayjs from 'dayjs' -import Link from 'next/link' -import { useParams } from 'common' -import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' -import { useBranchesQuery } from 'data/branches/branches-query' -import { useMigrationsQuery } from 'data/database/migrations-query' -import { useBackupsQuery } from 'data/database/backups-query' -import { ServiceStatus } from './ServiceStatus' - -export default function ActivityStats() { - const { data: project } = useSelectedProjectQuery() - const { ref } = useParams() - - const { data: branchesData, isLoading: isLoadingBranches } = useBranchesQuery({ - projectRef: project?.parent_project_ref ?? project?.ref, - }) - const latestBranch = (branchesData ?? []) - .slice() - .sort( - (a, b) => - new Date(b.created_at ?? b.updated_at).valueOf() - - new Date(a.created_at ?? a.updated_at).valueOf() - )[0] - - const { data: migrationsData, isLoading: isLoadingMigrations } = useMigrationsQuery({ - projectRef: project?.ref, - connectionString: project?.connectionString, - }) - const latestMigration = (migrationsData ?? [])[0] - - const { data: backupsData, isLoading: isLoadingBackups } = useBackupsQuery({ - projectRef: project?.ref, - }) - const latestBackup = (backupsData?.backups ?? []) - .slice() - .sort((a, b) => new Date(b.inserted_at).valueOf() - new Date(a.inserted_at).valueOf())[0] - - return ( -
Status
-- {isLoadingBranches - ? 'Loading...' - : latestBranch?.created_at - ? dayjs(latestBranch.created_at).fromNow() - : latestBranch?.updated_at - ? dayjs(latestBranch.updated_at).fromNow() - : 'No branches'} -
- - -Last migration
-- {isLoadingMigrations - ? 'Loading...' - : latestMigration - ? dayjs(latestMigration.version, 'YYYYMMDDHHmmss').fromNow() - : 'No migrations'} -
- - -Last backup
-- {isLoadingBackups - ? 'Loading...' - : backupsData?.pitr_enabled - ? 'PITR enabled' - : latestBackup - ? dayjs(latestBackup.inserted_at).fromNow() - : 'No backups'} -
- -No charts set up yet in report
- )} -{step.description}
-
- {isLoadingBranches
- ? 'Loading...'
- : latestBranch?.created_at
- ? dayjs(latestBranch.created_at).fromNow()
- : latestBranch?.updated_at
- ? dayjs(latestBranch.updated_at).fromNow()
- : 'No branches'}
+ {isLoadingBranches ? (
+
Last migration
- {isLoadingMigrations
- ? 'Loading...'
- : latestMigration
- ? dayjs(latestMigration.version, 'YYYYMMDDHHmmss').fromNow()
- : 'No migrations'}
+ {isLoadingMigrations ? (
+
Last backup
- {isLoadingBackups
- ? 'Loading...'
- : backupsData?.pitr_enabled
- ? 'PITR enabled'
- : latestBackup
- ? dayjs(latestBackup.inserted_at).fromNow()
- : 'No backups'}
+ {isLoadingBackups ? (
+
{step.description}
+{step.description}
,
description:
'Install a client library and connect to your Supabase project to start querying your data',
- imageUrl: '/img/getting-started/one.png',
actions: [
{ label: 'Client libraries', href: `/project/${ref}/settings/api`, variant: 'default' },
{ label: 'Quickstarts', href: `/project/${ref}/sql/quickstarts`, variant: 'default' },
@@ -79,4 +80,4 @@ export default function GettingStartedSection() {
]}
/>
)
-}
\ No newline at end of file
+}
diff --git a/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx b/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx
index cdaeb78f73e..a5a64c438ce 100644
--- a/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx
+++ b/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx
@@ -6,6 +6,7 @@ import { useProjectLogRequestsCountQuery } from 'data/analytics/project-log-requ
import { useProjectLogStatsQuery } from 'data/analytics/project-log-stats-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import ProjectUsage from './ProjectUsage'
+import ShimmeringLoader from 'components/ui/ShimmeringLoader'
export const ProjectUsageSection = () => {
const { data: project } = useSelectedProjectQuery()
@@ -18,7 +19,17 @@ export const ProjectUsageSection = () => {
})
if (isLoading || isLogsStatsLoading) {
- return