feat(desktop): open read-only TurkServis combo details in browser pane

This commit is contained in:
yilsem committed 2026-09-07 21:46:57 +03:00
1 parent ff2eb47302
commit 3332458708
16 files changed
+110 -4

No files matched your search

@@ -0,0 +1,21 @@
/** Details use the member portal's own login; API credentials never enter a URL. */
export function turkservisComboDetailsUrl(apiUrl: string | undefined, model: string): string | null {
if (!apiUrl || !model || model.length > 128) {return null}
try {
const endpoint = new URL(apiUrl)
if (
endpoint.protocol !== 'https:' || endpoint.username || endpoint.password || endpoint.port ||
!['ai.turkservis.online', 'turkservis.online'].includes(endpoint.hostname)
) {return null}
const details = new URL('https://turkservis.online/router')
details.searchParams.set('model', model)
return details.href
} catch {
return null
}
}