Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions web/src/views/tasks/Tasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ function getExecutorStatus(task: Task): 'local' | 'online' | 'offline' {
return agent?.status === AGENT_STATUS.ONLINE ? 'online' : 'offline'
}

function getTaskNameTitle(task: Task): string {
return task.remark ? `${task.name}\n备注: ${task.remark}` : task.name
}

async function loadTasks() {
loading.value = true
try {
Expand Down Expand Up @@ -679,11 +683,12 @@ watch(() => route.query.agent_id, (newVal: any) => {
<Terminal v-else class="h-4 w-4 text-primary" />
</div>
</span>
<div class="w-56 shrink-0 flex flex-col justify-center gap-0.5 overflow-hidden">
<div class="w-56 shrink-0 flex flex-col justify-center gap-0.5 overflow-hidden" :title="getTaskNameTitle(task)">
<div class="flex items-center gap-1.5 overflow-hidden">
<span class="font-medium truncate cursor-help" :title="task.name">{{ task.name }}</span>
<span class="font-medium truncate cursor-help">{{ task.name }}</span>
<Pin v-if="task.pin_type === 'top'" class="h-3 w-3 text-primary fill-primary shrink-0 rotate-45" />
</div>
<span v-if="task.remark" class="text-[11px] leading-tight text-muted-foreground truncate">{{ task.remark }}</span>
<div v-if="task.tags" class="flex items-center gap-1 overflow-hidden">
<span v-for="tag in task.tags.split(',').filter(Boolean).slice(0, 3)" :key="tag"
class="truncate text-[10px] leading-none px-1 py-0.5 bg-secondary text-secondary-foreground rounded border">{{ tag }}</span>
Expand Down Expand Up @@ -774,18 +779,19 @@ watch(() => route.query.agent_id, (newVal: any) => {
<div v-else-if="task.running_status === 'queued' || task.running_status === 'pending'" class="h-1.5 w-1.5 rounded-full bg-blue-400 animate-pulse shrink-0" />
<div v-else class="h-1 w-1 rounded-full bg-muted-foreground/20 shrink-0" />
<div class="w-12 shrink-0 text-muted-foreground tabular-nums text-[10px]">#{{ total - (currentPage - 1) * pageSize - index }}</div>
<div class="w-48 shrink-0 flex items-center gap-2 overflow-hidden">
<div class="w-48 shrink-0 flex items-center gap-2 overflow-hidden" :title="getTaskNameTitle(task)">
<span class="shrink-0" :title="getTaskTypeTitle(task.type || 'task')">
<div class="relative">
<GitBranch v-if="task.type === TASK_TYPE.REPO" class="h-3.5 w-3.5 text-primary" />
<Terminal v-else class="h-3.5 w-3.5 text-primary" />
</div>
</span>
<div class="flex flex-col min-w-0">
<div class="flex flex-col min-w-0 overflow-hidden">
<div class="flex items-center gap-1.5 overflow-hidden">
<span class="font-medium truncate">{{ task.name }}</span>
<span class="font-medium truncate cursor-help">{{ task.name }}</span>
<Pin v-if="task.pin_type === 'top'" class="h-3 w-3 text-primary fill-primary shrink-0 rotate-45" />
</div>
<span v-if="task.remark" class="text-[10px] leading-tight text-muted-foreground truncate">{{ task.remark }}</span>
<span v-if="task.schedule" class="text-[10px] text-muted-foreground font-mono truncate">{{ task.schedule }}</span>
</div>
</div>
Expand Down