Permalink
Browse files

Make config test a bit less hard to look at

  • Loading branch information...
flack committed Aug 24, 2018
1 parent df4405a commit 1884411350859bf37515222f984be6bba156c19a
Showing with 17 additions and 13 deletions.
  1. +7 −12 lib/midcom/config/test.php
  2. +10 −1 lib/midcom/exec/config-test.php
View
@@ -192,12 +192,7 @@ private function check_for_utility($testname, $fail_code, $fail_recommendations,
public function show()
{
echo '<table border="1" cellspacing="0" cellpadding="2">
<tr>
<th>Test</th>
<th>Result</th>
<th>Recommendations</th>
</tr>';
echo '<table>';
$this->print_section('Framework', $this->messages['midcom']);
$this->print_section('PHP ' . PHP_VERSION, $this->messages['php']);
@@ -209,29 +204,29 @@ public function show()
private function print_section($heading, array $messages)
{
echo " <tr>\n";
echo " <th colspan=\"3\">{$heading}</th>\n";
echo " <th colspan=\"2\">{$heading}</th>\n";
echo " </tr>\n";
foreach ($messages as $testname => $data) {
echo " <tr class=\"test\">\n";
echo " <th>{$testname}</th>\n";
echo " <tr class=\"test\">\n <th>\n";
switch ($data['result']) {
case self::OK:
echo " <td style='color: green;'>OK</td>\n";
echo " <i class='fa fa-check' style='color: green;' title='OK'></i>";
break;
case self::WARNING:
echo " <td style='color: orange;'>WARNING</td>\n";
echo " <i class='fa fa-exclamation-triangle' style='color: orange;' title='WARNING'></i>";
break;
case self::ERROR:
echo " <td style='color: red;'>ERROR</td>\n";
echo " <i class='fa fa-exclamation-circle' style='color: red;' title='ERROR'></i>";
break;
default:
throw new midcom_error("Unknown error code {$data['result']}.");
}
echo " {$testname}</th>\n";
echo " <td>{$data['message']}</td>\n";
echo " </tr>\n";
}
@@ -5,13 +5,22 @@
<html>
<head><title><?php echo $title ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo MIDCOM_STATIC_URL ?>/midcom.workflow/dialog.css" />
<link rel="stylesheet" type="text/css" href="<?php echo MIDCOM_STATIC_URL ?>/stock-icons/font-awesome-4.7.0/css/font-awesome.min.css" />
<style type="text/css">
tr.test th
{
text-align: left;
white-space: nowrap;
font-weight: normal
}
th, td {
text-align: left;
border-bottom: 1px solid #ddd;
padding: .2rem;
}
.fa {
font-size: 1.2rem;
margin: 0 .2rem;
}
</style>
</head>
<body>

0 comments on commit 1884411

Please sign in to comment.