mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 03:10:50 +08:00
fix(i18n, ui): correct syntax error in generateDynamicTypeLabel method
- Move generateDynamicTypeLabel method from inside updateAuthFileFilterButtons to proper class method location
- Fix JavaScript syntax error that prevented app from loading
- Preserve all internationalization functionality from 257260b
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
25
app.js
25
app.js
@@ -3259,18 +3259,7 @@ class CLIProxyManager {
|
|||||||
btn.setAttribute('data-i18n-text', dynamicKey);
|
btn.setAttribute('data-i18n-text', dynamicKey);
|
||||||
btn.textContent = this.generateDynamicTypeLabel(type);
|
btn.textContent = this.generateDynamicTypeLabel(type);
|
||||||
}
|
}
|
||||||
// 生成动态类型标签
|
|
||||||
generateDynamicTypeLabel(type) {
|
|
||||||
if (!type) return '';
|
|
||||||
const key = `auth_files.type_${type}`;
|
|
||||||
const translated = i18n.t(key);
|
|
||||||
if (translated && translated !== key) {
|
|
||||||
return translated;
|
|
||||||
}
|
|
||||||
if (type.toLowerCase() === 'iflow') return 'iFlow';
|
|
||||||
return type.charAt(0).toUpperCase() + type.slice(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 插入到 Empty 按钮之前(如果存在)
|
// 插入到 Empty 按钮之前(如果存在)
|
||||||
const emptyBtn = filterContainer.querySelector('[data-type="empty"]');
|
const emptyBtn = filterContainer.querySelector('[data-type="empty"]');
|
||||||
if (emptyBtn) {
|
if (emptyBtn) {
|
||||||
@@ -3307,6 +3296,18 @@ class CLIProxyManager {
|
|||||||
this.refreshFilterButtonTexts();
|
this.refreshFilterButtonTexts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成动态类型标签
|
||||||
|
generateDynamicTypeLabel(type) {
|
||||||
|
if (!type) return '';
|
||||||
|
const key = `auth_files.type_${type}`;
|
||||||
|
const translated = i18n.t(key);
|
||||||
|
if (translated && translated !== key) {
|
||||||
|
return translated;
|
||||||
|
}
|
||||||
|
if (type.toLowerCase() === 'iflow') return 'iFlow';
|
||||||
|
return type.charAt(0).toUpperCase() + type.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
// 绑定认证文件筛选事件
|
// 绑定认证文件筛选事件
|
||||||
bindAuthFileFilterEvents() {
|
bindAuthFileFilterEvents() {
|
||||||
const filterContainer = document.querySelector('.auth-file-filter');
|
const filterContainer = document.querySelector('.auth-file-filter');
|
||||||
|
|||||||
Reference in New Issue
Block a user