#12176 formatted error
This commit is contained in:
parent
de370ff05c
commit
e7ebbedabc
|
@ -1474,13 +1474,20 @@ class DiscoveryTaskList extends HTML
|
||||||
} else if ((int) $task['type'] === DISCOVERY_EXTENSION) {
|
} else if ((int) $task['type'] === DISCOVERY_EXTENSION) {
|
||||||
// Content.
|
// Content.
|
||||||
$countSummary = 1;
|
$countSummary = 1;
|
||||||
|
$countErrors = 1;
|
||||||
|
$tableErrors = new StdClasS();
|
||||||
|
$tableErrors->class = 'databox data';
|
||||||
|
$tableErrors->width = '75%';
|
||||||
|
$tableErrors->styleTable = 'margin: 2em auto 0;border: 1px solid #ddd;background: white;';
|
||||||
|
$tableErrors->rowid = [];
|
||||||
|
$tableErrors->data = [];
|
||||||
if (is_array($task['stats']) === true && count(array_filter(array_keys($task['stats']), 'is_numeric')) === count($task['stats'])) {
|
if (is_array($task['stats']) === true && count(array_filter(array_keys($task['stats']), 'is_numeric')) === count($task['stats'])) {
|
||||||
foreach ($task['stats'] as $key => $summary) {
|
foreach ($task['stats'] as $key => $summary) {
|
||||||
$table->data[$i][0] = '<b>'.__('Summary').' '.$countSummary.'</b>';
|
|
||||||
$table->data[$i][1] = '';
|
|
||||||
$countSummary++;
|
|
||||||
$i++;
|
|
||||||
if (is_array($summary) === true) {
|
if (is_array($summary) === true) {
|
||||||
|
$table->data[$i][0] = '<b>'.__('Summary').' '.$countSummary.'</b>';
|
||||||
|
$table->data[$i][1] = '';
|
||||||
|
$countSummary++;
|
||||||
|
$i++;
|
||||||
if (empty($summary['summary']) === true && empty($summary['info']) === true) {
|
if (empty($summary['summary']) === true && empty($summary['info']) === true) {
|
||||||
$table->data[$i][0] = json_encode($summary, JSON_PRETTY_PRINT);
|
$table->data[$i][0] = json_encode($summary, JSON_PRETTY_PRINT);
|
||||||
$table->data[$i][1] = '';
|
$table->data[$i][1] = '';
|
||||||
|
@ -1517,8 +1524,12 @@ class DiscoveryTaskList extends HTML
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$table->data[$i][0] = $summary;
|
$tableErrors->data[$i][0] = '<b>'.__('Error %s', $countErrors).'</b>';
|
||||||
$table->data[$i][1] = '';
|
$tableErrors->data[$i][1] = '';
|
||||||
|
$i++;
|
||||||
|
$tableErrors->data[$i][0] = $summary;
|
||||||
|
$tableErrors->data[$i][1] = '';
|
||||||
|
$countErrors++;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1565,7 +1576,15 @@ class DiscoveryTaskList extends HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = '<div class="subtitle"><span>'.__('Summary').'</span></div>';
|
$output = '<div class="subtitle"><span>'.__('Summary').'</span></div>';
|
||||||
$output .= html_print_table($table, true).'</div>';
|
if (is_array($table->data) === true && count($table->data) > 0) {
|
||||||
|
$output .= html_print_table($table, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($tableErrors->data) === true && count($tableErrors->data) > 0) {
|
||||||
|
$output .= html_print_table($tableErrors, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
|
Loading…
Reference in New Issue