Completed
Push — master ( 3b126f...b31b1e )
by Klochok
12:26
created

HubGridLegend::items()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 35
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 35
rs 8.8571
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\server\grid;
4
5
use hipanel\widgets\gridLegend\BaseGridLegend;
6
use hipanel\widgets\gridLegend\GridLegendInterface;
7
use Yii;
8
9
class HubGridLegend extends BaseGridLegend implements GridLegendInterface
10
{
11
    public function items()
12
    {
13
        return [
14
            [
15
                'label' => Yii::t('hipanel:server:hub', 'Switch'),
16
            ],
17
            [
18
                'label' => Yii::t('hipanel:server:hub', 'KVM'),
19
                'color' => '#FFFF99',
20
                'rule' => $this->model->type === 'kvm',
21
            ],
22
            [
23
                'label' => Yii::t('hipanel:server:hub', 'APC'),
24
                'color' => '#AAFFAA',
25
                'rule' => $this->model->type === 'pdu',
26
            ],
27
            [
28
                'label' => Yii::t('hipanel:server:hub', 'IPMI'),
29
                'color' => '#AAFFFF',
30
                'rule' => $this->model->type === 'ipmi',
31
            ],
32
            [
33
                'label' => Yii::t('hipanel:server:hub', 'Module'),
34
            ],
35
            [
36
                'label' => Yii::t('hipanel:server:hub', 'Rack'),
37
            ],
38
            [
39
                'label' => Yii::t('hipanel:server:hub', 'Camera'),
40
            ],
41
            [
42
                'label' => Yii::t('hipanel:server:hub', 'Cable organizer'),
43
            ],
44
        ];
45
    }
46
}
47