mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-18 23:11:12 +02:00
chore: linting
This commit is contained in:
parent
1131da5ed7
commit
e8b3692b54
20 changed files with 74 additions and 82 deletions
|
|
@ -3,7 +3,6 @@
|
|||
import { Check, Copy, Download } from "lucide-react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
|
@ -12,6 +11,7 @@ import {
|
|||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { downloadCsv, rowsToCsv } from "@/lib/playground/csv";
|
||||
|
||||
const MAX_TABLE_ROWS = 200;
|
||||
|
|
@ -117,13 +117,7 @@ export function OutputViewer({ data, filenameBase }: { data: unknown; filenameBa
|
|||
</Tabs>
|
||||
<div className="flex items-center gap-1">
|
||||
{items && items.length > 0 && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={exportCsv}
|
||||
className="gap-1.5"
|
||||
>
|
||||
<Button type="button" variant="ghost" size="sm" onClick={exportCsv} className="gap-1.5">
|
||||
<Download className="h-3.5 w-3.5" />
|
||||
Export CSV
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ export function PlaygroundIndex({ workspaceId }: { workspaceId: number }) {
|
|||
<Info />
|
||||
<AlertDescription>
|
||||
<p>
|
||||
Manually run SurfSense's platform-native APIs and inspect their output. To use these APIs outside SurfSense,{" "}
|
||||
Manually run SurfSense's platform-native APIs and inspect their output. To use these
|
||||
APIs outside SurfSense,{" "}
|
||||
<Link
|
||||
href={`${base}/api-keys`}
|
||||
className="font-medium text-foreground underline-offset-4 hover:underline"
|
||||
|
|
|
|||
|
|
@ -35,13 +35,7 @@ function parseJsonl(text: string | null): { items: unknown[]; total: number } {
|
|||
return { items, total: lines.length };
|
||||
}
|
||||
|
||||
export function RunDetail({
|
||||
workspaceId,
|
||||
runId,
|
||||
}: {
|
||||
workspaceId: number;
|
||||
runId: string;
|
||||
}) {
|
||||
export function RunDetail({ workspaceId, runId }: { workspaceId: number; runId: string }) {
|
||||
const { data: run, isLoading, error } = useScraperRun(workspaceId, runId);
|
||||
|
||||
const parsed = useMemo(() => parseJsonl(run?.output_text ?? null), [run?.output_text]);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ import { formatDuration } from "@/lib/playground/format";
|
|||
function eventLabel(event: ScraperRunEvent): string {
|
||||
const base =
|
||||
event.message ||
|
||||
(event.phase ? event.phase.replace(/_/g, " ").replace(/^\w/, (c) => c.toUpperCase()) : "Working");
|
||||
(event.phase
|
||||
? event.phase.replace(/_/g, " ").replace(/^\w/, (c) => c.toUpperCase())
|
||||
: "Working");
|
||||
if (event.current !== undefined && event.current !== null) {
|
||||
const counter =
|
||||
event.total !== undefined && event.total !== null
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@ export function RunStatusBadge({ status }: { status: string }) {
|
|||
}
|
||||
if (normalized === "success") {
|
||||
return (
|
||||
<Badge variant="secondary" className="bg-emerald-500/15 text-emerald-600 dark:text-emerald-400">
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"
|
||||
>
|
||||
Success
|
||||
</Badge>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ export function RunsTable({ workspaceId }: { workspaceId: number }) {
|
|||
<Alert>
|
||||
<Info />
|
||||
<AlertDescription>
|
||||
View all API runs for this workspace, including runs from the playground, API keys, and agents.
|
||||
View all API runs for this workspace, including runs from the playground, API keys, and
|
||||
agents.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
|
|
|
|||
|
|
@ -43,12 +43,7 @@ function FieldControl({
|
|||
|
||||
if (field.kind === "boolean") {
|
||||
return (
|
||||
<Switch
|
||||
id={id}
|
||||
checked={Boolean(value)}
|
||||
onCheckedChange={onChange}
|
||||
disabled={disabled}
|
||||
/>
|
||||
<Switch id={id} checked={Boolean(value)} onCheckedChange={onChange} disabled={disabled} />
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -141,9 +136,7 @@ function FieldRow({
|
|||
{field.required ? "required" : "optional"}
|
||||
</Badge>
|
||||
</div>
|
||||
{field.description && (
|
||||
<p className="text-xs text-muted-foreground">{field.description}</p>
|
||||
)}
|
||||
{field.description && <p className="text-xs text-muted-foreground">{field.description}</p>}
|
||||
<FieldControl
|
||||
field={field}
|
||||
value={value}
|
||||
|
|
@ -156,13 +149,7 @@ function FieldRow({
|
|||
);
|
||||
}
|
||||
|
||||
export function SchemaForm({
|
||||
fields,
|
||||
values,
|
||||
onChange,
|
||||
disabled,
|
||||
fieldErrors,
|
||||
}: SchemaFormProps) {
|
||||
export function SchemaForm({ fields, values, onChange, disabled, fieldErrors }: SchemaFormProps) {
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
|
||||
const { primary, advanced } = useMemo(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue