Issues (213)

src/views/rrd/_search.php (1 issue)

1
<?php
2
3
/**
4
 * @var \hipanel\widgets\AdvancedSearch
5
 */
6
?>
7
<?= $search->field('id')->hiddenInput()->label(false) ?>
8
9
    <div class="col-md-2">
10
        <?= $search->field('graph')->dropDownList(
11
            array_merge(['' => Yii::t('hipanel:server:rrd', 'Index')],
12
                array_combine((array) $model->graphs, (array) $model->graphs)),
0 ignored issues
show
It seems like array_combine((array)$mo... (array)$model->graphs) can also be of type false; however, parameter $array2 of array_merge() does only seem to accept array|null, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

12
                /** @scrutinizer ignore-type */ array_combine((array) $model->graphs, (array) $model->graphs)),
Loading history...
13
            ['class' => 'form-control input-sm']
14
        ) ?>
15
    </div>
16
    <div class="col-md-2">
17
        <?= $search->field('period')->dropDownList(
18
            [
19
                '1' => Yii::t('hipanel:server', '1 min/px'),
20
                '5' => Yii::t('hipanel:server', '5 min/px'),
21
                '60' => Yii::t('hipanel:server', '60 min/px'),
22
                '720' => Yii::t('hipanel:server', '720 min/px'),
23
            ],
24
            ['class' => 'form-control input-sm']
25
        ) ?>
26
    </div>
27
    <div class="col-md-2">
28
        <?= $search->field('width')->textInput(['placeholder' => '1081', 'class' => 'form-control input-sm']) ?>
29
    </div>
30
    <div class="col-md-2">
31
        <?= $search->field('shift')->textInput(['placeholder' => '0', 'class' => 'form-control input-sm']) ?>
32
    </div>
33
34
<?php
35
$widgetId = $search->getDivId();
36
37
$this->registerJs(<<<JS
38
    $('#form-$widgetId').on('change', 'select', function (event) {
39
        $(this).submit();
40
    });
41
JS
42
);
43