Consolidate AdminInsights files
This commit is contained in:
parent
ffa2d33514
commit
b3010ca397
@ -10,7 +10,7 @@ import { useAppState } from '@/state/AppState';
|
|||||||
import { BiCog } from 'react-icons/bi';
|
import { BiCog } from 'react-icons/bi';
|
||||||
import { ImCheckboxUnchecked } from 'react-icons/im';
|
import { ImCheckboxUnchecked } from 'react-icons/im';
|
||||||
import { IoCloseSharp } from 'react-icons/io5';
|
import { IoCloseSharp } from 'react-icons/io5';
|
||||||
import AdminAppInsightsIcon from './AdminAppInsightsIcon';
|
import AdminAppInsightsIcon from './insights/AdminAppInsightsIcon';
|
||||||
|
|
||||||
export default function AdminAppMenu() {
|
export default function AdminAppMenu() {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import { usePathname } from 'next/navigation';
|
|||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import { FaRegClock } from 'react-icons/fa';
|
import { FaRegClock } from 'react-icons/fa';
|
||||||
import { HiOutlineCog } from 'react-icons/hi';
|
import { HiOutlineCog } from 'react-icons/hi';
|
||||||
import AdminAppInsightsIcon from './AdminAppInsightsIcon';
|
import AdminAppInsightsIcon from './insights/AdminAppInsightsIcon';
|
||||||
|
|
||||||
// Updates considered recent if they occurred in past 5 minutes
|
// Updates considered recent if they occurred in past 5 minutes
|
||||||
const areTimesRecent = (dates: Date[]) => dates
|
const areTimesRecent = (dates: Date[]) => dates
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import {
|
|||||||
VERCEL_GIT_REPO_OWNER,
|
VERCEL_GIT_REPO_OWNER,
|
||||||
VERCEL_GIT_REPO_SLUG,
|
VERCEL_GIT_REPO_SLUG,
|
||||||
} from '@/app-core/config';
|
} from '@/app-core/config';
|
||||||
import { getGitHubMetaWithFallback } from './github';
|
import { getGitHubMetaWithFallback } from '../github';
|
||||||
|
|
||||||
const owner = VERCEL_GIT_REPO_OWNER;
|
const owner = VERCEL_GIT_REPO_OWNER;
|
||||||
const repo = VERCEL_GIT_REPO_SLUG;
|
const repo = VERCEL_GIT_REPO_SLUG;
|
||||||
@ -24,18 +24,11 @@ import {
|
|||||||
TEMPLATE_REPO_NAME,
|
TEMPLATE_REPO_NAME,
|
||||||
VERCEL_GIT_COMMIT_SHA_SHORT,
|
VERCEL_GIT_COMMIT_SHA_SHORT,
|
||||||
} from '@/app-core/config';
|
} from '@/app-core/config';
|
||||||
|
import { AdminAppInsight } from './insights';
|
||||||
|
|
||||||
const DEBUG_COMMIT_SHA = '4cd29ed';
|
const DEBUG_COMMIT_SHA = '4cd29ed';
|
||||||
const DEBUG_COMMIT_MESSAGE = 'Long commit message for debugging purposes';
|
const DEBUG_COMMIT_MESSAGE = 'Long commit message for debugging purposes';
|
||||||
|
|
||||||
type Recommendation =
|
|
||||||
'fork' |
|
|
||||||
'forkBehind' |
|
|
||||||
'ai' |
|
|
||||||
'aiRateLimiting' |
|
|
||||||
'photoMatting' |
|
|
||||||
'gridFirst';
|
|
||||||
|
|
||||||
export default function AdminAppInsightsClient({
|
export default function AdminAppInsightsClient({
|
||||||
codeMeta,
|
codeMeta,
|
||||||
photoStats: {
|
photoStats: {
|
||||||
@ -50,7 +43,7 @@ export default function AdminAppInsightsClient({
|
|||||||
debug,
|
debug,
|
||||||
}: {
|
}: {
|
||||||
codeMeta?: Awaited<ReturnType<typeof getGitHubMetaWithFallback>>
|
codeMeta?: Awaited<ReturnType<typeof getGitHubMetaWithFallback>>
|
||||||
recommendations: Record<Recommendation, boolean>
|
recommendations: Record<AdminAppInsight, boolean>
|
||||||
photoStats: {
|
photoStats: {
|
||||||
photosCount: number
|
photosCount: number
|
||||||
photosCountHidden: number
|
photosCountHidden: number
|
||||||
7
src/admin/insights/index.ts
Normal file
7
src/admin/insights/index.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export type AdminAppInsight =
|
||||||
|
'fork' |
|
||||||
|
'forkBehind' |
|
||||||
|
'ai' |
|
||||||
|
'aiRateLimiting' |
|
||||||
|
'photoMatting' |
|
||||||
|
'gridFirst';
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import AdminAppInsights from '@/admin/AdminAppInsights';
|
import AdminAppInsights from '@/admin/insights/AdminAppInsights';
|
||||||
import AdminInfoPage from '@/admin/AdminInfoPage';
|
import AdminInfoPage from '@/admin/AdminInfoPage';
|
||||||
import GitHubForkStatusBadge from '@/admin/github/GitHubForkStatusBadge';
|
import GitHubForkStatusBadge from '@/admin/github/GitHubForkStatusBadge';
|
||||||
import {
|
import {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user