mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-02 16:39:25 -05:00
ServiceNode: Change alias to <service> on <host>
This commit is contained in:
parent
9c84764157
commit
d9c6debfa9
2 changed files with 10 additions and 3 deletions
|
|
@ -3,9 +3,12 @@
|
|||
namespace Icinga\Module\Businessprocess;
|
||||
|
||||
use Icinga\Module\Businessprocess\Web\Url;
|
||||
use ipl\I18n\Translation;
|
||||
|
||||
class ServiceNode extends MonitoredNode
|
||||
{
|
||||
use Translation;
|
||||
|
||||
protected $hostname;
|
||||
|
||||
/** @var string Alias of the host */
|
||||
|
|
@ -69,7 +72,11 @@ class ServiceNode extends MonitoredNode
|
|||
return null;
|
||||
}
|
||||
|
||||
return $this->getHostAlias() . ': ' . $this->alias;
|
||||
return sprintf(
|
||||
$this->translate('%s on %s', '<service> on <host>'),
|
||||
$this->alias,
|
||||
$this->getHostAlias()
|
||||
);
|
||||
}
|
||||
|
||||
public function getUrl()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class ServiceNodeTest extends BaseTestCase
|
|||
public function testReturnsCorrectAlias()
|
||||
{
|
||||
$this->assertEquals(
|
||||
'localhost: ping <> pong',
|
||||
'ping <> pong on localhost',
|
||||
$this->pingOnLocalhost()->getAlias()
|
||||
);
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ class ServiceNodeTest extends BaseTestCase
|
|||
{
|
||||
$this->assertEquals(
|
||||
'<a href="/icingaweb2/businessprocess/service/show?host=localhost&service=ping%20%3C%3E%20pong">'
|
||||
. 'localhost: ping <> pong</a>',
|
||||
. 'ping <> pong on localhost</a>',
|
||||
$this->pingOnLocalhost()->getLink()->render()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue