Fix model options hiding on Chrome
| @@ -3237,7 +3237,7 @@ | |||
| 3237 | </div> | 3237 | </div> |
| 3238 | 3238 | ||
| 3239 | <!-- Express Mode Configuration --> | 3239 | <!-- Express Mode Configuration --> |
| 3240 | <div id="vertexai_express_config" class="vertexai-auth-section"> | 3240 | <div id="vertexai_express_config" class="vertexai-auth-section" data-mode="express"> |
| 3241 | <h4> | 3241 | <h4> |
| 3242 | <span data-i18n="Google Vertex AI API Key"> | 3242 | <span data-i18n="Google Vertex AI API Key"> |
| 3243 | Google Vertex AI API Key | 3243 | Google Vertex AI API Key |
| @@ -3256,7 +3256,7 @@ | |||
| 3256 | </div> | 3256 | </div> |
| 3257 | 3257 | ||
| 3258 | <!-- Full Version Configuration --> | 3258 | <!-- Full Version Configuration --> |
| 3259 | <div id="vertexai_full_config" class="vertexai-auth-section" style="display: none;"> | 3259 | <div id="vertexai_full_config" class="vertexai-auth-section" data-mode="full"> |
| 3260 | <h4> | 3260 | <h4> |
| 3261 | <span data-i18n="Service Account Configuration"> | 3261 | <span data-i18n="Service Account Configuration"> |
| 3262 | Service Account Configuration | 3262 | Service Account Configuration |
| @@ -3293,8 +3293,8 @@ | |||
| 3293 | Paste the complete JSON content of your Google Cloud Service Account key file. The content will be stored securely. | 3293 | Paste the complete JSON content of your Google Cloud Service Account key file. The content will be stored securely. |
| 3294 | </div> | 3294 | </div> |
| 3295 | <div class="flex-container"> | 3295 | <div class="flex-container"> |
| 3296 | <button type="button" id="vertexai_validate_service_account" class="menu_button" data-i18n="Validate JSON">Validate JSON</button> | 3296 | <button type="button" id="vertexai_validate_service_account" class="menu_button menu_button_icon" data-i18n="Validate JSON">Validate JSON</button> |
| 3297 | <button type="button" id="vertexai_clear_service_account" class="menu_button" data-i18n="Clear">Clear</button> | 3297 | <button type="button" id="vertexai_clear_service_account" class="menu_button menu_button_icon" data-i18n="Clear">Clear</button> |
| 3298 | </div> | 3298 | </div> |
| 3299 | <div id="vertexai_service_account_status" class="info-block" style="display: none;"> | 3299 | <div id="vertexai_service_account_status" class="info-block" style="display: none;"> |
| 3300 | <span id="vertexai_service_account_info"></span> | 3300 | <span id="vertexai_service_account_info"></span> |
| @@ -3317,14 +3317,14 @@ | |||
| 3317 | </optgroup> | 3317 | </optgroup> |
| 3318 | 3318 | ||
| 3319 | <!-- Full Version Models --> | 3319 | <!-- Full Version Models --> |
| 3320 | <optgroup id="vertexai_full_gemini_25" label="Gemini 2.5" data-mode="full" style="display: none;"> | 3320 | <optgroup id="vertexai_full_gemini_25" label="Gemini 2.5" data-mode="full"> |
| 3321 | <option value="gemini-2.5-pro-preview-05-06">gemini-2.5-pro-preview-05-06</option> | 3321 | <option value="gemini-2.5-pro-preview-05-06">gemini-2.5-pro-preview-05-06</option> |
| 3322 | <option value="gemini-2.5-pro-preview-03-25">gemini-2.5-pro-preview-03-25</option> | 3322 | <option value="gemini-2.5-pro-preview-03-25">gemini-2.5-pro-preview-03-25</option> |
| 3323 | <option value="gemini-2.5-pro-exp-03-25">gemini-2.5-pro-exp-03-25</option> | 3323 | <option value="gemini-2.5-pro-exp-03-25">gemini-2.5-pro-exp-03-25</option> |
| 3324 | <option value="gemini-2.5-flash-preview-05-20">gemini-2.5-flash-preview-05-20</option> | 3324 | <option value="gemini-2.5-flash-preview-05-20">gemini-2.5-flash-preview-05-20</option> |
| 3325 | <option value="gemini-2.5-flash-preview-04-17">gemini-2.5-flash-preview-04-17</option> | 3325 | <option value="gemini-2.5-flash-preview-04-17">gemini-2.5-flash-preview-04-17</option> |
| 3326 | </optgroup> | 3326 | </optgroup> |
| 3327 | <optgroup id="vertexai_full_gemini_20" label="Gemini 2.0" data-mode="full" style="display: none;"> | 3327 | <optgroup id="vertexai_full_gemini_20" label="Gemini 2.0" data-mode="full"> |
| 3328 | <option value="gemini-2.0-flash-001">gemini-2.0-flash-001</option> | 3328 | <option value="gemini-2.0-flash-001">gemini-2.0-flash-001</option> |
| 3329 | <option value="gemini-2.0-flash-exp">gemini-2.0-flash-exp</option> | 3329 | <option value="gemini-2.0-flash-exp">gemini-2.0-flash-exp</option> |
| 3330 | <option value="gemini-2.0-flash-preview-image-generation">gemini-2.0-flash-preview-image-generation</option> | 3330 | <option value="gemini-2.0-flash-preview-image-generation">gemini-2.0-flash-preview-image-generation</option> |
| @@ -5521,20 +5521,11 @@ function onVertexAIAuthModeChange() { | |||
| 5521 | const authMode = String($(this).val()); | 5521 | const authMode = String($(this).val()); |
| 5522 | oai_settings.vertexai_auth_mode = authMode; | 5522 | oai_settings.vertexai_auth_mode = authMode; |
| 5523 | 5523 | ||
| 5524 | // Show/hide appropriate configuration sections | 5524 | $('#vertexai_form [data-mode]').each(function () { |
| 5525 | if (authMode === 'express') { | 5525 | const mode = $(this).data('mode'); |
| 5526 | $('#vertexai_express_config').show(); | 5526 | $(this).toggle(mode === authMode); |
| 5527 | $('#vertexai_full_config').hide(); | 5527 | $(this).find('option').toggle(mode === authMode); |
| 5528 | // Show express mode model groups and hide full version model groups | 5528 | }); |
| 5529 | $('#model_vertexai_select optgroup[data-mode="express"]').show(); | ||
| 5530 | $('#model_vertexai_select optgroup[data-mode="full"]').hide(); | ||
| 5531 | } else { | ||
| 5532 | $('#vertexai_express_config').hide(); | ||
| 5533 | $('#vertexai_full_config').show(); | ||
| 5534 | // Hide express mode model groups and show full version model groups | ||
| 5535 | $('#model_vertexai_select optgroup[data-mode="express"]').hide(); | ||
| 5536 | $('#model_vertexai_select optgroup[data-mode="full"]').show(); | ||
| 5537 | } | ||
| 5538 | 5529 | ||
| 5539 | saveSettingsDebounced(); | 5530 | saveSettingsDebounced(); |
| 5540 | } | 5531 | } |