Web: allow removal of blocklist entries
This commit is contained in:
parent
11e5363d24
commit
404dbc5be8
@ -7,12 +7,15 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Worker</th>
|
<th>Worker</th>
|
||||||
<th>Task Type</th>
|
<th>Task Type</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="entry in blocklist">
|
<tr v-for="entry in blocklist">
|
||||||
<td>
|
<td>
|
||||||
<link-worker :worker="{ id: entry.worker_id, name: entry.worker_name }" />
|
<link-worker :worker="{ id: entry.worker_id, name: entry.worker_name }" />
|
||||||
</td>
|
</td>
|
||||||
<td>{{ entry.task_type }}</td>
|
<td>{{ entry.task_type }}</td>
|
||||||
|
<td><button class="btn in-table-row" @click="removeBlocklistEntry(entry)"
|
||||||
|
title="Allow this worker to execute these task types">❌</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div v-else class="dl-no-data">
|
<div v-else class="dl-no-data">
|
||||||
@ -56,6 +59,18 @@ function refreshBlocklist() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeBlocklistEntry(blocklistEntry) {
|
||||||
|
jobsApi.removeJobBlocklist(props.jobID, { jobBlocklistEntry: [blocklistEntry] })
|
||||||
|
.then(() => {
|
||||||
|
blocklist.value = blocklist.value.filter(
|
||||||
|
(entry) => !(entry.worker_id == blocklistEntry.worker_id && entry.task_type == blocklistEntry.task_type));
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("Error removing entry from blocklist", error);
|
||||||
|
refreshBlocklist();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
watch(() => props.jobID, refreshBlocklist);
|
watch(() => props.jobID, refreshBlocklist);
|
||||||
watch(blocklist, () => {
|
watch(blocklist, () => {
|
||||||
nextTick(() => { emit("reshuffled") })
|
nextTick(() => { emit("reshuffled") })
|
||||||
@ -90,4 +105,10 @@ table.blocklist tr {
|
|||||||
table.blocklist tr:nth-child(odd) {
|
table.blocklist tr:nth-child(odd) {
|
||||||
background-color: var(--table-color-background-row-odd);
|
background-color: var(--table-color-background-row-odd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.in-table-row {
|
||||||
|
background-color: unset;
|
||||||
|
border: unset;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem title="Blocklist">
|
<TabItem title="Blocklist">
|
||||||
<blocklist :jobID="jobData.id" />
|
<blocklist :jobID="jobData.id" @reshuffled="emit_reshuffled_delayed" />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabsWrapper>
|
</TabsWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user