mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-09-28 12:12:17 +02:00
Add files via upload
This commit is contained in:
@@ -11797,34 +11797,44 @@ tr.mcp-stats-tool-row[data-tool-name]:focus-visible {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 4px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.batch-delete-btn svg {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
.batch-delete-btn:hover {
|
.batch-delete-btn:hover {
|
||||||
background: rgba(220, 53, 69, 0.1);
|
background: rgba(220, 53, 69, 0.1);
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.batch-delete-btn:hover svg {
|
||||||
|
transform: scale(1.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-delete-btn:active {
|
||||||
|
background: rgba(220, 53, 69, 0.2);
|
||||||
|
transform: scale(0.95);
|
||||||
|
}
|
||||||
|
|
||||||
.batch-manage-footer {
|
.batch-manage-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: flex-end;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
border-top: 1px solid var(--border-color);
|
border-top: 1px solid var(--border-color);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-all-checkbox {
|
.batch-table-col-checkbox input[type="checkbox"] {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 0.875rem;
|
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.batch-footer-actions {
|
.batch-footer-actions {
|
||||||
|
|||||||
+45
-5
@@ -7450,14 +7450,14 @@ async function showBatchManageModal() {
|
|||||||
updateBatchManageTitle(allConversationsForBatch.length);
|
updateBatchManageTitle(allConversationsForBatch.length);
|
||||||
|
|
||||||
renderBatchConversations();
|
renderBatchConversations();
|
||||||
openAppModal('batch-manage-modal');
|
openAppModal('batch-manage-modal', { focus: false });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载对话列表失败:', error);
|
console.error('加载对话列表失败:', error);
|
||||||
// 错误时使用空数组,不显示错误提示(更友好的用户体验)
|
// 错误时使用空数组,不显示错误提示(更友好的用户体验)
|
||||||
allConversationsForBatch = [];
|
allConversationsForBatch = [];
|
||||||
updateBatchManageTitle(0);
|
updateBatchManageTitle(0);
|
||||||
renderBatchConversations();
|
renderBatchConversations();
|
||||||
openAppModal('batch-manage-modal');
|
openAppModal('batch-manage-modal', { focus: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7517,6 +7517,7 @@ function renderBatchConversations(filtered = null) {
|
|||||||
checkbox.type = 'checkbox';
|
checkbox.type = 'checkbox';
|
||||||
checkbox.className = 'batch-conversation-checkbox';
|
checkbox.className = 'batch-conversation-checkbox';
|
||||||
checkbox.dataset.conversationId = conv.id;
|
checkbox.dataset.conversationId = conv.id;
|
||||||
|
checkbox.addEventListener('change', syncSelectAllBatchCheckbox);
|
||||||
|
|
||||||
const name = document.createElement('div');
|
const name = document.createElement('div');
|
||||||
name.className = 'batch-table-col-name';
|
name.className = 'batch-table-col-name';
|
||||||
@@ -7542,9 +7543,21 @@ function renderBatchConversations(filtered = null) {
|
|||||||
const action = document.createElement('div');
|
const action = document.createElement('div');
|
||||||
action.className = 'batch-table-col-action';
|
action.className = 'batch-table-col-action';
|
||||||
const deleteBtn = document.createElement('button');
|
const deleteBtn = document.createElement('button');
|
||||||
|
deleteBtn.type = 'button';
|
||||||
deleteBtn.className = 'batch-delete-btn';
|
deleteBtn.className = 'batch-delete-btn';
|
||||||
deleteBtn.innerHTML = '🗑️';
|
deleteBtn.innerHTML = `
|
||||||
deleteBtn.onclick = () => deleteConversation(conv.id);
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
const deleteLabel = typeof window.t === 'function' ? window.t('contextMenu.deleteConversation') : '删除此对话';
|
||||||
|
deleteBtn.title = deleteLabel;
|
||||||
|
deleteBtn.setAttribute('aria-label', deleteLabel);
|
||||||
|
deleteBtn.onclick = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
deleteConversation(conv.id);
|
||||||
|
};
|
||||||
action.appendChild(deleteBtn);
|
action.appendChild(deleteBtn);
|
||||||
|
|
||||||
row.appendChild(checkbox);
|
row.appendChild(checkbox);
|
||||||
@@ -7554,6 +7567,8 @@ function renderBatchConversations(filtered = null) {
|
|||||||
|
|
||||||
list.appendChild(row);
|
list.appendChild(row);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
syncSelectAllBatchCheckbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 筛选批量管理对话
|
// 筛选批量管理对话
|
||||||
@@ -7575,12 +7590,35 @@ function filterBatchConversations(query) {
|
|||||||
function toggleSelectAllBatch() {
|
function toggleSelectAllBatch() {
|
||||||
const selectAll = document.getElementById('batch-select-all');
|
const selectAll = document.getElementById('batch-select-all');
|
||||||
const checkboxes = document.querySelectorAll('.batch-conversation-checkbox');
|
const checkboxes = document.querySelectorAll('.batch-conversation-checkbox');
|
||||||
|
|
||||||
|
if (selectAll) {
|
||||||
|
selectAll.indeterminate = false;
|
||||||
|
}
|
||||||
checkboxes.forEach(cb => {
|
checkboxes.forEach(cb => {
|
||||||
cb.checked = selectAll.checked;
|
cb.checked = selectAll.checked;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function syncSelectAllBatchCheckbox() {
|
||||||
|
const selectAll = document.getElementById('batch-select-all');
|
||||||
|
if (!selectAll) return;
|
||||||
|
|
||||||
|
const checkboxes = document.querySelectorAll('.batch-conversation-checkbox');
|
||||||
|
const total = checkboxes.length;
|
||||||
|
const checked = document.querySelectorAll('.batch-conversation-checkbox:checked').length;
|
||||||
|
|
||||||
|
if (total === 0 || checked === 0) {
|
||||||
|
selectAll.checked = false;
|
||||||
|
selectAll.indeterminate = false;
|
||||||
|
} else if (checked === total) {
|
||||||
|
selectAll.checked = true;
|
||||||
|
selectAll.indeterminate = false;
|
||||||
|
} else {
|
||||||
|
selectAll.checked = false;
|
||||||
|
selectAll.indeterminate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 删除选中的对话
|
// 删除选中的对话
|
||||||
async function deleteSelectedConversations() {
|
async function deleteSelectedConversations() {
|
||||||
const checkboxes = document.querySelectorAll('.batch-conversation-checkbox:checked');
|
const checkboxes = document.querySelectorAll('.batch-conversation-checkbox:checked');
|
||||||
@@ -7604,6 +7642,7 @@ async function deleteSelectedConversations() {
|
|||||||
const selectAll = document.getElementById('batch-select-all');
|
const selectAll = document.getElementById('batch-select-all');
|
||||||
if (selectAll) {
|
if (selectAll) {
|
||||||
selectAll.checked = false;
|
selectAll.checked = false;
|
||||||
|
selectAll.indeterminate = false;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('删除失败:', error);
|
console.error('删除失败:', error);
|
||||||
@@ -7619,6 +7658,7 @@ function closeBatchManageModal() {
|
|||||||
const selectAll = document.getElementById('batch-select-all');
|
const selectAll = document.getElementById('batch-select-all');
|
||||||
if (selectAll) {
|
if (selectAll) {
|
||||||
selectAll.checked = false;
|
selectAll.checked = false;
|
||||||
|
selectAll.indeterminate = false;
|
||||||
}
|
}
|
||||||
allConversationsForBatch = [];
|
allConversationsForBatch = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3777,7 +3777,9 @@
|
|||||||
<div class="modal-body batch-manage-body">
|
<div class="modal-body batch-manage-body">
|
||||||
<div class="batch-conversations-table">
|
<div class="batch-conversations-table">
|
||||||
<div class="batch-table-header">
|
<div class="batch-table-header">
|
||||||
<div class="batch-table-col-checkbox"></div>
|
<div class="batch-table-col-checkbox">
|
||||||
|
<input type="checkbox" id="batch-select-all" onchange="toggleSelectAllBatch()" data-i18n="batchManageModal.selectAll" data-i18n-attr="title" title="全选" />
|
||||||
|
</div>
|
||||||
<div class="batch-table-col-name" data-i18n="batchManageModal.conversationName">对话名称</div>
|
<div class="batch-table-col-name" data-i18n="batchManageModal.conversationName">对话名称</div>
|
||||||
<div class="batch-table-col-time" data-i18n="batchManageModal.lastTime">最近一次对话时间</div>
|
<div class="batch-table-col-time" data-i18n="batchManageModal.lastTime">最近一次对话时间</div>
|
||||||
<div class="batch-table-col-action" data-i18n="batchManageModal.action">操作</div>
|
<div class="batch-table-col-action" data-i18n="batchManageModal.action">操作</div>
|
||||||
@@ -3786,10 +3788,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer batch-manage-footer">
|
<div class="modal-footer batch-manage-footer">
|
||||||
<label class="select-all-checkbox">
|
|
||||||
<input type="checkbox" id="batch-select-all" onchange="toggleSelectAllBatch()" />
|
|
||||||
<span data-i18n="batchManageModal.selectAll">全选</span>
|
|
||||||
</label>
|
|
||||||
<div class="batch-footer-actions">
|
<div class="batch-footer-actions">
|
||||||
<button class="btn-secondary" onclick="closeBatchManageModal()" data-i18n="common.cancel">取消</button>
|
<button class="btn-secondary" onclick="closeBatchManageModal()" data-i18n="common.cancel">取消</button>
|
||||||
<button class="btn-primary" onclick="deleteSelectedConversations()" data-i18n="batchManageModal.deleteSelected">删除所选</button>
|
<button class="btn-primary" onclick="deleteSelectedConversations()" data-i18n="batchManageModal.deleteSelected">删除所选</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user