mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-20 23:00:16 -05:00
Node: Introduce $icon property
This commit is contained in:
parent
3ba4842933
commit
505471c519
5 changed files with 24 additions and 0 deletions
|
|
@ -520,4 +520,10 @@ class BpNode extends Node
|
||||||
return 'min:' . $this->operator;
|
return 'min:' . $this->operator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getIcon()
|
||||||
|
{
|
||||||
|
$this->icon = $this->hasParents() ? 'cubes' : 'sitemap';
|
||||||
|
return parent::getIcon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ class HostNode extends MonitoredNode
|
||||||
|
|
||||||
protected $className = 'host';
|
protected $className = 'host';
|
||||||
|
|
||||||
|
protected $icon = 'host';
|
||||||
|
|
||||||
public function __construct(BpConfig $bp, $object)
|
public function __construct(BpConfig $bp, $object)
|
||||||
{
|
{
|
||||||
$this->name = $object->hostname . ';Hoststatus';
|
$this->name = $object->hostname . ';Hoststatus';
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ class ImportedNode extends Node
|
||||||
|
|
||||||
protected $className = 'subtree';
|
protected $className = 'subtree';
|
||||||
|
|
||||||
|
protected $icon = 'download';
|
||||||
|
|
||||||
/** @var BpConfig */
|
/** @var BpConfig */
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,13 @@ abstract class Node
|
||||||
// obsolete
|
// obsolete
|
||||||
protected $duration;
|
protected $duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This node's icon
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $icon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Last state change, unix timestamp
|
* Last state change, unix timestamp
|
||||||
*
|
*
|
||||||
|
|
@ -382,6 +389,11 @@ abstract class Node
|
||||||
return Html::tag('a', ['href' => '#'], $this->getAlias());
|
return Html::tag('a', ['href' => '#'], $this->getAlias());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getIcon()
|
||||||
|
{
|
||||||
|
return Html::tag('i', ['class' => 'icon icon-' . ($this->icon ?: 'attention-circled')]);
|
||||||
|
}
|
||||||
|
|
||||||
public function operatorHtml()
|
public function operatorHtml()
|
||||||
{
|
{
|
||||||
return ' ';
|
return ' ';
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ class ServiceNode extends MonitoredNode
|
||||||
|
|
||||||
protected $className = 'service';
|
protected $className = 'service';
|
||||||
|
|
||||||
|
protected $icon = 'service';
|
||||||
|
|
||||||
public function __construct(BpConfig $bp, $object)
|
public function __construct(BpConfig $bp, $object)
|
||||||
{
|
{
|
||||||
$this->name = $object->hostname . ';' . $object->service;
|
$this->name = $object->hostname . ';' . $object->service;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue