CustomvarTable, SyncRunDetails: small fixes

This commit is contained in:
Thomas Gelf 2018-05-09 10:35:52 +02:00
parent df83c9abad
commit 05bc9e5bfc
2 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,7 @@
namespace Icinga\Module\Director\Web\Table;
use dipl\Html\Html;
use dipl\Html\Link;
use dipl\Web\Table\ZfQueryBasedTable;
use Zend_Db_Adapter_Abstract as ZfDbAdapter;
@ -24,7 +25,7 @@ class CustomvarTable extends ZfQueryBasedTable
]);
foreach ($this->getObjectTypes() as $type) {
$tr->add($this::td($this::nobr(sprintf(
$tr->add($this::td(Html::tag('nobr', null, sprintf(
$this->translate('%d / %d'),
$row->{"cnt_$type"},
$row->{"distinct_$type"}

View File

@ -2,6 +2,7 @@
namespace Icinga\Module\Director\Web\Widget;
use dipl\Html\HtmlDocument;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Objects\SyncRun;
use dipl\Html\Html;
@ -27,6 +28,12 @@ class SyncRunDetails extends NameValueTable
]);
}
/**
* @param SyncRun $run
* @return array
* @throws \Icinga\Exception\IcingaException
* @throws \Icinga\Exception\ProgrammingError
*/
protected function runSummary(SyncRun $run)
{
$html = [];
@ -57,7 +64,7 @@ class SyncRunDetails extends NameValueTable
$lastId
);
$links = new Html();
$links = new HtmlDocument();
$links->setSeparator(', ');
if ($run->objects_created > 0) {
$links->add(new Link(
@ -88,7 +95,7 @@ class SyncRunDetails extends NameValueTable
));
}
if ($links->hasContent()) {
if (! $links->isEmpty()) {
$html[] = ': ';
$html[] = $links;
}