Enhance API key handling in settings and vocab services: Update key retrieval logic to improve validation and status reporting. Introduce new localization strings for key status messages in English, German, and Spanish. Update LanguageAssistantView to display key status dynamically, enhancing user feedback on API key management.
This commit is contained in:
@@ -428,14 +428,16 @@ class SettingsService extends BaseService{
|
||||
}
|
||||
}
|
||||
|
||||
const hasKey = Boolean(keyRow && keyRow.value && String(keyRow.value).trim());
|
||||
const hasStoredKey = Boolean(keyRow && keyRow.getDataValue('value') && String(keyRow.getDataValue('value')).trim());
|
||||
const hasReadableKey = Boolean(keyRow && keyRow.value && String(keyRow.value).trim());
|
||||
|
||||
return {
|
||||
enabled: parsed.enabled !== false,
|
||||
baseUrl: parsed.baseUrl || '',
|
||||
model: parsed.model || 'gpt-4o-mini',
|
||||
hasKey,
|
||||
keyLast4: parsed.keyLast4 || null
|
||||
hasKey: hasStoredKey,
|
||||
keyLast4: parsed.keyLast4 || null,
|
||||
keyStatus: hasStoredKey ? (hasReadableKey ? 'stored' : 'invalid') : 'missing'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user