Finish up check charts

This commit is contained in:
sadnub 2021-01-15 22:11:40 -05:00
parent 53882d6e5f
commit a6bc293640
4 changed files with 40 additions and 10 deletions

View File

@ -289,11 +289,11 @@ class Check(BaseAuditModel):
# add check history
self.add_check_history(
self.retcode,
1 if self.status == "failing" else 0,
{
"retcode": data["retcode"],
"stdout": data["stdout"],
"stderr": data["stderr"],
"stdout": data["stdout"][:60],
"stderr": data["stderr"][:60],
"execution_time": self.execution_time,
},
)
@ -314,7 +314,9 @@ class Check(BaseAuditModel):
self.more_info = output
self.save(update_fields=["more_info"])
self.add_check_history(0 if self.status == "failing" else 1)
self.add_check_history(
1 if self.status == "failing" else 0, self.more_info[:60]
)
# windows service checks
elif self.check_type == "winsvc":
@ -355,7 +357,9 @@ class Check(BaseAuditModel):
self.save(update_fields=["more_info"])
self.add_check_history(0 if self.status == "failing" else 1, self.more_info)
self.add_check_history(
1 if self.status == "failing" else 0, self.more_info[:60]
)
elif self.check_type == "eventlog":
log = []
@ -416,7 +420,10 @@ class Check(BaseAuditModel):
self.extra_details = {"log": log}
self.save(update_fields=["extra_details"])
self.add_check_history(0 if self.status == "failing" else 1)
self.add_check_history(
1 if self.status == "failing" else 0,
"Events Found:" + str(len(self.extra_details["log"])),
)
# handle status
if self.status == "failing":

View File

@ -3,7 +3,7 @@
set -o errexit
set -o pipefail
DOCKER_IMAGES="tactical-nats"
DOCKER_IMAGES="tactical tactical-frontend tactical-nginx tactical-meshcentral tactical-salt tactical-nats"
cd ..

View File

@ -179,6 +179,28 @@
@click="showCheckGraphModal(props.row)"
>Show Run History</span
>
&nbsp;&nbsp;&nbsp;
<span
v-if="props.row.check_type === 'ping'"
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="pingInfo(props.row.readable_desc, props.row.more_info)"
>Last Output</span
>
<span
v-else-if="props.row.check_type === 'script'"
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="scriptMoreInfo(props.row)"
>Last Output</span
>
<span
v-else-if="props.row.check_type === 'eventlog'"
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="eventLogMoreInfo(props.row)"
>Last Output</span
>
</q-td>
<q-td>{{ props.row.last_run }}</q-td>
<q-td v-if="props.row.assigned_task !== null && props.row.assigned_task.length > 1"

View File

@ -193,12 +193,13 @@ export default {
} else {
// Set the y-axis labels to Failing and Passing
this.chartOptions["yaxis"] = {
min: 0,
max: 1,
tickAmount: 4,
min: -1,
max: 2,
tickAmount: 0,
reversed: true,
forceNiceScale: true,
labels: {
minWidth: 50,
formatter: (val, index) => {
if (val === 0) return "Passing";
else if (val === 1) return "Failing";