<commit_before><?php

use hipanel\base\View;
use hipanel\helpers\Url;
use hipanel\widgets\ActionBox;
use hipanel\widgets\Pjax;
use yii\grid\GridView;
use yii\helpers\Html;

/**
 * @var View $this
 * @var \hipanel\modules\server\models\RrdSearch $model
 * @var \hiqdev\hiart\ActiveDataProvider $dataProvider
 */

$searchModel = $model;
$models = $dataProvider->getModels();
$model = reset($models);

$this->title = Yii::t('hipanel/server', '{server} - RRD', ['server' => $model->server->name]);
$this->breadcrumbs->setItems([
    Html::a(Yii::t('hipanel/server', 'Servers'), ['@server']),
    Html::a($model->server->name, ['@server/view', 'id' => $model->server->id]),
    Yii::t('hipanel/server', 'RRD')
]);

Pjax::begin(array_merge(Yii::$app->params['pjax'], ['enablePushState' => true]));

$box = ActionBox::begin([
    'model' => $searchModel,
    'dataProvider' => $dataProvider,
    'bulk' => false,
]);
    echo $box->renderSearchForm(['model' => $model], [
        'id' => 'rrd-form',
        'options' => [
            'displayNone' => false,
        ],
        'action' => ['@rrd/view', 'id' => $model->id],
        'submitButtonWrapperOptions' => [
            'class' => 'col-md-4 md-pt-20'
        ],
    ]);
    echo GridView::widget([
        'showHeader' => false,
        'options' => [
            'class' => 'table-responsive'
        ],
        'tableOptions' => [
            'class' => 'table',
        ],
        'summary' => false,
        'dataProvider' => new \yii\data\ArrayDataProvider([
            'allModels' => $model->images,
            'pagination' => false,
            'sort' => false,
        ]),
        'columns' => [
            [
                'format' => 'raw',
                'value' => function ($model, $key, $index, $widget) {
                    $html = Html::tag('img', '', ['src' => 'data:image/png;base64,' . $model->base64]);

                    if ($model->graph) {
                        $html = Html::a($html, Url::current(['graph' => $model->graph]));
                    }

                    return Html::tag('div', $html, ['class' => 'text-center']);
                }
            ]
        ]
    ]);
$box->end();

Pjax::end();<commit_msg>Replace ActionBox to IndexPage widget<commit_after><?php

use hipanel\base\View;
use hipanel\helpers\Url;
use hipanel\widgets\ActionBox;
use hipanel\widgets\IndexPage;
use hipanel\widgets\Pjax;
use yii\grid\GridView;
use yii\helpers\Html;

/**
 * @var View $this
 * @var \hipanel\modules\server\models\RrdSearch $model
 * @var \hiqdev\hiart\ActiveDataProvider $dataProvider
 */

$searchModel = $model;
$models = $dataProvider->getModels();
$model = reset($models);

$this->title = Yii::t('hipanel/server', '{server} - RRD', ['server' => $model->server->name]);
$this->breadcrumbs->setItems([
    Html::a(Yii::t('hipanel/server', 'Servers'), ['@server']),
    Html::a($model->server->name, ['@server/view', 'id' => $model->server->id]),
    Yii::t('hipanel/server', 'RRD')
]);

?>

<?php Pjax::begin(array_merge(Yii::$app->params['pjax'], ['enablePushState' => true])) ?>
    <?php $page = IndexPage::begin(['model' => $searchModel, 'dataProvider' => $dataProvider, 'layout' => 'rrd']) ?>
        <?= $page->setSearchFormData(['model' => $model]) ?>
        <?= $page->setSearchFormOptions([
            'id' => 'rrd-form',
            'options' => [
                'displayNone' => false,
            ],
            'action' => ['@rrd/view', 'id' => $model->id],
            'submitButtonWrapperOptions' => [
                'class' => 'col-md-4 md-pt-20'
            ],
        ]) ?>
        <?php $page->beginContent('table') ?>
        <?php $page->beginBulkForm() ?>
            <?= GridView::widget([
                'showHeader' => false,
                'options' => [
                    'class' => 'table-responsive'
                ],
                'tableOptions' => [
                    'class' => 'table',
                ],
                'summary' => false,
                'dataProvider' => new \yii\data\ArrayDataProvider([
                    'allModels' => $model->images,
                    'pagination' => false,
                    'sort' => false,
                ]),
                'columns' => [
                    [
                        'format' => 'raw',
                        'value' => function ($model, $key, $index, $widget) {
                            $html = Html::tag('img', '', ['src' => 'data:image/png;base64,' . $model->base64]);

                            if ($model->graph) {
                                $html = Html::a($html, Url::current(['graph' => $model->graph]));
                            }

                            return Html::tag('div', $html, ['class' => 'text-center']);
                        }
                    ]
                ]
            ]); ?>
        <?php $page->endBulkForm() ?>
        <?php $page->endContent() ?>
    <?php $page->end() ?>
<?php Pjax::end() ?>
{'fraction_non_alphanumeric': 0.2064932446057673, 'fraction_numerical': 0.0028231498285944748, 'mean_word_length': 1.9245283018867925, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 116, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2722287', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1546, 'n_words': 253}