fix: improve mode toggle robustness and add i18n support
- Make mode detection more robust (handle ::1, 0.0.0.0) - Add getProxyPort() to parse port from ANTHROPIC_BASE_URL dynamically - Add i18n translation keys for mode toggle in all 5 languages - Update settings.html to use translation keys and dynamic port Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -628,7 +628,12 @@ export function mountWebUI(app, dirname, accountManager) {
|
||||
const baseUrl = claudeConfig.env?.ANTHROPIC_BASE_URL || '';
|
||||
|
||||
// Determine mode based on ANTHROPIC_BASE_URL
|
||||
const isProxy = baseUrl.includes('localhost') || baseUrl.includes('127.0.0.1');
|
||||
const isProxy = baseUrl && (
|
||||
baseUrl.includes('localhost') ||
|
||||
baseUrl.includes('127.0.0.1') ||
|
||||
baseUrl.includes('::1') ||
|
||||
baseUrl.includes('0.0.0.0')
|
||||
);
|
||||
|
||||
res.json({
|
||||
status: 'ok',
|
||||
|
||||
Reference in New Issue
Block a user