mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
chore: undo
This commit is contained in:
@@ -204,11 +204,9 @@ export default function AgentRunsPage(): React.ReactElement {
|
||||
selectPreset,
|
||||
]);
|
||||
|
||||
// Check for execution ID in URL search params and select that run
|
||||
useEffect(() => {
|
||||
if (executionId) {
|
||||
selectRun(executionId as GraphExecutionID);
|
||||
// Clean up the URL parameter after selecting the run
|
||||
setExecutionId(null);
|
||||
}
|
||||
}, [executionId, selectRun, setExecutionId]);
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
"use client";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import LoadingBox from "@/components/ui/loading";
|
||||
import useCredits from "@/hooks/useCredits";
|
||||
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { Suspense, useEffect, useState } from "react";
|
||||
import { useSearchParams, useRouter } from "next/navigation";
|
||||
import {
|
||||
useToast,
|
||||
useToastOnFail,
|
||||
} from "@/components/molecules/Toast/use-toast";
|
||||
|
||||
import { CreditTransaction } from "@/lib/autogpt-server-api";
|
||||
import { RefundModal } from "./RefundModal";
|
||||
import { CreditTransaction } from "@/lib/autogpt-server-api";
|
||||
|
||||
import {
|
||||
Table,
|
||||
@@ -22,7 +21,7 @@ import {
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
|
||||
function CreditsContent() {
|
||||
export default function CreditsPage() {
|
||||
const api = useBackendAPI();
|
||||
const {
|
||||
requestTopUp,
|
||||
@@ -375,11 +374,3 @@ function CreditsContent() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function CreditsPage() {
|
||||
return (
|
||||
<Suspense fallback={<LoadingBox className="h-[80vh]" />}>
|
||||
<CreditsContent />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,34 @@
|
||||
"use client";
|
||||
import { CronSchedulerDialog } from "@/components/cron-scheduler-dialog";
|
||||
import { BlocksControl } from "@/components/edit/control/BlocksControl";
|
||||
import { Control, ControlPanel } from "@/components/edit/control/ControlPanel";
|
||||
import { SaveControl } from "@/components/edit/control/SaveControl";
|
||||
import OttoChatWidget from "@/components/OttoChatWidget";
|
||||
import PrimaryActionBar from "@/components/PrimaryActionButton";
|
||||
import RunnerUIWrapper, {
|
||||
RunnerUIWrapperRef,
|
||||
} from "@/components/RunnerUIWrapper";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { IconRedo2, IconUndo2 } from "@/components/ui/icons";
|
||||
import { useToast } from "@/components/molecules/Toast/use-toast";
|
||||
import useAgentGraph from "@/hooks/useAgentGraph";
|
||||
import React, {
|
||||
createContext,
|
||||
useState,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
MouseEvent,
|
||||
Suspense,
|
||||
} from "react";
|
||||
import Link from "next/link";
|
||||
import {
|
||||
ReactFlow,
|
||||
ReactFlowProvider,
|
||||
Controls,
|
||||
Background,
|
||||
Node,
|
||||
OnConnect,
|
||||
Connection,
|
||||
MarkerType,
|
||||
NodeChange,
|
||||
EdgeChange,
|
||||
useReactFlow,
|
||||
applyEdgeChanges,
|
||||
applyNodeChanges,
|
||||
useViewport,
|
||||
} from "@xyflow/react";
|
||||
import "@xyflow/react/dist/style.css";
|
||||
import { CustomNode } from "./CustomNode";
|
||||
import "./flow.css";
|
||||
import {
|
||||
BlockUIType,
|
||||
formatEdgeID,
|
||||
@@ -20,44 +37,27 @@ import {
|
||||
LibraryAgent,
|
||||
} from "@/lib/autogpt-server-api";
|
||||
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
|
||||
import { findNewlyAddedBlockCoordinates, getTypeColor } from "@/lib/utils";
|
||||
import {
|
||||
applyEdgeChanges,
|
||||
applyNodeChanges,
|
||||
Background,
|
||||
Connection,
|
||||
Controls,
|
||||
EdgeChange,
|
||||
MarkerType,
|
||||
Node,
|
||||
NodeChange,
|
||||
OnConnect,
|
||||
ReactFlow,
|
||||
ReactFlowProvider,
|
||||
useReactFlow,
|
||||
useViewport,
|
||||
} from "@xyflow/react";
|
||||
import "@xyflow/react/dist/style.css";
|
||||
import Link from "next/link";
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
import React, {
|
||||
createContext,
|
||||
MouseEvent,
|
||||
Suspense,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { useCopyPaste } from "../hooks/useCopyPaste";
|
||||
import ConnectionLine from "./ConnectionLine";
|
||||
import { CustomEdge } from "./CustomEdge";
|
||||
import { CustomNode } from "./CustomNode";
|
||||
import "./flow.css";
|
||||
import { getTypeColor, findNewlyAddedBlockCoordinates } from "@/lib/utils";
|
||||
import { history } from "./history";
|
||||
import { CustomEdge } from "./CustomEdge";
|
||||
import ConnectionLine from "./ConnectionLine";
|
||||
import { Control, ControlPanel } from "@/components/edit/control/ControlPanel";
|
||||
import { SaveControl } from "@/components/edit/control/SaveControl";
|
||||
import { BlocksControl } from "@/components/edit/control/BlocksControl";
|
||||
import { IconUndo2, IconRedo2 } from "@/components/ui/icons";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { startTutorial } from "./tutorial";
|
||||
import useAgentGraph from "@/hooks/useAgentGraph";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import RunnerUIWrapper, {
|
||||
RunnerUIWrapperRef,
|
||||
} from "@/components/RunnerUIWrapper";
|
||||
import { CronSchedulerDialog } from "@/components/cron-scheduler-dialog";
|
||||
import PrimaryActionBar from "@/components/PrimaryActionButton";
|
||||
import OttoChatWidget from "@/components/OttoChatWidget";
|
||||
import { useToast } from "@/components/molecules/Toast/use-toast";
|
||||
import { useCopyPaste } from "../hooks/useCopyPaste";
|
||||
|
||||
// This is for the history, this is the minimum distance a block must move before it is logged
|
||||
// It helps to prevent spamming the history with small movements especially when pressing on a input in a block
|
||||
@@ -84,8 +84,7 @@ const FlowEditor: React.FC<{
|
||||
flowID?: GraphID;
|
||||
flowVersion?: number;
|
||||
className?: string;
|
||||
searchParams?: URLSearchParams;
|
||||
}> = ({ flowID, flowVersion, className, searchParams }) => {
|
||||
}> = ({ flowID, flowVersion, className }) => {
|
||||
const {
|
||||
addNodes,
|
||||
addEdges,
|
||||
@@ -145,7 +144,7 @@ const FlowEditor: React.FC<{
|
||||
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const params = searchParams || new URLSearchParams();
|
||||
const params = useSearchParams();
|
||||
const initialPositionRef = useRef<{
|
||||
[key: string]: { x: number; y: number };
|
||||
}>({});
|
||||
@@ -815,26 +814,9 @@ const FlowEditor: React.FC<{
|
||||
);
|
||||
};
|
||||
|
||||
const FlowEditorWithSearchParams: React.FC<{
|
||||
flowID?: GraphID;
|
||||
flowVersion?: number;
|
||||
className?: string;
|
||||
}> = (props) => {
|
||||
const searchParams = useSearchParams();
|
||||
return <FlowEditor {...props} searchParams={searchParams} />;
|
||||
};
|
||||
|
||||
const WrappedFlowEditor: typeof FlowEditor = (props) => (
|
||||
<ReactFlowProvider>
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="flex h-screen items-center justify-center">
|
||||
Loading...
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<FlowEditorWithSearchParams {...props} />
|
||||
</Suspense>
|
||||
<FlowEditor {...props} />
|
||||
</ReactFlowProvider>
|
||||
);
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Search } from "lucide-react";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -10,11 +13,8 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { SubmissionStatus } from "@/lib/autogpt-server-api/types";
|
||||
import { Search } from "lucide-react";
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
import { Suspense, useEffect, useState } from "react";
|
||||
|
||||
function SearchAndFilterAdminMarketplaceContent({
|
||||
export function SearchAndFilterAdminMarketplace({
|
||||
initialSearch,
|
||||
}: {
|
||||
initialStatus?: SubmissionStatus;
|
||||
@@ -98,20 +98,3 @@ function SearchAndFilterAdminMarketplaceContent({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SearchAndFilterAdminMarketplace({
|
||||
initialSearch,
|
||||
}: {
|
||||
initialStatus?: SubmissionStatus;
|
||||
initialSearch?: string;
|
||||
}) {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="flex items-center justify-center">Loading...</div>
|
||||
}
|
||||
>
|
||||
<SearchAndFilterAdminMarketplaceContent initialSearch={initialSearch} />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Search } from "lucide-react";
|
||||
import { CreditTransactionType } from "@/lib/autogpt-server-api";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -9,12 +13,8 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { CreditTransactionType } from "@/lib/autogpt-server-api";
|
||||
import { Search } from "lucide-react";
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
import { Suspense, useEffect, useState } from "react";
|
||||
|
||||
function SearchAndFilterAdminSpendingContent({
|
||||
export function SearchAndFilterAdminSpending({
|
||||
initialSearch,
|
||||
}: {
|
||||
initialStatus?: CreditTransactionType;
|
||||
@@ -102,20 +102,3 @@ function SearchAndFilterAdminSpendingContent({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SearchAndFilterAdminSpending({
|
||||
initialSearch,
|
||||
}: {
|
||||
initialStatus?: CreditTransactionType;
|
||||
initialSearch?: string;
|
||||
}) {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="flex items-center justify-center">Loading...</div>
|
||||
}
|
||||
>
|
||||
<SearchAndFilterAdminSpendingContent initialSearch={initialSearch} />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
|
||||
function PaginationControlsContent({
|
||||
export function PaginationControls({
|
||||
currentPage,
|
||||
totalPages,
|
||||
pathParam = "page",
|
||||
@@ -49,27 +48,3 @@ function PaginationControlsContent({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function PaginationControls({
|
||||
currentPage,
|
||||
totalPages,
|
||||
pathParam = "page",
|
||||
}: {
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
pathParam?: string;
|
||||
}) {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="flex items-center justify-center">Loading...</div>
|
||||
}
|
||||
>
|
||||
<PaginationControlsContent
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
pathParam={pathParam}
|
||||
/>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user