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

HubGridLegend   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 38
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B items() 0 35 1
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