update release

This commit is contained in:
duanfuxiang
2025-09-22 18:58:40 +08:00
parent d9923ff890
commit 9e8a9f4c0a
11 changed files with 240 additions and 79 deletions

View File

@@ -12,6 +12,7 @@ import { getProviderApiUrl } from '../../utils/provider-urls';
import { ApiKeyComponent, CustomUrlComponent } from './FormComponents';
import { ComboBoxComponent } from './ProviderModelsPicker';
import { fetchUserPlan } from '../../hooks/use-infio';
type CustomProviderSettingsProps = {
plugin: InfioPlugin;
@@ -199,6 +200,22 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
const { default: LLMManager } = await import('../../core/llm/manager');
const { GetDefaultModelId } = await import('../../utils/api');
// 对比 infio 使用独特的测试逻辑
if (provider === ApiProvider.Infio) {
const apiKey = settings?.infioProvider?.apiKey?.trim();
if (!apiKey) {
throw new Error('Infio API key is missing');
}
const userPlan = await fetchUserPlan(apiKey);
const plan = String(userPlan?.plan || '').toLowerCase();
if (plan === 'general') {
console.debug('✅ Infio plan is general, skipping further connection tests.');
return; // 直接返回成功
}
}
// 对于Ollama和OpenAICompatible不支持测试API连接
if (provider === ApiProvider.Ollama || provider === ApiProvider.OpenAICompatible) {
throw new Error(t("settings.ModelProvider.testConnection.notSupported", { provider }));

View File

@@ -1,4 +1,4 @@
import { Notice, Plugin } from 'obsidian';
import { Notice, Platform, Plugin } from 'obsidian';
import * as React from 'react';
import { ApiKeyModal } from '../../components/modals/ApiKeyModal';
@@ -75,6 +75,10 @@ export default function PluginInfoSettings({
}
// 执行升级
// check is mobile platform
if (Platform.isMobile) {
dl_zip = dl_zip.replace('.zip', '.mobile.zip');
}
const result = await upgradeToProVersion(plugin, dl_zip);
if (result.success) {