mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
78 lines
2.4 KiB
TypeScript
78 lines
2.4 KiB
TypeScript
import { ReactNode } from 'react'
|
|
|
|
import { IconCalendar, IconClock } from '@hanzo/icons'
|
|
import { Tag, Link } from '@hanzo/elements'
|
|
|
|
import { AlertState } from '~/queries/schema/schema-general'
|
|
|
|
import { AlertType } from '../types'
|
|
|
|
interface AlertDefinitionRowProps {
|
|
label?: ReactNode
|
|
children: ReactNode
|
|
className?: string
|
|
}
|
|
|
|
export function AlertDefinitionRow({ label, children, className }: AlertDefinitionRowProps): JSX.Element {
|
|
return (
|
|
<div className={`flex flex-wrap gap-x-3 gap-y-2 items-center${className ? ` ${className}` : ''}`}>
|
|
{label ? <div>{label}</div> : null}
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export function AlertStateIndicator({ alert }: { alert: AlertType }): JSX.Element {
|
|
if (!alert.enabled) {
|
|
return <Tag type="muted">Disabled</Tag>
|
|
}
|
|
|
|
switch (alert.state) {
|
|
case AlertState.FIRING:
|
|
return <Tag type="danger">Firing</Tag>
|
|
case AlertState.ERRORED:
|
|
return <Tag type="danger">Errored</Tag>
|
|
case AlertState.SNOOZED:
|
|
return <Tag type="muted">Snoozed</Tag>
|
|
case AlertState.NOT_FIRING:
|
|
return <Tag type="success">Not firing</Tag>
|
|
}
|
|
}
|
|
|
|
interface AlertNextEvaluationStatusProps {
|
|
children: ReactNode
|
|
loading?: boolean
|
|
}
|
|
|
|
export function AlertNextEvaluationStatus({ children, loading = false }: AlertNextEvaluationStatusProps): JSX.Element {
|
|
return (
|
|
<div className="text-sm text-muted flex flex-wrap items-center gap-x-2 gap-y-0">
|
|
<IconClock
|
|
className={`size-4 shrink-0 text-muted motion-reduce:animate-none${loading ? ' animate-spin' : ''}`}
|
|
aria-hidden
|
|
/>
|
|
<span className="shrink-0">Next planned evaluation:</span>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
interface AlertTimezoneNoticeProps {
|
|
timezone: string
|
|
settingsUrl: string
|
|
}
|
|
|
|
export function AlertTimezoneNotice({ timezone, settingsUrl }: AlertTimezoneNoticeProps): JSX.Element {
|
|
return (
|
|
<div className="text-muted text-sm flex flex-wrap items-start gap-2">
|
|
<IconCalendar className="size-4 shrink-0 text-muted mt-0.5" aria-hidden />
|
|
<span className="min-w-0">
|
|
Times use your project timezone ({timezone}).{' '}
|
|
<Link to={settingsUrl} target="_blank" targetBlankIcon={false}>
|
|
Change in settings
|
|
</Link>
|
|
</span>
|
|
</div>
|
|
)
|
|
}
|