AggregateGridView   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 51
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A columns() 0 48 1
1
<?php
2
/**
3
 * Hosting Plugin for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-hosting
6
 * @package   hipanel-module-hosting
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\hosting\grid;
12
13
use hipanel\grid\BoxedGridView;
14
use hipanel\grid\MainColumn;
15
use hipanel\grid\RefColumn;
16
use hipanel\grid\XEditableColumn;
17
use hipanel\modules\hosting\menus\AggregateActionsMenu;
18
use hiqdev\yii2\menus\grid\MenuColumn;
19
use Yii;
20
21
class AggregateGridView extends BoxedGridView
22
{
23
    public function columns()
24
    {
25
        return array_merge(parent::columns(), [
26
            'ip' => [
27
                'class' => MainColumn::class,
28
                'format' => 'html',
29
                'attribute' => 'ip',
30
                'filterAttribute' => 'ip_like',
31
            ],
32
            'state' => [
33
                'class' => RefColumn::class,
34
                'i18nDictionary' => 'hipanel.hosting.ipam',
35
                'format' => 'raw',
36
                'gtype' => 'state,ip',
37
            ],
38
            'type' => [
39
                'class' => RefColumn::class,
40
                'i18nDictionary' => 'hipanel.hosting.ipam',
41
                'format' => 'raw',
42
                'gtype' => 'type,ip',
43
            ],
44
            'rir' => [
45
                'class' => RefColumn::class,
46
                'i18nDictionary' => 'hipanel.hosting.ipam',
47
                'format' => 'raw',
48
                'gtype' => 'type,ip_rir',
49
            ],
50
            'note' => [
51
                'class' => XEditableColumn::class,
52
                'pluginOptions' => [
53
                    'url' => '@aggregate/set-note',
54
                ],
55
                'filter' => true,
56
                'popover' => Yii::t('hipanel', 'Make any notes for your convenience'),
57
            ],
58
            'utilization' => [
59
                'class' => UtilizationColumn::class,
60
            ],
61
            'family' => [
62
                'class' => FamilyColumn::class,
63
            ],
64
            'actions' => [
65
                'class' => MenuColumn::class,
66
                'contentOptions' => ['style' => 'width: 1%; white-space:nowrap;'],
67
                'menuClass' => AggregateActionsMenu::class,
68
            ],
69
        ]);
70
    }
71
}
72