Skip to content

Commit 6a34625

Browse files
committed
modified
1 parent 5935a7e commit 6a34625

2 files changed

Lines changed: 4 additions & 26 deletions

File tree

src/components/popup/AgentAdd.tsx

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { invoke } from "@tauri-apps/api/core";
22
import { emit } from "@tauri-apps/api/event";
33
import { getCurrentWindow } from "@tauri-apps/api/window";
4-
import { X, Plus, Trash2 } from "lucide-react";
4+
import { Plus, Trash2, X } from "lucide-react";
55
import { useEffect, useRef, useState } from "react";
66

77
interface Tool {
@@ -24,18 +24,7 @@ interface Knowledge {
2424
file?: string;
2525
}
2626

27-
interface EnvVar {
28-
name: string;
29-
value: string;
30-
description: string;
31-
}
3227

33-
interface PresetTiming {
34-
type: "once" | "minutely" | "hourly" | "daily" | "weekly" | "monthly";
35-
time?: string; // HH:mm 格式
36-
dayOfWeek?: number; // 0-6, 用于每周
37-
dayOfMonth?: number; // 1-31, 用于每月
38-
}
3928

4029
interface Timing {
4130
type: "once" | "minutely" | "hourly" | "daily" | "weekly" | "monthly";
@@ -88,24 +77,13 @@ const presetTypes = [
8877

8978
export function AgentAdd() {
9079
const [agent, setAgent] = useState<Agent>(defaultAgent);
91-
const [models, setModels] = useState<string[]>([]);
9280
const [activeTab, setActiveTab] = useState<"basic" | "tools" | "knowledge" | "env">("basic");
9381
const inputRef = useRef<HTMLInputElement>(null);
9482

9583
useEffect(() => {
9684
inputRef.current?.focus();
97-
loadModels();
9885
}, []);
9986

100-
const loadModels = async () => {
101-
try {
102-
const availableModels = await invoke("get_models");
103-
setModels(availableModels as string[]);
104-
} catch (error) {
105-
console.error("加载模型列表失败:", error);
106-
}
107-
};
108-
10987
const handleClose = async () => {
11088
const window = await getCurrentWindow();
11189
setAgent(defaultAgent);
@@ -166,8 +144,8 @@ export function AgentAdd() {
166144

167145
return (
168146
<div className="app-container flex flex-col h-screen bg-background">
169-
<div
170-
className="flex items-center justify-between h-12 px-4 border-b border-border"
147+
<div
148+
className="flex items-center justify-between h-12 px-4 border-b border-border"
171149
data-tauri-drag-region
172150
>
173151
<div className="text-sm font-medium text-foreground">添加代理</div>

src/components/settings/GeneralTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { invoke } from '@tauri-apps/api/core';
33
import { disable, enable, isEnabled } from '@tauri-apps/plugin-autostart';
44
import { message } from '@tauri-apps/plugin-dialog';
55
import { relaunch } from '@tauri-apps/plugin-process';
6-
import { ChevronRight, Globe2, Lightbulb, Moon, Power, RotateCw, Sun } from "lucide-react";
6+
import { ChevronRight, Lightbulb, Moon, Power, RotateCw, Sun } from "lucide-react";
77
import { useEffect, useState } from "react";
88

99

0 commit comments

Comments
 (0)