Merge branch 'ui' into develop
This commit is contained in:
@@ -36,7 +36,23 @@ export const _useBackendErrorHandling = () => {
|
|||||||
|
|
||||||
const { updateTranslationStatus, updateTranscriptionSendStatus, updateTranscriptionReceiveStatus } = useMainFunction();
|
const { updateTranslationStatus, updateTranscriptionSendStatus, updateTranscriptionReceiveStatus } = useMainFunction();
|
||||||
|
|
||||||
const { updateDeepLAuthKey } = useTranslation();
|
const {
|
||||||
|
updateDeepLAuthKey,
|
||||||
|
|
||||||
|
updatePlamoAuthKey,
|
||||||
|
updatePlamoModel,
|
||||||
|
|
||||||
|
updateGeminiAuthKey,
|
||||||
|
updateGeminiModel,
|
||||||
|
|
||||||
|
updateOpenAIAuthKey,
|
||||||
|
updateOpenAIModel,
|
||||||
|
|
||||||
|
updateLMStudioUrl,
|
||||||
|
updateLMStudioModel,
|
||||||
|
|
||||||
|
updateOllamaModel,
|
||||||
|
} = useTranslation();
|
||||||
|
|
||||||
const { updateEnableVrcMicMuteSync } = useOthers();
|
const { updateEnableVrcMicMuteSync } = useOthers();
|
||||||
|
|
||||||
@@ -135,6 +151,106 @@ export const _useBackendErrorHandling = () => {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case "/set/data/plamo_auth_key":
|
||||||
|
if (message === "Plamo auth key length is not correct") {
|
||||||
|
updatePlamoAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "plamo_auth_key" });
|
||||||
|
} else if (message === "Authentication failure of plamo auth key") {
|
||||||
|
updatePlamoAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "plamo_auth_key" });
|
||||||
|
} else {
|
||||||
|
updatePlamoAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "plamo_auth_key" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/gemini_auth_key":
|
||||||
|
if (message === "Gemini auth key length is not correct") {
|
||||||
|
updateGeminiAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "gemini_auth_key" });
|
||||||
|
} else if (message === "Authentication failure of gemini auth key") {
|
||||||
|
updateGeminiAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "gemini_auth_key" });
|
||||||
|
} else {
|
||||||
|
updateGeminiAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "gemini_auth_key" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/openai_auth_key":
|
||||||
|
if (message === "OpenAI auth key is not valid") {
|
||||||
|
updateOpenAIAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "openai_auth_key" });
|
||||||
|
} else if (message === "Authentication failure of OpenAI auth key") {
|
||||||
|
updateOpenAIAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "openai_auth_key" });
|
||||||
|
} else {
|
||||||
|
updateOpenAIAuthKey(data);
|
||||||
|
showNotification_Error(message, { category_id: "openai_auth_key" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
case "/set/data/selected_plamo_model":
|
||||||
|
if (message === "Plamo model is not valid") {
|
||||||
|
updatePlamoModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_plamo_model" });
|
||||||
|
} else {
|
||||||
|
updatePlamoModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_plamo_model" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/selected_gemini_model":
|
||||||
|
if (message === "Gemini model is not valid") {
|
||||||
|
updateGeminiModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_gemini_model" });
|
||||||
|
} else {
|
||||||
|
updateGeminiModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_gemini_model" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/selected_openai_model":
|
||||||
|
if (message === "OpenAI model is not valid") {
|
||||||
|
updateOpenAIModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_openai_model" });
|
||||||
|
} else {
|
||||||
|
updateOpenAIModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_openai_model" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/lmstudio_url":
|
||||||
|
if (message === "LMStudio URL is not valid") {
|
||||||
|
updateLMStudioUrl(data);
|
||||||
|
showNotification_Error(message, { category_id: "lmstudio_url" });
|
||||||
|
} else {
|
||||||
|
updateLMStudioUrl(data);
|
||||||
|
showNotification_Error(message, { category_id: "lmstudio_url" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/selected_lmstudio_model":
|
||||||
|
if (message === "LMStudio model is not valid") {
|
||||||
|
updateLMStudioModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_lmstudio_model" });
|
||||||
|
} else {
|
||||||
|
updateLMStudioModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_lmstudio_model" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "/set/data/selected_ollama_model":
|
||||||
|
if (message === "ollama model is not valid") {
|
||||||
|
updateOllamaModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_ollama_model" });
|
||||||
|
} else {
|
||||||
|
updateOllamaModel(data);
|
||||||
|
showNotification_Error(message, { category_id: "selected_ollama_model" });
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
case "/set/data/mic_record_timeout":
|
case "/set/data/mic_record_timeout":
|
||||||
if (message === "Mic record timeout value is out of range") {
|
if (message === "Mic record timeout value is out of range") {
|
||||||
updateMicRecordTimeout(data);
|
updateMicRecordTimeout(data);
|
||||||
@@ -241,6 +357,9 @@ export const _useBackendErrorHandling = () => {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
console.error(`Invalid endpoint or message: ${endpoint}\nmessage: ${message}\nresult: ${JSON.stringify(result)}`);
|
console.error(`Invalid endpoint or message: ${endpoint}\nmessage: ${message}\nresult: ${JSON.stringify(result)}`);
|
||||||
|
showNotification_Error(
|
||||||
|
`An error occurred. Please contact the developers and restart VRCT. Error: Invalid endpoint or message: ${endpoint}\nmessage: ${message}\nresult: ${JSON.stringify(result)}`, { hide_duration: null }
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ const useStartPython = () => {
|
|||||||
});
|
});
|
||||||
command.stderr.on("data", line => {
|
command.stderr.on("data", line => {
|
||||||
showNotification_Error(
|
showNotification_Error(
|
||||||
`An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null });
|
`An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null }
|
||||||
|
);
|
||||||
console.error("stderr", line);
|
console.error("stderr", line);
|
||||||
});
|
});
|
||||||
const backend_subprocess = await command.spawn();
|
const backend_subprocess = await command.spawn();
|
||||||
|
|||||||
Reference in New Issue
Block a user