mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-21 11:21:13 +02:00
Add files via upload
This commit is contained in:
@@ -3826,6 +3826,41 @@ header {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tools-status-filter {
|
||||||
|
display: flex;
|
||||||
|
gap: 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tools-status-filter .btn-filter {
|
||||||
|
padding: 6px 12px;
|
||||||
|
border: none;
|
||||||
|
border-right: 1px solid var(--border-color);
|
||||||
|
background: var(--bg-primary);
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tools-status-filter .btn-filter:last-child {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tools-status-filter .btn-filter:hover {
|
||||||
|
background: var(--bg-tertiary);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tools-status-filter .btn-filter.active {
|
||||||
|
background: var(--accent-color);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.page-size-selector {
|
.page-size-selector {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -507,6 +507,8 @@
|
|||||||
"toolSearchPlaceholder": "Enter tool name...",
|
"toolSearchPlaceholder": "Enter tool name...",
|
||||||
"statusFilter": "Status filter",
|
"statusFilter": "Status filter",
|
||||||
"filterAll": "All",
|
"filterAll": "All",
|
||||||
|
"filterEnabled": "Enabled",
|
||||||
|
"filterDisabled": "Disabled",
|
||||||
"selectedCount": "{{count}} selected",
|
"selectedCount": "{{count}} selected",
|
||||||
"selectAll": "Select all",
|
"selectAll": "Select all",
|
||||||
"deselectAll": "Deselect all",
|
"deselectAll": "Deselect all",
|
||||||
|
|||||||
@@ -507,6 +507,8 @@
|
|||||||
"toolSearchPlaceholder": "输入工具名称...",
|
"toolSearchPlaceholder": "输入工具名称...",
|
||||||
"statusFilter": "状态筛选",
|
"statusFilter": "状态筛选",
|
||||||
"filterAll": "全部",
|
"filterAll": "全部",
|
||||||
|
"filterEnabled": "已启用",
|
||||||
|
"filterDisabled": "已停用",
|
||||||
"selectedCount": "已选择 {{count}} 项",
|
"selectedCount": "已选择 {{count}} 项",
|
||||||
"selectAll": "全选",
|
"selectAll": "全选",
|
||||||
"deselectAll": "全不选",
|
"deselectAll": "全不选",
|
||||||
|
|||||||
@@ -273,6 +273,9 @@ async function loadConfig(loadTools = true) {
|
|||||||
// 工具搜索关键词
|
// 工具搜索关键词
|
||||||
let toolsSearchKeyword = '';
|
let toolsSearchKeyword = '';
|
||||||
|
|
||||||
|
// 工具状态筛选: '' = 全部, 'true' = 已启用, 'false' = 已停用
|
||||||
|
let toolsStatusFilter = '';
|
||||||
|
|
||||||
// 加载工具列表(分页)
|
// 加载工具列表(分页)
|
||||||
async function loadToolsList(page = 1, searchKeyword = '') {
|
async function loadToolsList(page = 1, searchKeyword = '') {
|
||||||
const toolsList = document.getElementById('tools-list');
|
const toolsList = document.getElementById('tools-list');
|
||||||
@@ -292,6 +295,9 @@ async function loadToolsList(page = 1, searchKeyword = '') {
|
|||||||
if (searchKeyword) {
|
if (searchKeyword) {
|
||||||
url += `&search=${encodeURIComponent(searchKeyword)}`;
|
url += `&search=${encodeURIComponent(searchKeyword)}`;
|
||||||
}
|
}
|
||||||
|
if (toolsStatusFilter !== '') {
|
||||||
|
url += `&enabled=${toolsStatusFilter}`;
|
||||||
|
}
|
||||||
|
|
||||||
// 使用较短的超时时间(10秒),避免长时间等待
|
// 使用较短的超时时间(10秒),避免长时间等待
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
@@ -387,6 +393,17 @@ function handleSearchKeyPress(event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 按状态筛选工具
|
||||||
|
function filterToolsByStatus(status) {
|
||||||
|
toolsStatusFilter = status;
|
||||||
|
// 更新按钮激活状态
|
||||||
|
document.querySelectorAll('.tools-status-filter .btn-filter').forEach(btn => {
|
||||||
|
btn.classList.toggle('active', btn.dataset.filter === status);
|
||||||
|
});
|
||||||
|
// 重置到第一页并重新加载
|
||||||
|
loadToolsList(1, toolsSearchKeyword);
|
||||||
|
}
|
||||||
|
|
||||||
// 渲染工具列表
|
// 渲染工具列表
|
||||||
function renderToolsList() {
|
function renderToolsList() {
|
||||||
const toolsList = document.getElementById('tools-list');
|
const toolsList = document.getElementById('tools-list');
|
||||||
|
|||||||
@@ -725,6 +725,11 @@
|
|||||||
<div class="tools-actions">
|
<div class="tools-actions">
|
||||||
<button class="btn-secondary" onclick="selectAllTools()" data-i18n="mcp.selectAll">全选</button>
|
<button class="btn-secondary" onclick="selectAllTools()" data-i18n="mcp.selectAll">全选</button>
|
||||||
<button class="btn-secondary" onclick="deselectAllTools()" data-i18n="mcp.deselectAll">全不选</button>
|
<button class="btn-secondary" onclick="deselectAllTools()" data-i18n="mcp.deselectAll">全不选</button>
|
||||||
|
<div class="tools-status-filter">
|
||||||
|
<button class="btn-filter active" data-filter="" onclick="filterToolsByStatus('')" data-i18n="mcp.filterAll">全部</button>
|
||||||
|
<button class="btn-filter" data-filter="true" onclick="filterToolsByStatus('true')" data-i18n="mcp.filterEnabled">已启用</button>
|
||||||
|
<button class="btn-filter" data-filter="false" onclick="filterToolsByStatus('false')" data-i18n="mcp.filterDisabled">已停用</button>
|
||||||
|
</div>
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<input type="text" id="tools-search" data-i18n="mcp.toolSearchPlaceholder" data-i18n-attr="placeholder" placeholder="搜索工具..." onkeypress="handleSearchKeyPress(event)" oninput="if(this.value.trim() === '') clearSearch()" />
|
<input type="text" id="tools-search" data-i18n="mcp.toolSearchPlaceholder" data-i18n-attr="placeholder" placeholder="搜索工具..." onkeypress="handleSearchKeyPress(event)" oninput="if(this.value.trim() === '') clearSearch()" />
|
||||||
<button class="btn-search" onclick="searchTools()" data-i18n="common.search" data-i18n-attr="title" title="搜索">🔍</button>
|
<button class="btn-search" onclick="searchTools()" data-i18n="common.search" data-i18n-attr="title" title="搜索">🔍</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user