mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-19 03:00:49 +08:00
refactor(api-keys): fetch keys from API and reduce log limit
This commit is contained in:
@@ -2,10 +2,10 @@ export const apiKeysModule = {
|
|||||||
// 加载API密钥
|
// 加载API密钥
|
||||||
async loadApiKeys() {
|
async loadApiKeys() {
|
||||||
try {
|
try {
|
||||||
const config = await this.getConfig();
|
const data = await this.makeRequest('/api-keys');
|
||||||
if (config['api-keys']) {
|
const apiKeysValue = data?.['api-keys'] || [];
|
||||||
this.renderApiKeys(config['api-keys']);
|
const keys = Array.isArray(apiKeysValue) ? apiKeysValue : [];
|
||||||
}
|
this.renderApiKeys(keys);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载API密钥失败:', error);
|
console.error('加载API密钥失败:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const OAUTH_MAX_POLL_DURATION_MS = 5 * 60 * 1000;
|
|||||||
* 最大日志显示行数
|
* 最大日志显示行数
|
||||||
* 限制内存占用,避免大量日志导致页面卡顿
|
* 限制内存占用,避免大量日志导致页面卡顿
|
||||||
*/
|
*/
|
||||||
export const MAX_LOG_LINES = 10000;
|
export const MAX_LOG_LINES = 2000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证文件列表默认每页显示数量
|
* 认证文件列表默认每页显示数量
|
||||||
|
|||||||
Reference in New Issue
Block a user