Enhance Vertex AI model selection by adding data-mode attributes

- Updated index.html to include data-mode attributes for model optgroups, distinguishing between express and full modes.
- Modified openai.js to show/hide model groups based on the selected authentication mode, improving user experience and functionality.
This commit is contained in:
InterestingDarkness
2025-05-27 00:43:31 +08:00
parent 9e71b70f75
commit 453c177a8e
2 changed files with 12 additions and 20 deletions

View File

@@ -5538,23 +5538,15 @@ function onVertexAIAuthModeChange() {
if (authMode === 'express') {
$('#vertexai_express_config').show();
$('#vertexai_full_config').hide();
$('#vertexai_express_models').show();
// Hide all full version model groups
$('#vertexai_full_gemini_25').hide();
$('#vertexai_full_gemini_20').hide();
$('#vertexai_full_gemini_15').hide();
$('#vertexai_full_gemma').hide();
$('#vertexai_full_learnlm').hide();
// Show express mode model groups and hide full version model groups
$('#model_vertexai_select optgroup[data-mode="express"]').show();
$('#model_vertexai_select optgroup[data-mode="full"]').hide();
} else {
$('#vertexai_express_config').hide();
$('#vertexai_full_config').show();
$('#vertexai_express_models').hide();
// Show all full version model groups
$('#vertexai_full_gemini_25').show();
$('#vertexai_full_gemini_20').show();
$('#vertexai_full_gemini_15').show();
$('#vertexai_full_gemma').show();
$('#vertexai_full_learnlm').show();
// Hide express mode model groups and show full version model groups
$('#model_vertexai_select optgroup[data-mode="express"]').hide();
$('#model_vertexai_select optgroup[data-mode="full"]').show();
}
saveSettingsDebounced();