()
| 671 | |
| 672 | window.testAIConfigFromDialog = async function testAIConfigFromDialog() { |
| 673 | const resultDiv = document.getElementById('ai-config-result'); |
| 674 | if (resultDiv) resultDiv.textContent = 'Testing...'; |
| 675 | if (!window.electron || typeof window.electron.testAIConfig !== 'function') { |
| 676 | if (resultDiv) resultDiv.textContent = 'Error: AI config not available (not connected?).'; |
| 677 | if (window.electron?.showMessage) await window.electron.showMessage('Error', 'AI config test is not available.'); |
| 678 | return; |
| 679 | } |
| 680 | const apiKeyEl = document.getElementById('ai-api-key'); |
| 681 | const endpointEl = document.getElementById('ai-endpoint'); |
| 682 | const modelEl = document.getElementById('ai-model'); |
| 683 | const serviceEl = document.getElementById('ai-service-select'); |
| 684 | if (!apiKeyEl || !endpointEl || !modelEl || !serviceEl) { |
| 685 | if (resultDiv) resultDiv.textContent = 'Error: Form fields not found.'; |
| 686 | return; |
| 687 | } |
| 688 | const selectedOption = serviceEl.options && serviceEl.options[serviceEl.selectedIndex]; |
nothing calls this directly
no test coverage detected