mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-20 21:18:13 +02:00
chore: ran linting
This commit is contained in:
parent
ceace003aa
commit
c7409c8995
48 changed files with 342 additions and 187 deletions
|
|
@ -1,5 +1,5 @@
|
|||
"use client";
|
||||
import { CalendarDays, AlarmClock, Info } from "lucide-react";
|
||||
import { AlarmClock, CalendarDays, Info } from "lucide-react";
|
||||
import { Table, TableBody, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import type { AutomationSummary } from "@/contracts/types/automation.types";
|
||||
import { AutomationRow } from "./automation-row";
|
||||
|
|
|
|||
|
|
@ -37,11 +37,7 @@ export function DashboardClientLayout({
|
|||
const setActiveSearchSpaceIdState = useSetAtom(activeSearchSpaceIdAtom);
|
||||
const setPendingUserImageUrls = useSetAtom(pendingUserImageDataUrlsAtom);
|
||||
|
||||
const {
|
||||
data: modelRoles = {},
|
||||
isLoading: loading,
|
||||
error,
|
||||
} = useAtomValue(modelRolesAtom);
|
||||
const { data: modelRoles = {}, isLoading: loading, error } = useAtomValue(modelRolesAtom);
|
||||
const { data: globalConnections = [], isLoading: globalConfigsLoading } = useAtomValue(
|
||||
globalModelConnectionsAtom
|
||||
);
|
||||
|
|
@ -158,13 +154,13 @@ export function DashboardClientLayout({
|
|||
|
||||
// Determine if we should show loading
|
||||
const shouldShowLoading =
|
||||
(!hasCheckedOnboarding &&
|
||||
(!isSearchSpaceReady ||
|
||||
loading ||
|
||||
accessLoading ||
|
||||
globalConfigsLoading ||
|
||||
modelConnectionsLoading) &&
|
||||
!isOnboardingPage);
|
||||
!hasCheckedOnboarding &&
|
||||
(!isSearchSpaceReady ||
|
||||
loading ||
|
||||
accessLoading ||
|
||||
globalConfigsLoading ||
|
||||
modelConnectionsLoading) &&
|
||||
!isOnboardingPage;
|
||||
|
||||
// Use global loading screen - spinner animation won't reset
|
||||
useGlobalLoadingEffect(shouldShowLoading);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import {
|
||||
BookText,
|
||||
Cpu,
|
||||
Earth,
|
||||
Settings,
|
||||
UserKey,
|
||||
} from "lucide-react";
|
||||
import { BookText, Cpu, Earth, Settings, UserKey } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useSelectedLayoutSegment } from "next/navigation";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import type {
|
|||
ModelPreviewRead,
|
||||
ModelRead,
|
||||
ModelRoles,
|
||||
ModelTestPreviewRequest,
|
||||
ModelsBulkUpdateRequest,
|
||||
ModelTestPreviewRequest,
|
||||
ModelUpdateRequest,
|
||||
VerifyConnectionResponse,
|
||||
} from "@/contracts/types/model-connections.types";
|
||||
|
|
|
|||
|
|
@ -957,7 +957,10 @@ interface ComposerActionProps {
|
|||
searchSpaceId: number;
|
||||
}
|
||||
|
||||
const ComposerAction: FC<ComposerActionProps> = ({ isBlockedByOtherUser = false, searchSpaceId }) => {
|
||||
const ComposerAction: FC<ComposerActionProps> = ({
|
||||
isBlockedByOtherUser = false,
|
||||
searchSpaceId,
|
||||
}) => {
|
||||
const mentionedDocuments = useAtomValue(mentionedDocumentsAtom);
|
||||
const setConnectorDialogOpen = useSetAtom(connectorDialogOpenAtom);
|
||||
const [toolsPopoverOpen, setToolsPopoverOpen] = useState(false);
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ export { default as GeminiIcon } from "./gemini.svg";
|
|||
export { default as GitHubModelsIcon } from "./github.svg";
|
||||
export { default as GroqIcon } from "./groq.svg";
|
||||
export { default as HuggingFaceIcon } from "./huggingface.svg";
|
||||
export { default as LmStudioIcon } from "./lm-studio.svg";
|
||||
export { default as MiniMaxIcon } from "./minimax.svg";
|
||||
export { default as MistralIcon } from "./mistral.svg";
|
||||
export { default as LmStudioIcon } from "./lm-studio.svg";
|
||||
export { default as MoonshotIcon } from "./moonshot.svg";
|
||||
export { default as NscaleIcon } from "./nscale.svg";
|
||||
export { default as OllamaIcon } from "./ollama.svg";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||
import { AlertTriangle, AlarmClock, Inbox, LibraryBig } from "lucide-react";
|
||||
import { AlarmClock, AlertTriangle, Inbox, LibraryBig } from "lucide-react";
|
||||
import { useParams, usePathname, useRouter } from "next/navigation";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useTheme } from "next-themes";
|
||||
|
|
|
|||
|
|
@ -66,9 +66,7 @@ export function Header({ mobileMenuTrigger }: HeaderProps) {
|
|||
return (
|
||||
<header className="sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 bg-main-panel/95 backdrop-blur supports-backdrop-filter:bg-main-panel/60 px-4">
|
||||
{/* Left side - Mobile menu trigger */}
|
||||
<div className="flex flex-1 items-center gap-2 min-w-0">
|
||||
{mobileMenuTrigger}
|
||||
</div>
|
||||
<div className="flex flex-1 items-center gap-2 min-w-0">{mobileMenuTrigger}</div>
|
||||
|
||||
{/* Right side - Actions */}
|
||||
<div className="ml-auto flex items-center gap-2">
|
||||
|
|
|
|||
|
|
@ -82,10 +82,7 @@ function groupedModels(models: ChatModel[]) {
|
|||
}, {});
|
||||
}
|
||||
|
||||
export function ModelSelector({
|
||||
searchSpaceId,
|
||||
className,
|
||||
}: ModelSelectorProps) {
|
||||
export function ModelSelector({ searchSpaceId, className }: ModelSelectorProps) {
|
||||
const router = useRouter();
|
||||
const isMobile = useIsMobile();
|
||||
const [open, setOpen] = useState(false);
|
||||
|
|
@ -250,11 +247,9 @@ export function ModelSelector({
|
|||
className
|
||||
)}
|
||||
>
|
||||
{selected ? (
|
||||
getProviderIcon(selected.provider, { className: "size-4 shrink-0" })
|
||||
) : (
|
||||
getProviderIcon(AUTO_PROVIDER_ICON_KEY, { className: "size-4 shrink-0" })
|
||||
)}
|
||||
{selected
|
||||
? getProviderIcon(selected.provider, { className: "size-4 shrink-0" })
|
||||
: getProviderIcon(AUTO_PROVIDER_ICON_KEY, { className: "size-4 shrink-0" })}
|
||||
<span className="min-w-0 flex-1 truncate text-sm">
|
||||
{selected ? modelName(selected) : "Auto"}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -16,12 +16,7 @@ interface ApiBaseUrlFieldProps {
|
|||
}
|
||||
|
||||
/** Shared API Base URL input. The prefilled default is passed in via `value`. */
|
||||
export function ApiBaseUrlField({
|
||||
value,
|
||||
onChange,
|
||||
placeholder,
|
||||
hint,
|
||||
}: ApiBaseUrlFieldProps) {
|
||||
export function ApiBaseUrlField({ value, onChange, placeholder, hint }: ApiBaseUrlFieldProps) {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label>API Base URL</Label>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ export function ProviderConnectDialog({
|
|||
})();
|
||||
|
||||
const canRefreshModels = !isAzure && !isVertex && (!isBedrock || canSubmit);
|
||||
const hasEnabledModel = previewModels.some((model) => model.enabled) || Boolean(currentDraft.seedModelId);
|
||||
const hasEnabledModel =
|
||||
previewModels.some((model) => model.enabled) || Boolean(currentDraft.seedModelId);
|
||||
const canConnect = canSubmit && hasEnabledModel;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import type { ToolCallMessagePartProps } from "@assistant-ui/react";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { AlertCircle, AlarmClock, CornerDownLeftIcon, ExternalLink, Pencil } from "lucide-react";
|
||||
import { AlarmClock, AlertCircle, CornerDownLeftIcon, ExternalLink, Pencil } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
AlarmClock,
|
||||
Brain,
|
||||
Calendar,
|
||||
AlarmClock,
|
||||
FileEdit,
|
||||
FilePlus,
|
||||
FileText,
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import {
|
|||
type ModelProviderRead,
|
||||
type ModelRead,
|
||||
type ModelRoles,
|
||||
type ModelTestPreviewRequest,
|
||||
type ModelsBulkUpdateRequest,
|
||||
type ModelTestPreviewRequest,
|
||||
type ModelUpdateRequest,
|
||||
modelCreateRequest,
|
||||
modelListResponse,
|
||||
|
|
@ -20,8 +20,8 @@ import {
|
|||
modelProviderListResponse,
|
||||
modelRead,
|
||||
modelRoles,
|
||||
modelTestPreviewRequest,
|
||||
modelsBulkUpdateRequest,
|
||||
modelTestPreviewRequest,
|
||||
modelUpdateRequest,
|
||||
type VerifyConnectionResponse,
|
||||
verifyConnectionResponse,
|
||||
|
|
@ -94,18 +94,16 @@ class ModelConnectionsApiService {
|
|||
);
|
||||
};
|
||||
|
||||
testPreviewModel = async (request: ModelTestPreviewRequest): Promise<VerifyConnectionResponse> => {
|
||||
testPreviewModel = async (
|
||||
request: ModelTestPreviewRequest
|
||||
): Promise<VerifyConnectionResponse> => {
|
||||
const parsed = modelTestPreviewRequest.safeParse(request);
|
||||
if (!parsed.success) {
|
||||
throw new ValidationError(parsed.error.issues.map((issue) => issue.message).join(", "));
|
||||
}
|
||||
return baseApiService.post(
|
||||
`/api/v1/model-connections/test-preview`,
|
||||
verifyConnectionResponse,
|
||||
{
|
||||
body: parsed.data,
|
||||
}
|
||||
);
|
||||
return baseApiService.post(`/api/v1/model-connections/test-preview`, verifyConnectionResponse, {
|
||||
body: parsed.data,
|
||||
});
|
||||
};
|
||||
|
||||
addManualModel = async (
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ export function isLlmOnboardingComplete(
|
|||
|
||||
return connections.some((connection) =>
|
||||
connection.models.some(
|
||||
(model) =>
|
||||
model.id === resolvedChatModelId && model.enabled && Boolean(model.supports_chat)
|
||||
(model) => model.id === resolvedChatModelId && model.enabled && Boolean(model.supports_chat)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue