Issues (213)

src/grid/HubGridLegend.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\grid;
12
13
use hipanel\widgets\gridLegend\BaseGridLegend;
14
use hipanel\widgets\gridLegend\GridLegendInterface;
15
use Yii;
16
17
class HubGridLegend extends BaseGridLegend implements GridLegendInterface
18
{
19
    public function items()
20
    {
21
        return [
22
            [
23
                'label' => Yii::t('hipanel:server:hub', 'Switch'),
24
                'columns' => ['actions'],
25
            ],
26
            [
27
                'label' => Yii::t('hipanel:server:hub', 'KVM'),
28
                'color' => '#fcf8e3',
29
                'rule' => $this->model->type === 'kvm',
0 ignored issues
show
Accessing type on the interface yii\db\ActiveRecordInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
30
                'columns' => ['actions'],
31
            ],
32
            [
33
                'label' => Yii::t('hipanel:server:hub', 'APC'),
34
                'color' => '#dff0d8',
35
                'rule' => $this->model->type === 'pdu',
36
                'columns' => ['actions'],
37
            ],
38
            [
39
                'label' => Yii::t('hipanel:server:hub', 'IPMI'),
40
                'color' => '#d9edf7',
41
                'rule' => $this->model->type === 'ipmi',
42
                'columns' => ['actions'],
43
            ],
44
            [
45
                'label' => Yii::t('hipanel:server:hub', 'Module'),
46
                'columns' => ['actions'],
47
            ],
48
            [
49
                'label' => Yii::t('hipanel:server:hub', 'Rack'),
50
                'columns' => ['actions'],
51
            ],
52
            [
53
                'label' => Yii::t('hipanel:server:hub', 'Camera'),
54
                'columns' => ['actions'],
55
            ],
56
            [
57
                'label' => Yii::t('hipanel:server:hub', 'Cable organizer'),
58
                'columns' => ['actions'],
59
            ],
60
        ];
61
    }
62
}
63