mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-25 09:25:59 +03:00
[PR #337] [MERGED] fix: 修复插件管理页面卡片重复渲染问题 #341
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#341
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/337
Author: @lly835
Created: 2/25/2026
Status: ✅ Merged
Merged: 2/26/2026
Merged by: @justlovemaki
Base:
main← Head:fix/plugin-list-duplicate-rendering📝 Commits (1)
f44222bfix: clear plugin list container before rendering to prevent duplicate cards📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
static/app/plugin-manager.js(+2 -0)📄 Description
问题描述
插件管理页面(Plugins)中,插件卡片会重复显示。例如 ai-monitor、api-potluck、default-auth 等插件各出现两次。
根因分析
static/app/plugin-manager.js中的renderPluginsList()函数在渲染插件卡片时,只通过appendChild向容器追加元素,但没有先清空容器。虽然
loadPlugins()在调用renderPluginsList()之前会执行listEl.innerHTML = "",但在以下场景中仍会导致重复:togglePlugin切换状态后重新加载列表修复方案
在
renderPluginsList()函数开头添加listEl.innerHTML = ""清空容器,确保每次渲染都是干净的,从根本上防止卡片重复。改动范围
static/app/plugin-manager.js:renderPluginsList()函数增加一行清空逻辑改动极小(+1 行),无副作用。
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.