mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-11 23:13:05 -05:00
Move enumServiceStateList and enumHostStateList to trait EnumList.
The above methods in AddNodeForm and EditNodeForm is moved to the trait EnumList.
This commit is contained in:
parent
407d4f98db
commit
1afa7668eb
3 changed files with 24 additions and 48 deletions
|
|
@ -463,30 +463,6 @@ class AddNodeForm extends QuickForm
|
|||
return $this;
|
||||
}
|
||||
|
||||
protected function enumHostStateList()
|
||||
{
|
||||
$hostStateList = [
|
||||
0 => $this->translate('UP'),
|
||||
1 => $this->translate('DOWN'),
|
||||
99 => $this->translate('PENDING')
|
||||
];
|
||||
|
||||
return $hostStateList;
|
||||
}
|
||||
|
||||
protected function enumServiceStateList()
|
||||
{
|
||||
$serviceStateList = [
|
||||
0 => $this->translate('OK'),
|
||||
1 => $this->translate('WARNING'),
|
||||
2 => $this->translate('CRITICAL'),
|
||||
3 => $this->translate('UNKNOWN'),
|
||||
99 => $this->translate('PENDING'),
|
||||
];
|
||||
|
||||
return $serviceStateList;
|
||||
}
|
||||
|
||||
protected function hasProcesses()
|
||||
{
|
||||
return count($this->enumProcesses()) > 0;
|
||||
|
|
|
|||
|
|
@ -348,30 +348,6 @@ class EditNodeForm extends QuickForm
|
|||
return $this;
|
||||
}
|
||||
|
||||
protected function enumHostStateList()
|
||||
{
|
||||
$hostStateList = [
|
||||
0 => $this->translate('UP'),
|
||||
1 => $this->translate('DOWN'),
|
||||
99 => $this->translate('PENDING')
|
||||
];
|
||||
|
||||
return $hostStateList;
|
||||
}
|
||||
|
||||
protected function enumServiceStateList()
|
||||
{
|
||||
$serviceStateList = [
|
||||
0 => $this->translate('OK'),
|
||||
1 => $this->translate('WARNING'),
|
||||
2 => $this->translate('CRITICAL'),
|
||||
3 => $this->translate('UNKNOWN'),
|
||||
99 => $this->translate('PENDING'),
|
||||
];
|
||||
|
||||
return $serviceStateList;
|
||||
}
|
||||
|
||||
protected function hasProcesses()
|
||||
{
|
||||
return count($this->enumProcesses()) > 0;
|
||||
|
|
|
|||
|
|
@ -133,6 +133,30 @@ trait EnumList
|
|||
return $services;
|
||||
}
|
||||
|
||||
protected function enumHostStateList()
|
||||
{
|
||||
$hostStateList = [
|
||||
0 => $this->translate('UP'),
|
||||
1 => $this->translate('DOWN'),
|
||||
99 => $this->translate('PENDING')
|
||||
];
|
||||
|
||||
return $hostStateList;
|
||||
}
|
||||
|
||||
protected function enumServiceStateList()
|
||||
{
|
||||
$serviceStateList = [
|
||||
0 => $this->translate('OK'),
|
||||
1 => $this->translate('WARNING'),
|
||||
2 => $this->translate('CRITICAL'),
|
||||
3 => $this->translate('UNKNOWN'),
|
||||
99 => $this->translate('PENDING'),
|
||||
];
|
||||
|
||||
return $serviceStateList;
|
||||
}
|
||||
|
||||
protected function useIcingaDbBackend()
|
||||
{
|
||||
if (Module::exists('icingadb')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue