diff --git a/static/js/redis_compare.js b/static/js/redis_compare.js index 55db09e..a079233 100644 --- a/static/js/redis_compare.js +++ b/static/js/redis_compare.js @@ -900,9 +900,9 @@ async function loadRedisConfigGroupsForManagement() { const response = await fetch('/api/redis/config-groups'); const result = await response.json(); - const container = document.getElementById('redisConfigGroupList'); + const container = document.getElementById('redisConfigGroupsList'); if (!container) { - console.error('Redis配置组列表容器未找到: redisConfigGroupList'); + console.error('Redis配置组列表容器未找到: redisConfigGroupsList'); showAlert('Redis配置组列表容器未找到,请检查页面结构', 'danger'); return; } @@ -938,7 +938,7 @@ async function loadRedisConfigGroupsForManagement() { console.log('没有找到Redis配置组数据'); } } catch (error) { - const container = document.getElementById('redisConfigGroupList'); + const container = document.getElementById('redisConfigGroupsList'); if (container) { container.innerHTML = '
加载失败: ' + error.message + '
'; } @@ -2195,80 +2195,6 @@ async function saveRedisConfigGroup() { } } -// 显示管理Redis配置组对话框 -function showManageRedisConfigDialog() { - loadRedisConfigGroupsForManagement(); - new bootstrap.Modal(document.getElementById('manageRedisConfigModal')).show(); -} - -// 为管理界面加载Redis配置组 -async function loadRedisConfigGroupsForManagement() { - try { - const response = await fetch('/api/redis/config-groups'); - const result = await response.json(); - - if (result.success) { - displayRedisConfigGroupsForManagement(result.data); - } else { - showAlert(`加载配置组失败: ${result.error}`, 'danger'); - } - } catch (error) { - console.error('加载Redis配置组失败:', error); - showAlert(`加载失败: ${error.message}`, 'danger'); - } -} - -// 显示Redis配置组管理列表 -function displayRedisConfigGroupsForManagement(configGroups) { - const container = document.getElementById('redisConfigGroupsList'); - - if (!configGroups || configGroups.length === 0) { - container.innerHTML = '
暂无保存的配置组
'; - return; - } - - let html = ''; - configGroups.forEach(config => { - html += ` -
-
-
-
-
- ${config.name} -
-

${config.description || '无描述'}

-
- 创建时间: ${config.created_at} - ${config.updated_at !== config.created_at ? `
更新时间: ${config.updated_at}` : ''} -
-
-
- - - - - -
-
-
-
- `; - }); - - container.innerHTML = html; -} - // 刷新Redis配置组列表 function refreshRedisConfigGroups() { loadRedisConfigGroupsForManagement(); diff --git a/templates/redis_compare.html b/templates/redis_compare.html index f7df931..163be95 100644 --- a/templates/redis_compare.html +++ b/templates/redis_compare.html @@ -674,22 +674,6 @@ - -