更新任务队列列表页工具栏
This commit is contained in:
parent
dfe13b11d3
commit
7e6821f807
@ -24,16 +24,7 @@
|
||||
<i :class="loading ? 'fa fa-spinner fa-spin' : 'fa fa-refresh'"></i>
|
||||
</button>
|
||||
<button
|
||||
v-if="selectedJobs.length === 0"
|
||||
class="stats-btn"
|
||||
@click="showStats"
|
||||
:disabled="loading"
|
||||
>
|
||||
<i class="fa fa-bar-chart"></i>
|
||||
{{ t('Job Statistics') }}
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
v-if="selectedJobs.length > 0"
|
||||
class="delete-btn"
|
||||
@click="handleDeleteSelected"
|
||||
:disabled="deleting || loading"
|
||||
@ -135,7 +126,7 @@ import { ref, onMounted, computed, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { t } from '@/shared/i18n'
|
||||
import { NInput, NSelect, NPagination, useDialog, useMessage } from 'naive-ui'
|
||||
import { getLocalJobList, deleteLocalJob, batchDeleteLocalJobs, stopLocalJob, getLocalJobStats } from '@/shared/api/localJobs'
|
||||
import { getLocalJobList, deleteLocalJob, batchDeleteLocalJobs, stopLocalJob } from '@/shared/api/localJobs'
|
||||
|
||||
const router = useRouter()
|
||||
const dialog = useDialog()
|
||||
@ -306,23 +297,6 @@ async function stopJob(jobId: string) {
|
||||
})
|
||||
}
|
||||
|
||||
async function showStats() {
|
||||
try {
|
||||
const result = await getLocalJobStats()
|
||||
if (result.success) {
|
||||
// 显示统计信息对话框
|
||||
dialog.info({
|
||||
title: t('Job Statistics'),
|
||||
content: JSON.stringify(result.stats, null, 2),
|
||||
positiveText: t('OK')
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Stats error:', error)
|
||||
message.error('Failed to load statistics')
|
||||
}
|
||||
}
|
||||
|
||||
function formatDateTime(dateStr: string) {
|
||||
if (!dateStr) return '—'
|
||||
try {
|
||||
@ -438,36 +412,6 @@ onMounted(() => {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* 统计按钮 */
|
||||
.stats-btn {
|
||||
height: 36px;
|
||||
padding: 0 16px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: #10b981;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.stats-btn:hover {
|
||||
background: #059669;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
|
||||
}
|
||||
|
||||
.stats-btn:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* 删除按钮 */
|
||||
.delete-btn {
|
||||
background: #ef4444;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user