AppHealth: Use strict interfaces to construct ipl\Html objects

This commit is contained in:
Johannes Meyer 2021-06-21 16:10:55 +02:00
parent c01e0f9dc8
commit f400f4d96d

View File

@ -31,23 +31,21 @@ class AppHealth extends Table
{ {
foreach ($this->data as $row) { foreach ($this->data as $row) {
$this->add(Table::tr([ $this->add(Table::tr([
Table::th(new HtmlElement('span', ['class' => [ Table::th(HtmlElement::create('span', ['class' => [
'ball', 'ball',
'ball-size-xl', 'ball-size-xl',
$this->getStateClass($row->state) $this->getStateClass($row->state)
]])), ]])),
Table::td([ Table::td([
new HtmlElement('header', null, [ new HtmlElement('header', null, FormattedString::create(
FormattedString::create( t('%s by %s is %s', '<check> by <module> is <state-text>'),
t('%s by %s is %s', '<check> by <module> is <state-text>'), $row->url
$row->url ? new Link(HtmlElement::create('span', null, $row->name), $row->url)
? new Link(new HtmlElement('span', null, $row->name), $row->url) : HtmlElement::create('span', null, $row->name),
: new HtmlElement('span', null, $row->name), HtmlElement::create('span', null, $row->module),
new HtmlElement('span', null, $row->module), HtmlElement::create('span', null, $this->getStateText($row->state))
new HtmlElement('span', null, $this->getStateText($row->state)) )),
) HtmlElement::create('section', null, $row->message)
]),
new HtmlElement('section', null, $row->message)
]) ])
])); ]));
} }