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.
118 lines
5.4 KiB
TypeScript
118 lines
5.4 KiB
TypeScript
import { useValues } from 'kea'
|
|
|
|
import { Button, Label, Tag, ProfilePicture } from '@hanzo/elements'
|
|
|
|
import { TZLabel } from 'lib/components/TZLabel'
|
|
import { toast } from 'lib/elements/Toast/Toast'
|
|
import { Link } from 'lib/elements/Link'
|
|
import { urls } from 'scenes/urls'
|
|
|
|
import { endpointLogic } from '../endpointLogic'
|
|
import { EndpointTab, endpointSceneLogic } from '../endpointSceneLogic'
|
|
|
|
export function EndpointOverview(): JSX.Element {
|
|
const { endpoint } = useValues(endpointLogic)
|
|
const { viewingVersion } = useValues(endpointSceneLogic)
|
|
|
|
if (!endpoint) {
|
|
return <></>
|
|
}
|
|
|
|
const isViewingOldVersion = viewingVersion && viewingVersion.version !== endpoint.current_version
|
|
const versionUrl = isViewingOldVersion ? `${endpoint.endpoint_path}?version=${viewingVersion.version}` : null
|
|
|
|
return (
|
|
<div className="flex flex-col gap-4">
|
|
{/* Row 1: Endpoint info (always shown) */}
|
|
<div className="grid gap-2 overflow-hidden grid-cols-1 min-[1200px]:grid-cols-[1fr_26rem]">
|
|
<div className="inline-flex deprecated-space-x-8">
|
|
<div className="flex flex-col w-28">
|
|
<Label>Endpoint status</Label>
|
|
<Tag type={endpoint.is_active ? 'success' : 'danger'} className="w-fit">
|
|
<b>{endpoint.is_active ? 'Active' : 'Inactive'}</b>
|
|
</Tag>
|
|
</div>
|
|
<div className="flex flex-col w-34">
|
|
<Label
|
|
info={
|
|
<>
|
|
Versions auto-increment when the query changes. Access older versions in the{' '}
|
|
<Link to={`${urls.endpoint(endpoint.name)}?tab=${EndpointTab.VERSIONS}`}>
|
|
Versions tab
|
|
</Link>
|
|
.
|
|
</>
|
|
}
|
|
>
|
|
Current version
|
|
</Label>
|
|
<span className="text-sm font-semibold">v{endpoint.current_version}</span>
|
|
</div>
|
|
{!isViewingOldVersion && (
|
|
<div className="flex flex-col">
|
|
<Label>Endpoint URL</Label>
|
|
<Button
|
|
type="secondary"
|
|
size="xsmall"
|
|
onClick={() => {
|
|
navigator.clipboard.writeText(endpoint.endpoint_path)
|
|
toast.success('Endpoint URL copied to clipboard')
|
|
}}
|
|
className="font-mono text-xs"
|
|
>
|
|
{endpoint.endpoint_path}
|
|
</Button>
|
|
</div>
|
|
)}
|
|
</div>
|
|
<div className="flex flex-col gap-4 overflow-hidden items-start min-[1200px]:items-end">
|
|
<div className="inline-flex deprecated-space-x-8">
|
|
<div className="flex flex-col">
|
|
<Label>Last executed</Label>
|
|
{endpoint.last_executed_at ? (
|
|
<TZLabel time={endpoint.last_executed_at} />
|
|
) : (
|
|
<span className="text-muted">Never</span>
|
|
)}
|
|
</div>
|
|
<div className="flex flex-col">
|
|
<Label>Created by</Label>
|
|
{endpoint.created_by && <ProfilePicture user={endpoint.created_by} size="md" showName />}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Row 2: Version info (only when viewing old version) */}
|
|
{isViewingOldVersion && (
|
|
<div className="inline-flex deprecated-space-x-8">
|
|
<div className="flex flex-col w-28">
|
|
<Label>Version status</Label>
|
|
<Tag type={viewingVersion.is_active ? 'success' : 'danger'} className="w-fit">
|
|
<b className="uppercase">{viewingVersion.is_active ? 'Active' : 'Inactive'}</b>
|
|
</Tag>
|
|
</div>
|
|
<div className="flex flex-col w-34">
|
|
<Label>Viewing version</Label>
|
|
<span className="text-sm font-semibold">v{viewingVersion.version}</span>
|
|
</div>
|
|
<div className="flex flex-col">
|
|
<Label>Version URL</Label>
|
|
<Button
|
|
type="secondary"
|
|
size="xsmall"
|
|
onClick={() => {
|
|
navigator.clipboard.writeText(versionUrl!)
|
|
toast.success('Version URL copied to clipboard')
|
|
}}
|
|
className="font-mono text-xs"
|
|
>
|
|
{versionUrl}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|