Merge branch 'ui' into develop

This commit is contained in:
Sakamoto Shiina
2025-12-10 17:09:01 +09:00
5 changed files with 45 additions and 13 deletions

View File

@@ -76,6 +76,7 @@ config_page:
common: common:
version: "Version {{version}}" version: "Version {{version}}"
model_download_button_label: "Download" model_download_button_label: "Download"
correct_auth_key_required: "Correct Auth Key Required"
compute_device: compute_device:
desc: "The accuracy and speed of each processing type may vary depending on your machine specs, and the compatibility with calculation methods may differ from the displayed order. Please use this as a general guideline." desc: "The accuracy and speed of each processing type may vary depending on your machine specs, and the compatibility with calculation methods may differ from the displayed order. Please use this as a general guideline."
label_device: "Processing Device" label_device: "Processing Device"

View File

@@ -48,7 +48,7 @@ export const _useBackendErrorHandling = () => {
updateOpenAIAuthKey, updateOpenAIAuthKey,
updateSelectedOpenAIModel, updateSelectedOpenAIModel,
updateLMStudioUrl, updateLMStudioURL,
updateSelectedLMStudioModel, updateSelectedLMStudioModel,
updateSelectedOllamaModel, updateSelectedOllamaModel,
@@ -223,10 +223,10 @@ export const _useBackendErrorHandling = () => {
case "/set/data/lmstudio_url": case "/set/data/lmstudio_url":
if (message === "LMStudio URL is not valid") { if (message === "LMStudio URL is not valid") {
updateLMStudioUrl(data); updateLMStudioURL(data);
showNotification_Error(message, { category_id: "lmstudio_url" }); showNotification_Error(message, { category_id: "lmstudio_url" });
} else { } else {
updateLMStudioUrl(data); updateLMStudioURL(data);
showNotification_Error(message, { category_id: "lmstudio_url" }); showNotification_Error(message, { category_id: "lmstudio_url" });
} }
return; return;

View File

@@ -6,6 +6,7 @@
justify-content: center; justify-content: center;
width: 100%; width: 100%;
max-width: 8rem; max-width: 8rem;
flex-shrink: 0;
} }
.download_button { .download_button {

View File

@@ -4,6 +4,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 2.8rem; gap: 2.8rem;
flex-shrink: 0;
} }
.each_dropdown_menu_wrapper { .each_dropdown_menu_wrapper {
@@ -12,6 +13,7 @@
gap: 0.6rem; gap: 0.6rem;
white-space: nowrap; white-space: nowrap;
max-width: 24rem; max-width: 24rem;
flex-shrink: 0;
&.is_disabled { &.is_disabled {
pointer-events: none; pointer-events: none;
} }

View File

@@ -294,22 +294,28 @@ const PlamoModelContainer = () => {
currentSelectedPlamoModel, currentSelectedPlamoModel,
setSelectedPlamoModel, setSelectedPlamoModel,
currentPlamoAuthKey,
} = useTranslation(); } = useTranslation();
if (currentSelectablePlamoModelList.data.length === 0) return null;
const selectFunction = (selected_data) => { const selectFunction = (selected_data) => {
setSelectedPlamoModel(selected_data.selected_id); setSelectedPlamoModel(selected_data.selected_id);
}; };
let selected_label = (!currentPlamoAuthKey.data && !currentSelectedPlamoModel.data) ? t("config_page.common.correct_auth_key_required") : currentSelectedPlamoModel.data;
return ( return (
<DropdownMenuContainer <DropdownMenuContainer
dropdown_id="select_plamo_model" dropdown_id="select_plamo_model"
label="Select Plamo Model" label="Select Plamo Model"
selected_id={currentSelectedPlamoModel.data} selected_id={selected_label}
list={currentSelectablePlamoModelList.data} list={currentSelectablePlamoModelList.data}
selectFunction={selectFunction} selectFunction={selectFunction}
state={currentSelectedPlamoModel.state} state={currentSelectedPlamoModel.state}
is_disabled={!currentPlamoAuthKey.data}
/> />
); );
}; };
@@ -350,22 +356,28 @@ const GeminiModelContainer = () => {
currentSelectedGeminiModel, currentSelectedGeminiModel,
setSelectedGeminiModel, setSelectedGeminiModel,
currentGeminiAuthKey,
} = useTranslation(); } = useTranslation();
if (currentSelectableGeminiModelList.data.length === 0) return null;
const selectFunction = (selected_data) => { const selectFunction = (selected_data) => {
setSelectedGeminiModel(selected_data.selected_id); setSelectedGeminiModel(selected_data.selected_id);
}; };
let selected_label = (!currentGeminiAuthKey.data && !currentSelectedGeminiModel.data)
? t("config_page.common.correct_auth_key_required")
: currentSelectedGeminiModel.data;
return ( return (
<DropdownMenuContainer <DropdownMenuContainer
dropdown_id="select_gemini_model" dropdown_id="select_gemini_model"
label="Select Gemini Model" label="Select Gemini Model"
selected_id={currentSelectedGeminiModel.data} selected_id={selected_label}
list={currentSelectableGeminiModelList.data} list={currentSelectableGeminiModelList.data}
selectFunction={selectFunction} selectFunction={selectFunction}
state={currentSelectedGeminiModel.state} state={currentSelectedGeminiModel.state}
is_disabled={!currentGeminiAuthKey.data}
/> />
); );
}; };
@@ -405,22 +417,28 @@ const OpenAIModelContainer = () => {
currentSelectedOpenAIModel, currentSelectedOpenAIModel,
setSelectedOpenAIModel, setSelectedOpenAIModel,
currentOpenAIAuthKey,
} = useTranslation(); } = useTranslation();
if (currentSelectableOpenAIModelList.data.length === 0) return null;
const selectFunction = (selected_data) => { const selectFunction = (selected_data) => {
setSelectedOpenAIModel(selected_data.selected_id); setSelectedOpenAIModel(selected_data.selected_id);
}; };
let selected_label = (!currentOpenAIAuthKey.data && !currentSelectedOpenAIModel.data)
? t("config_page.common.correct_auth_key_required")
: currentSelectedOpenAIModel.data;
return ( return (
<DropdownMenuContainer <DropdownMenuContainer
dropdown_id="select_openai_model" dropdown_id="select_openai_model"
label="Select OpenAI Model" label="Select OpenAI Model"
selected_id={currentSelectedOpenAIModel.data} selected_id={selected_label}
list={currentSelectableOpenAIModelList.data} list={currentSelectableOpenAIModelList.data}
selectFunction={selectFunction} selectFunction={selectFunction}
state={currentSelectedOpenAIModel.state} state={currentSelectedOpenAIModel.state}
is_disabled={!currentOpenAIAuthKey.data}
/> />
); );
}; };
@@ -479,20 +497,25 @@ const LMStudioModelContainer = () => {
setSelectedLMStudioModel, setSelectedLMStudioModel,
} = useTranslation(); } = useTranslation();
if (currentSelectableLMStudioModelList.data.length === 0) return null; const { currentIsLMStudioConnected } = useLLMConnection();
const selectFunction = (selected_data) => { const selectFunction = (selected_data) => {
setSelectedLMStudioModel(selected_data.selected_id); setSelectedLMStudioModel(selected_data.selected_id);
}; };
let selected_label = (!currentIsLMStudioConnected.data && !currentSelectedLMStudioModel.data)
? "Connection Required"
: currentSelectedLMStudioModel.data;
return ( return (
<DropdownMenuContainer <DropdownMenuContainer
dropdown_id="select_lmstudio_model" dropdown_id="select_lmstudio_model"
label="Select LMStudio Model" label="Select LMStudio Model"
selected_id={currentSelectedLMStudioModel.data} selected_id={selected_label}
list={currentSelectableLMStudioModelList.data} list={currentSelectableLMStudioModelList.data}
selectFunction={selectFunction} selectFunction={selectFunction}
state={currentSelectedLMStudioModel.state} state={currentSelectedLMStudioModel.state}
is_disabled={!currentIsLMStudioConnected.data}
/> />
); );
}; };
@@ -523,20 +546,25 @@ const OllamaModelContainer = () => {
setSelectedOllamaModel, setSelectedOllamaModel,
} = useTranslation(); } = useTranslation();
if (currentSelectableOllamaModelList.data.length === 0) return null; const { currentIsOllamaConnected } = useLLMConnection();
const selectFunction = (selected_data) => { const selectFunction = (selected_data) => {
setSelectedOllamaModel(selected_data.selected_id); setSelectedOllamaModel(selected_data.selected_id);
}; };
let selected_label = (!currentIsOllamaConnected.data && !currentSelectedOllamaModel.data)
? "Connection Required"
: currentSelectedOllamaModel.data;
return ( return (
<DropdownMenuContainer <DropdownMenuContainer
dropdown_id="select_ollama_model" dropdown_id="select_ollama_model"
label="Select Ollama Model" label="Select Ollama Model"
selected_id={currentSelectedOllamaModel.data} selected_id={selected_label}
list={currentSelectableOllamaModelList.data} list={currentSelectableOllamaModelList.data}
selectFunction={selectFunction} selectFunction={selectFunction}
state={currentSelectedOllamaModel.state} state={currentSelectedOllamaModel.state}
is_disabled={!currentIsOllamaConnected.data}
/> />
); );
}; };