mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-05-18 14:04:52 +02:00
Add files via upload
This commit is contained in:
@@ -6615,7 +6615,6 @@ header {
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.batch-queues-header h3 {
|
||||
|
||||
+17
-2
@@ -720,8 +720,12 @@ const batchQueuesState = {
|
||||
function showBatchImportModal() {
|
||||
const modal = document.getElementById('batch-import-modal');
|
||||
const input = document.getElementById('batch-tasks-input');
|
||||
const titleInput = document.getElementById('batch-queue-title');
|
||||
if (modal && input) {
|
||||
input.value = '';
|
||||
if (titleInput) {
|
||||
titleInput.value = '';
|
||||
}
|
||||
updateBatchImportStats('');
|
||||
modal.style.display = 'block';
|
||||
input.focus();
|
||||
@@ -765,6 +769,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
// 创建批量任务队列
|
||||
async function createBatchQueue() {
|
||||
const input = document.getElementById('batch-tasks-input');
|
||||
const titleInput = document.getElementById('batch-queue-title');
|
||||
if (!input) return;
|
||||
|
||||
const text = input.value.trim();
|
||||
@@ -780,13 +785,16 @@ async function createBatchQueue() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取标题(可选)
|
||||
const title = titleInput ? titleInput.value.trim() : '';
|
||||
|
||||
try {
|
||||
const response = await apiFetch('/api/batch-tasks', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ tasks }),
|
||||
body: JSON.stringify({ title, tasks }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
@@ -918,10 +926,13 @@ function renderBatchQueues() {
|
||||
// 允许删除待执行、已完成或已取消状态的队列
|
||||
const canDelete = queue.status === 'pending' || queue.status === 'completed' || queue.status === 'cancelled';
|
||||
|
||||
const titleDisplay = queue.title ? `<span class="batch-queue-title" style="font-weight: 600; color: var(--text-primary); margin-right: 8px;">${escapeHtml(queue.title)}</span>` : '';
|
||||
|
||||
return `
|
||||
<div class="batch-queue-item" data-queue-id="${queue.id}" onclick="showBatchQueueDetail('${queue.id}')">
|
||||
<div class="batch-queue-header">
|
||||
<div class="batch-queue-info" style="flex: 1;">
|
||||
${titleDisplay}
|
||||
<span class="batch-queue-status ${status.class}">${status.text}</span>
|
||||
<span class="batch-queue-id">队列ID: ${escapeHtml(queue.id)}</span>
|
||||
<span class="batch-queue-time">创建时间: ${new Date(queue.createdAt).toLocaleString('zh-CN')}</span>
|
||||
@@ -1100,7 +1111,7 @@ async function showBatchQueueDetail(queueId) {
|
||||
batchQueuesState.currentQueueId = queueId;
|
||||
|
||||
if (title) {
|
||||
title.textContent = '批量任务队列';
|
||||
title.textContent = queue.title ? `批量任务队列 - ${escapeHtml(queue.title)}` : '批量任务队列';
|
||||
}
|
||||
|
||||
// 更新按钮显示
|
||||
@@ -1146,6 +1157,10 @@ async function showBatchQueueDetail(queueId) {
|
||||
|
||||
content.innerHTML = `
|
||||
<div class="batch-queue-detail-info">
|
||||
${queue.title ? `<div class="detail-item">
|
||||
<span class="detail-label">任务标题</span>
|
||||
<span class="detail-value">${escapeHtml(queue.title)}</span>
|
||||
</div>` : ''}
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">队列ID</span>
|
||||
<span class="detail-value"><code>${escapeHtml(queue.id)}</code></span>
|
||||
|
||||
@@ -568,9 +568,6 @@
|
||||
<div class="page-content">
|
||||
<!-- 批量任务队列列表 -->
|
||||
<div class="batch-queues-section" id="batch-queues-section" style="display: none;">
|
||||
<div class="batch-queues-header">
|
||||
<h3>批量任务队列</h3>
|
||||
</div>
|
||||
<!-- 筛选控件 -->
|
||||
<div class="batch-queues-filters tasks-filters">
|
||||
<label>
|
||||
@@ -585,7 +582,7 @@
|
||||
</select>
|
||||
</label>
|
||||
<label style="flex: 1; max-width: 300px;">
|
||||
<span>搜索队列ID或创建时间</span>
|
||||
<span>搜索队列ID、标题或创建时间</span>
|
||||
<input type="text" id="batch-queues-search" placeholder="输入关键字搜索..."
|
||||
oninput="filterBatchQueues()">
|
||||
</label>
|
||||
@@ -1160,6 +1157,13 @@
|
||||
<span class="modal-close" onclick="closeBatchImportModal()">×</span>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="batch-queue-title">任务标题</label>
|
||||
<input type="text" id="batch-queue-title" placeholder="请输入任务标题(可选,用于标识和筛选)" />
|
||||
<div class="form-hint" style="margin-top: 4px;">
|
||||
为批量任务队列设置一个标题,方便后续查找和管理。
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="batch-tasks-input">任务列表(每行一个任务)<span style="color: red;">*</span></label>
|
||||
<textarea id="batch-tasks-input" rows="15" placeholder="请输入任务列表,每行一个任务,例如: 扫描 192.168.1.1 的开放端口 检查 https://example.com 是否存在SQL注入 枚举 example.com 的子域名" style="font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.875rem; line-height: 1.5;"></textarea>
|
||||
|
||||
Reference in New Issue
Block a user