Test insights scorecard
This commit is contained in:
parent
00582985b1
commit
a09040a0d8
@ -7,6 +7,7 @@ import {
|
|||||||
} from '@/photo/db/query';
|
} from '@/photo/db/query';
|
||||||
import AdminAppInsightsClient from './AdminAppInsightsClient';
|
import AdminAppInsightsClient from './AdminAppInsightsClient';
|
||||||
import { APP_CONFIGURATION } from '@/app-core/config';
|
import { APP_CONFIGURATION } from '@/app-core/config';
|
||||||
|
|
||||||
export default async function AdminAppInsights() {
|
export default async function AdminAppInsights() {
|
||||||
const [
|
const [
|
||||||
{ count, dateRange },
|
{ count, dateRange },
|
||||||
|
|||||||
@ -5,7 +5,9 @@ import Note from '@/components/Note';
|
|||||||
import WarningNote from '@/components/WarningNote';
|
import WarningNote from '@/components/WarningNote';
|
||||||
import { dateRangeForPhotos, PhotoDateRange } from '@/photo';
|
import { dateRangeForPhotos, PhotoDateRange } from '@/photo';
|
||||||
import clsx from 'clsx/lite';
|
import clsx from 'clsx/lite';
|
||||||
|
import { ReactNode } from 'react';
|
||||||
import { HiSparkles } from 'react-icons/hi';
|
import { HiSparkles } from 'react-icons/hi';
|
||||||
|
import { PiWarningBold } from 'react-icons/pi';
|
||||||
|
|
||||||
type Recommendation =
|
type Recommendation =
|
||||||
'fork' |
|
'fork' |
|
||||||
@ -52,15 +54,53 @@ export default function AdminAppInsightsClient({
|
|||||||
{title}
|
{title}
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
|
const renderRow = (icon: ReactNode, children: ReactNode) =>
|
||||||
|
<div className={clsx(
|
||||||
|
'flex items-center gap-4',
|
||||||
|
'px-4 py-2',
|
||||||
|
)}>
|
||||||
|
<div className="flex items-center gap-2 shrink-0">
|
||||||
|
{icon}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={clsx(
|
<div className={clsx(
|
||||||
'flex flex-col items-center w-full',
|
'flex flex-col items-center w-full',
|
||||||
'mt-2 mb-1',
|
'mt-2 mb-1',
|
||||||
)}>
|
)}>
|
||||||
<div className={clsx(
|
<div className={clsx(
|
||||||
'w-full sm:w-[80%]',
|
'w-full sm:w-[80%] lg:w-[60%]',
|
||||||
'space-y-4 md:space-y-6',
|
'space-y-4 md:space-y-6',
|
||||||
)}>
|
)}>
|
||||||
|
<div className="component-surface shadow-xs divide-y divide-main">
|
||||||
|
{renderRow(
|
||||||
|
<PiWarningBold
|
||||||
|
size={17}
|
||||||
|
className="translate-x-[0.5px] text-amber-600"
|
||||||
|
/>,
|
||||||
|
'This fork is 9 commits behind',
|
||||||
|
)}
|
||||||
|
{renderRow(
|
||||||
|
<PiWarningBold
|
||||||
|
size={17}
|
||||||
|
className="translate-x-[0.5px] text-amber-600"
|
||||||
|
/>,
|
||||||
|
'Consider enabling rate limiting to mitigate AI abuse',
|
||||||
|
)}
|
||||||
|
{renderRow(
|
||||||
|
<IconGrSync />,
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
'Consider forking this repository to receive new features and fixes',
|
||||||
|
)}
|
||||||
|
{renderRow(
|
||||||
|
<HiSparkles />,
|
||||||
|
'Enable AI text generation in the app configuration',
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
{renderTitle('Code Observability')}
|
{renderTitle('Code Observability')}
|
||||||
{(fork || debug) &&
|
{(fork || debug) &&
|
||||||
<Note icon={<IconGrSync />}>
|
<Note icon={<IconGrSync />}>
|
||||||
|
|||||||
@ -59,10 +59,7 @@ export default function GitHubForkStatusBadgeClient({
|
|||||||
classNameForStyle(),
|
classNameForStyle(),
|
||||||
)}>
|
)}>
|
||||||
{!label
|
{!label
|
||||||
? <Spinner
|
? <Spinner className="translate-x-[3px] translate-y-[0.5px]" />
|
||||||
color="text"
|
|
||||||
className="translate-x-[3px]"
|
|
||||||
/>
|
|
||||||
: <BiLogoGithub size={17} />}
|
: <BiLogoGithub size={17} />}
|
||||||
{label ?? 'Checking'}
|
{label ?? 'Checking'}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -124,6 +124,10 @@
|
|||||||
@apply
|
@apply
|
||||||
border border-gray-200 dark:border-gray-700
|
border border-gray-200 dark:border-gray-700
|
||||||
}
|
}
|
||||||
|
@utility divide-main {
|
||||||
|
@apply
|
||||||
|
divide-gray-200 dark:divide-gray-700
|
||||||
|
}
|
||||||
/* Background */
|
/* Background */
|
||||||
@utility bg-main {
|
@utility bg-main {
|
||||||
@apply
|
@apply
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user