Adding output

This commit is contained in:
Axel 2021-12-19 10:12:40 +01:00
parent 3569ccabb2
commit 3bba0930f3
3 changed files with 46 additions and 46 deletions

View file

@ -147,7 +147,7 @@ if ($numtasks > 0) {
# Saving Status into DB # Saving Status into DB
if ($status >= 0) { if ($status >= 0) {
save_history($tasks->{'id'}, $status, $execution_time); save_history($tasks->{'id'}, $status, $execution_time, $response);
} }
@ -265,8 +265,8 @@ sub output {
# Function that keeps an history # Function that keeps an history
##### #####
sub save_history { sub save_history {
my ($task_id, $status, $datetime) = @_; my ($task_id, $status, $datetime, $response) = @_;
my $query = $dbh->prepare('INSERT INTO tasks_history (status, datetime, task_id) VALUES(' . $status . ', "'.$datetime.'", ' . $task_id . ')'); my $query = $dbh->prepare('INSERT INTO `tasks_history` (`status`, `datetime`, `task_id`, `output`) VALUES(' . $status . ', "'.$datetime.'", ' . $task_id . ', "' . $response . '")');
if ($query->execute()) { if ($query->execute()) {
output('saving status to history', 'DEBUG'); output('saving status to history', 'DEBUG');
} }
@ -274,7 +274,7 @@ sub save_history {
output('cannot save status to history', 'ERROR'); output('cannot save status to history', 'ERROR');
} }
$update_query = $dbh->prepare('UPDATE tasks SET last_execution = "'.$datetime.'" WHERE id = ' . $task_id); $update_query = $dbh->prepare('UPDATE `tasks` SET `last_execution` = "'.$datetime.'" WHERE id = ' . $task_id);
if ($update_query->execute()) { if ($update_query->execute()) {
output('saving last execution time for this task', 'DEBUG'); output('saving last execution time for this task', 'DEBUG');
} }

View file

@ -100,12 +100,12 @@ td {
} }
.quick-view .square { .quick-view .square {
width: 2rem; width: 1rem;
min-width: 2rem; min-width: 1rem;
max-width: 2rem; max-width: 1rem;
height: 2rem; height: 1rem;
min-height: 2rem; min-height: 1rem;
max-height: 2rem; max-height: 1rem;
margin: 0.1rem; margin: 0.1rem;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
@ -175,15 +175,15 @@ td {
} }
.up { .up {
background-color: #c9ecc9; background-color: #8adf8a;
} }
.down { .down {
background-color: #ffc5c5; background-color: #f79292;
} }
.unknown { .unknown {
background-color: rgb(243, 192, 97); background-color: rgb(245, 214, 158);
} }

View file

@ -29,7 +29,7 @@
:href="'#task-'+task.id" :href="'#task-'+task.id"
> >
<p :class="statusText(task.status)" class="square"> <p :class="statusText(task.status)" class="square">
<img :src="'/img/'+statusText(task.status)+'.png'" width="16" alt=""> <!--<img :src="'/img/'+statusText(task.status)+'.png'" width="16" alt="">-->
</p> </p>
</a> </a>
</div> </div>