diff --git a/backend/app/model/chat.py b/backend/app/model/chat.py
index dac358dfd..58d0e8bfe 100644
--- a/backend/app/model/chat.py
+++ b/backend/app/model/chat.py
@@ -45,7 +45,7 @@ class QuestionAnalysisResult(BaseModel):
McpServers = dict[Literal["mcpServers"], dict[str, dict]]
PLATFORM_MAPPING = {
- "Z.ai": "openai-compatible-model",
+ "z.ai": "openai-compatible-model",
"ModelArk": "openai-compatible-model",
}
diff --git a/src/lib/llm.ts b/src/lib/llm.ts
index b411a63af..67bd60231 100644
--- a/src/lib/llm.ts
+++ b/src/lib/llm.ts
@@ -79,7 +79,7 @@ export const INIT_PROVODERS: Provider[] = [
model_type: '',
},
{
- id: 'Z.ai',
+ id: 'z.ai',
name: 'Z.ai',
apiKey: '',
apiHost: 'https://api.z.ai/api/coding/paas/v4/',
diff --git a/src/pages/Setting.tsx b/src/pages/Setting.tsx
index cc097fa0b..586058c6f 100644
--- a/src/pages/Setting.tsx
+++ b/src/pages/Setting.tsx
@@ -14,7 +14,6 @@
import logoBlack from '@/assets/logo/logo_black.png';
import logoWhite from '@/assets/logo/logo_white.png';
-import versionLogo from '@/assets/version-logo.png';
import VerticalNavigation, {
type VerticalNavItem,
} from '@/components/Navigation';
@@ -34,7 +33,7 @@ export default function Setting() {
const version = useAppVersion();
const { appearance } = useAuthStore();
const { t } = useTranslation();
- const _logoSrc = appearance === 'dark' ? logoWhite : logoBlack;
+ const logoSrc = appearance === 'dark' ? logoWhite : logoBlack;
// Setting menu configuration
const settingMenus = [
{
@@ -122,7 +121,7 @@ export default function Setting() {
}
className="flex cursor-pointer items-center bg-transparent transition-opacity duration-200 hover:opacity-60"
>
-
+
diff --git a/src/pages/Setting/Models.tsx b/src/pages/Setting/Models.tsx
index 07c3b80a2..e98249df8 100644
--- a/src/pages/Setting/Models.tsx
+++ b/src/pages/Setting/Models.tsx
@@ -97,9 +97,26 @@ type SidebarTab =
| 'local-sglang'
| 'local-lmstudio';
+// Provider logos that use dark fills (black or currentColor) and need inversion in dark mode
+const DARK_FILL_MODELS = new Set([
+ 'openai',
+ 'anthropic',
+ 'moonshot',
+ 'ollama',
+ 'openrouter',
+ 'lmstudio',
+ 'z.ai',
+ 'openai-compatible-model',
+]);
+
export default function SettingModels() {
- const { modelType, cloud_model_type, setModelType, setCloudModelType } =
- useAuthStore();
+ const {
+ modelType,
+ cloud_model_type,
+ setModelType,
+ setCloudModelType,
+ appearance,
+ } = useAuthStore();
const _navigate = useNavigate();
const { t } = useTranslation();
const getValidateMessage = (res: any) =>
@@ -965,6 +982,16 @@ export default function SettingModels() {
}
};
+ // Check if a model logo needs inversion in dark mode
+ const needsInvert = (modelId: string | null): boolean => {
+ if (!modelId || appearance !== 'dark') return false;
+ // Strip 'local-' prefix for local model tab IDs
+ const key = modelId.startsWith('local-')
+ ? modelId.replace('local-', '')
+ : modelId;
+ return DARK_FILL_MODELS.has(key);
+ };
+
// Helper to get model image based on model ID
const getModelImage = (modelId: string | null): string | null => {
if (!modelId) return null;
@@ -979,7 +1006,7 @@ export default function SettingModels() {
'tongyi-qianwen': qwenImage,
deepseek: deepseekImage,
minimax: minimaxImage,
- 'Z.ai': zaiImage,
+ 'z.ai': zaiImage,
moonshot: moonshotImage,
ModelArk: modelarkImage,
'aws-bedrock': bedrockImage,
@@ -1030,7 +1057,12 @@ export default function SettingModels() {
>