Skip to content

Commit 52746ad

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 0ffc0c2 + a0f9efb commit 52746ad

File tree

9 files changed

+90
-140
lines changed

9 files changed

+90
-140
lines changed

backend/consts/model.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,6 @@ def get_value(cls, status: Optional[str]) -> str:
2323
return cls.NOT_DETECTED.value
2424
return status
2525

26-
27-
# Request models for user authentication
28-
class UserSignUpRequest(BaseModel):
29-
"""User registration request model"""
30-
email: EmailStr
31-
password: str = Field(..., min_length=6)
32-
33-
class UserSignInRequest(BaseModel):
34-
"""User login request model"""
35-
email: EmailStr
36-
password: str
37-
38-
class UserUpdateRequest(BaseModel):
39-
"""User information update request model"""
40-
email: Optional[EmailStr] = None
41-
password: Optional[str] = Field(None, min_length=6)
42-
role: Optional[str] = None
43-
4426
# Response models for user management
4527
class ServiceResponse(BaseModel):
4628
code: int

frontend/app/chat/layout/chatLeftSidebar.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ interface ChatSidebarProps {
3131
onDropdownOpenChange: (open: boolean, id: string | null) => void
3232
onToggleSidebar: () => void
3333
expanded: boolean
34-
userEmail?: string | null
35-
userAvatarUrl?: string | null
36-
userRole?: string
3734
}
3835

3936
// 辅助函数 - 对话分类

frontend/app/chat/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
import { useEffect } from "react"
44
import { ChatInterface } from "@/app/chat/internal/chatInterface"
55
import { useConfig } from "@/hooks/useConfig"
6+
import { configService } from "@/services/configService"
67

78
export default function ChatPage() {
89
const { appConfig } = useConfig()
910

1011
useEffect(() => {
12+
// Load config from backend when entering chat page
13+
configService.loadConfigToFrontend()
14+
1115
if (appConfig.appName) {
1216
document.title = `ModelEngine | ${appConfig.appName}`
1317
}

frontend/app/setup/layout/index.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,28 +84,20 @@ interface NavigationProps {
8484
onBackToFirstPage: () => void;
8585
onCompleteConfig: () => void;
8686
isSavingConfig: boolean;
87-
userRole?: string;
8887
}
8988

9089
function Navigation({
9190
selectedKey,
9291
onBackToFirstPage,
9392
onCompleteConfig,
9493
isSavingConfig,
95-
userRole
9694
}: NavigationProps) {
9795
return (
9896
<div className="mt-3 flex justify-between px-6">
9997
{selectedKey !== "1" && (
10098
<button
10199
onClick={onBackToFirstPage}
102-
disabled={userRole !== "admin"}
103-
className={
104-
`px-6 py-2.5 rounded-md flex items-center text-sm font-medium ` +
105-
(userRole !== "admin"
106-
? "bg-gray-200 text-gray-400 cursor-not-allowed border border-gray-200"
107-
: "bg-gray-100 text-gray-700 hover:bg-gray-200 cursor-pointer")
108-
}
100+
className={"px-6 py-2.5 rounded-md flex items-center text-sm font-medium bg-gray-100 text-gray-700 hover:bg-gray-200 cursor-pointer"}
109101
>
110102
上一步
111103
</button>
@@ -134,7 +126,6 @@ interface LayoutProps {
134126
onBackToFirstPage: () => void;
135127
onCompleteConfig: () => void;
136128
isSavingConfig: boolean;
137-
userRole?: string;
138129
}
139130

140131
function Layout({
@@ -147,7 +138,6 @@ function Layout({
147138
onBackToFirstPage,
148139
onCompleteConfig,
149140
isSavingConfig,
150-
userRole
151141
}: LayoutProps) {
152142
return (
153143
<div className="min-h-screen bg-gray-50 font-sans">
@@ -168,7 +158,6 @@ function Layout({
168158
onBackToFirstPage={onBackToFirstPage}
169159
onCompleteConfig={onCompleteConfig}
170160
isSavingConfig={isSavingConfig}
171-
userRole={userRole}
172161
/>
173162
</div>
174163
</div>

frontend/app/setup/modelSetup/appConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const AppConfigSection: React.FC = () => {
4141
const [isAvatarModalOpen, setIsAvatarModalOpen] = useState(false);
4242
const [selectedIconKey, setSelectedIconKey] = useState<string>(presetIcons[0].key);
4343
const [tempIconKey, setTempIconKey] = useState<string>(presetIcons[0].key);
44-
const [tempColor, setTempColor] = useState<string>("#235fe1");
44+
const [tempColor, setTempColor] = useState<string>("#2689cb");
4545
const [avatarType, setAvatarType] = useState<"preset" | "custom">(appConfig.iconType);
4646
const [tempAvatarType, setTempAvatarType] = useState<"preset" | "custom">(appConfig.iconType);
4747
const [customAvatarUrl, setCustomAvatarUrl] = useState<string | null>(appConfig.customIconUrl);

frontend/app/setup/modelSetup/config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useState, useEffect, useRef } from "react"
44
import { Layout, Typography, Row, Col } from "antd"
55
import { AppConfigSection } from './appConfig'
6-
import { ModelConfigSection, ModelConfigSectionRef } from './model/modelConfig'
6+
import { ModelConfigSection, ModelConfigSectionRef } from './modelConfig'
77
import { useConfig } from '@/hooks/useConfig'
88

99
// 重构:是否有必要引入

frontend/app/setup/modelSetup/model/ModelListCard.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,6 @@ const fetchModelStatus = async () => {
109109
}
110110
};
111111

112-
// 启动全局定时器,确保只有一个定时器运行
113-
const startGlobalTimer = () => {
114-
if (globalTimerRef === null) {
115-
116-
// 立即执行一次获取,以尽快更新UI
117-
setTimeout(fetchModelStatus, 1000);
118-
119-
// 设置周期性定时器
120-
globalTimerRef = setInterval(fetchModelStatus, 5000); // 每5秒更新一次
121-
}
122-
123-
return () => {
124-
if (globalTimerRef && modelUpdateRegistry.size === 0) {
125-
clearInterval(globalTimerRef);
126-
globalTimerRef = null;
127-
}
128-
};
129-
};
130-
131112
interface ModelListCardProps {
132113
type: ModelType
133114
modelId: string

0 commit comments

Comments
 (0)