@mytec: iter2.1 ready for testing

This commit is contained in:
2026-01-31 14:26:11 +02:00
parent cdbf0127bf
commit fa55fec94a
11 changed files with 780 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
interface RFCPDesktop {
getDataPath: () => Promise<string>;
getAppVersion: () => Promise<string>;
getPlatform: () => Promise<string>;
getGpuInfo: () => Promise<{
available: boolean;
name: string | null;
cudaVersion: string | null;
}>;
selectDirectory: () => Promise<string | null>;
selectFile: (options?: { filters?: Array<{ name: string; extensions: string[] }> }) => Promise<string | null>;
saveFile: (options?: { defaultPath?: string; filters?: Array<{ name: string; extensions: string[] }> }) => Promise<string | null>;
getSetting: (key: string) => Promise<unknown>;
setSetting: (key: string, value: unknown) => Promise<void>;
openExternal: (url: string) => Promise<void>;
openPath: (path: string) => Promise<void>;
platform: string;
isDesktop: boolean;
isMac: boolean;
isWindows: boolean;
isLinux: boolean;
}
declare global {
interface Window {
rfcp?: RFCPDesktop;
}
}
export const isDesktop = (): boolean => {
return window.rfcp?.isDesktop === true;
};
export const getDesktopApi = (): RFCPDesktop | null => {
return window.rfcp || null;
};
export const getApiBaseUrl = (): string => {
if (isDesktop()) {
return 'http://127.0.0.1:8888';
}
return import.meta.env.VITE_API_URL || 'https://api.rfcp.eliah.one';
};
export const isMac = (): boolean => {
return window.rfcp?.isMac === true;
};

View File

@@ -1,8 +1,9 @@
/**
* Backend API client for RFCP coverage calculation
*/
import { getApiBaseUrl } from '@/lib/desktop.ts';
const API_BASE = import.meta.env.VITE_API_URL || 'https://api.rfcp.eliah.one';
const API_BASE = getApiBaseUrl();
// === Request types ===