mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-13 02:42:32 +00:00
update release
This commit is contained in:
@@ -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 }));
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user