Add pending actions to agent table and filter

This commit is contained in:
Josh
2020-11-29 02:13:50 +00:00
parent cb06ebe03c
commit a970ceb176
2 changed files with 39 additions and 0 deletions

View File

@@ -46,6 +46,13 @@
</q-icon>
</q-th>
</template>
<template v-slot:header-cell-pendingactions="props">
<q-th auto-width :props="props">
<q-icon name="far fa-clock" size="1.5em">
<q-tooltip>Pending Actions</q-tooltip>
</q-icon>
</q-th>
</template>
<!--
<template v-slot:header-cell-antivirus="props">
<q-th auto-width :props="props">
@@ -274,6 +281,11 @@
<q-tooltip>Patches Pending</q-tooltip>
</q-icon>
</q-td>
<q-td :props="props" key="pendingactions">
<q-icon @click="showPendingActionsModal(props.row.id)" name="far fa-clock" size="1.4em" color="warning">
<q-tooltip>Pending Action Count: {{ props.row.pending_actions }}</q-tooltip>
</q-icon>
</q-td>
<q-td key="agentstatus">
<q-icon v-if="props.row.status === 'overdue'" name="fas fa-signal" size="1.2em" color="negative">
<q-tooltip>Agent overdue</q-tooltip>
@@ -384,6 +396,7 @@ export default {
let availability = null;
let checks = false;
let patches = false;
let actions = false;
let reboot = false;
let search = "";
@@ -394,6 +407,7 @@ export default {
advancedFilter = true;
let filter = param.split(":")[1];
if (filter === "patchespending") patches = true;
if (filter === "actionspending") actions = true;
else if (filter === "checksfailing") checks = true;
else if (filter === "rebootneeded") reboot = true;
else if (filter === "online" || filter === "offline" || filter === "expired") availability = filter;
@@ -406,6 +420,7 @@ export default {
if (advancedFilter) {
if (checks && !row.checks.has_failing_checks) return false;
if (patches && !row.patches_pending) return false;
if (actions && row.pending_actions > 0) return false;
if (reboot && !row.needs_reboot) return false;
if (availability === "online" && row.status !== "online") return false;
else if (availability === "offline" && row.status !== "overdue") return false;

View File

@@ -217,6 +217,16 @@
</q-item-section>
</q-item>
<q-item>
<q-item-section side>
<q-checkbox v-model="filterActionsPending" />
</q-item-section>
<q-item-section>
<q-item-label>Actions Pending</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section side>
<q-checkbox v-model="filterRebootNeeded" />
@@ -379,6 +389,7 @@ export default {
filterTextLength: 0,
filterAvailability: "all",
filterPatchesPending: false,
filterActionsPending: false,
filterChecksFailing: false,
filterRebootNeeded: false,
currentTRMMVersion: null,
@@ -446,6 +457,12 @@ export default {
align: "left",
sortable: true,
},
{
name: "pendingactions",
field: "pending_actions",
align: "left",
sortable: true,
},
{
name: "agentstatus",
field: "status",
@@ -483,6 +500,7 @@ export default {
"description",
"user",
"patchespending",
"pendingactions",
"agentstatus",
"needsreboot",
"lastseen",
@@ -655,6 +673,7 @@ export default {
this.filterPatchesPending = false;
this.filterRebootNeeded = false;
this.filterChecksFailing = false;
this.filterActionsPending = false;
this.filterAvailability = "all";
this.search = "";
},
@@ -675,6 +694,10 @@ export default {
filterText += "is:patchespending ";
}
if (this.filterActionsPending) {
filterText += "is:actionspending ";
}
if (this.filterChecksFailing) {
filterText += "is:checksfailing ";
}
@@ -723,6 +746,7 @@ export default {
isFilteringTable() {
return (
this.filterPatchesPending ||
this.filterActionsPending ||
this.filterChecksFailing ||
this.filterRebootNeeded ||
this.filterAvailability !== "all"