mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
fix
This commit is contained in:
@@ -819,7 +819,7 @@
|
|||||||
|
|
||||||
const modalStore = useModalStore();
|
const modalStore = useModalStore();
|
||||||
const { translateText } = useAdvancedSettingsStore();
|
const { translateText } = useAdvancedSettingsStore();
|
||||||
const { bioLanguage, translationApi, translationApiType } = storeToRefs(useAdvancedSettingsStore());
|
const { bioLanguage, translationApi } = storeToRefs(useAdvancedSettingsStore());
|
||||||
|
|
||||||
const NewInstanceDialog = defineAsyncComponent(() => import('../NewInstanceDialog.vue'));
|
const NewInstanceDialog = defineAsyncComponent(() => import('../NewInstanceDialog.vue'));
|
||||||
const ChangeWorldImageDialog = defineAsyncComponent(() => import('./ChangeWorldImageDialog.vue'));
|
const ChangeWorldImageDialog = defineAsyncComponent(() => import('./ChangeWorldImageDialog.vue'));
|
||||||
@@ -1384,7 +1384,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => worldDialog.value.id,
|
() => [worldDialog.value.id, worldDialog.value.ref?.description],
|
||||||
() => {
|
() => {
|
||||||
translatedDescription.value = '';
|
translatedDescription.value = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,11 +401,30 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let modelsURL = '';
|
||||||
|
try {
|
||||||
|
const url = new URL(baseURL);
|
||||||
|
const basePath = url.pathname.replace(/\/+$/, '');
|
||||||
|
|
||||||
|
if (basePath.endsWith('/chat/completions')) {
|
||||||
|
url.pathname = basePath.replace(
|
||||||
|
/\/chat\/completions$/,
|
||||||
|
'/models'
|
||||||
|
);
|
||||||
|
} else if (basePath.endsWith('/models')) {
|
||||||
|
url.pathname = basePath;
|
||||||
|
} else {
|
||||||
|
url.pathname = `${basePath}/models`;
|
||||||
|
}
|
||||||
|
|
||||||
|
url.search = '';
|
||||||
|
url.hash = '';
|
||||||
|
modelsURL = url.toString();
|
||||||
|
} catch {
|
||||||
const normalizedBaseURL = baseURL.endsWith('/')
|
const normalizedBaseURL = baseURL.endsWith('/')
|
||||||
? baseURL.slice(0, -1)
|
? baseURL.slice(0, -1)
|
||||||
: baseURL;
|
: baseURL;
|
||||||
|
|
||||||
let modelsURL;
|
|
||||||
if (normalizedBaseURL.includes('/chat/completions')) {
|
if (normalizedBaseURL.includes('/chat/completions')) {
|
||||||
modelsURL = normalizedBaseURL.replace(
|
modelsURL = normalizedBaseURL.replace(
|
||||||
/\/chat\/completions$/,
|
/\/chat\/completions$/,
|
||||||
@@ -416,6 +435,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
|||||||
} else {
|
} else {
|
||||||
modelsURL = `${normalizedBaseURL}/models`;
|
modelsURL = `${normalizedBaseURL}/models`;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const headers = {};
|
const headers = {};
|
||||||
const keyToUse = overrides.key ?? translationApiKey.value;
|
const keyToUse = overrides.key ?? translationApiKey.value;
|
||||||
@@ -462,6 +482,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBioLanguage(language) {
|
function setBioLanguage(language) {
|
||||||
bioLanguage.value = language;
|
bioLanguage.value = language;
|
||||||
configRepository.setString('VRCX_bioLanguage', language);
|
configRepository.setString('VRCX_bioLanguage', language);
|
||||||
@@ -794,7 +815,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
|||||||
const translated = data?.choices?.[0]?.message?.content;
|
const translated = data?.choices?.[0]?.message?.content;
|
||||||
return typeof translated === 'string' ? translated.trim() : null;
|
return typeof translated === 'string' ? translated.trim() : null;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast.error(`Translation failed: ${err.message}`);
|
toast.error(`Translation failed`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,8 +164,8 @@
|
|||||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||||
import { Field, FieldContent, FieldGroup, FieldLabel } from '@/components/ui/field';
|
import { Field, FieldContent, FieldGroup, FieldLabel } from '@/components/ui/field';
|
||||||
import { InputGroupField, InputGroupTextareaField } from '@/components/ui/input-group';
|
|
||||||
import { reactive, ref, watch } from 'vue';
|
import { reactive, ref, watch } from 'vue';
|
||||||
|
import { InputGroupField, InputGroupTextareaField } from '@/components/ui/input-group';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { toast } from 'vue-sonner';
|
import { toast } from 'vue-sonner';
|
||||||
|
|||||||
Reference in New Issue
Block a user