* @var \yii\web\View $this * @var \insolita\redisman\controllers\DefaultController $context * @var \insolita\redisman\Redisman $module * @var \yii\data\ArrayDataProvider $dataProvider */ $module = $this->context->module; $this->title = $module->getCurrentName(); ?> <div class="ui orange segment"> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => '\\Zelenin\\yii\\SemanticUI\\widgets\\CheckboxColumn'], 'key', 'type', 'size', 'ttl', ['class' => '\\yii\\grid\\ActionColumn', 'template' => '{quick} {view} {delete}', 'buttons' => ['quick' => function ($url, $model) { return Html::a('<i class="icon circular large eye green"></i>', \yii\helpers\Url::to(['/redisman/item/quick', 'key' => urlencode($model['key'])]), ['data-pjax' => 0, 'class' => 'modalink', 'title' => Yii::t('app', 'Quick View')]); }, 'view' => function ($url, $model) { return Html::a('<i class="icon circular inverted eye green"></i>', \yii\helpers\Url::to(['/redisman/item/view', 'key' => urlencode($model['key'])]), ['data-pjax' => 0, 'title' => Yii::t('app', 'View')]); }, 'delete' => function ($url, $model) { return Html::a('<i class="icon circular small trash red"></i>', \yii\helpers\Url::to(['/redisman/item/delete']), ['data-pjax' => 0, 'data-params' => ['RedisItem[key]' => urlencode($model['key'])], 'data-confirm' => 'Подтвердите действие', 'data-method' => 'post', 'title' => Yii::t('app', 'Delete')]); }]]]]); ?> </div> <?php $modal = \Zelenin\yii\SemanticUI\modules\Modal::begin(['id' => 'quickmodal', 'size' => \Zelenin\yii\SemanticUI\modules\Modal::SIZE_LARGE, 'header' => \insolita\redisman\Redisman::t('redisman', 'Key Information'), 'actions' => \Zelenin\yii\SemanticUI\Elements::button(\insolita\redisman\Redisman::t('redisman', 'Close'), ['class' => 'black'])]); ?> <div class="content"></div> <?php $modal::end(); $this->registerJs(' $(document).on("click",".modalink",function(e){ e.preventDefault();
use Zelenin\yii\SemanticUI\widgets\GridView; use yii\helpers\Html; use yii\helpers\Url; /** * @var $this yii\web\View * @var \app\models\UserLog $model * @var \yii\data\ActiveDataProvider $dp */ $this->title = Yii::t('app', 'User Log'); ?> <div class="ui orange segment"> <?php echo GridView::widget(['filterModel' => $model, 'dataProvider' => $dp, 'columns' => [['attribute' => 'connection', 'filter' => Yii::$app->getModule('redisman')->connectionList()], ['attribute' => 'db'], ['attribute' => 'time', 'value' => function ($model) { return date('d.m.Y H:i', $model->time); }, 'filter' => false], ['attribute' => 'user.ip'], ['attribute' => 'command', 'filter' => false], ['class' => '\\yii\\grid\\ActionColumn', 'template' => '{user}', 'buttons' => ['user' => function ($url, $model) { return Html::a('<i class="icon circular large user green"></i>', \yii\helpers\Url::to(['/log/user', 'id' => $model->user_id]), ['data-pjax' => 0, 'class' => 'modalink', 'title' => Yii::t('app', 'User Info')]); }]]]]); ?> </div> <?php $modal = \Zelenin\yii\SemanticUI\modules\Modal::begin(['id' => 'quickmodal', 'size' => \Zelenin\yii\SemanticUI\modules\Modal::SIZE_LARGE, 'header' => Yii::t('app', 'User Information'), 'actions' => \Zelenin\yii\SemanticUI\Elements::button(Yii::t('app', 'Close'), ['class' => 'black'])]); ?> <div class="content"></div> <?php $modal::end(); $this->registerJs(' $(document).on("click",".modalink",function(e){ e.preventDefault(); var url=$(this).attr("href"); $.get(url,function(data){
<?php $form = \Zelenin\yii\SemanticUI\widgets\ActiveForm::begin(['action' => ['/redisman/item/update', 'key' => urlencode($model->key)]]); ?> <div class="one"> <?php \yii\widgets\Pjax::begin(['timeout' => 5000, 'id' => 'hashpjax', 'enablePushState' => false]); if ($model->hasErrors()) { echo \yii\helpers\Html::errorSummary($model, ['encode' => true]); } ?> <?php echo \Zelenin\yii\SemanticUI\widgets\GridView::widget(['dataProvider' => $model->formatvalue, 'columns' => ['field', ['attribute' => 'value', 'format' => 'raw', 'value' => function ($data, $key, $index) use($model) { return '<input type="hidden" name="RedisItem[formatvalue][' . $index . '][field]" value="' . \yii\helpers\Html::encode($data['field']) . '"> <input type="text" name="RedisItem[formatvalue][' . $index . '][value]" value="' . \yii\helpers\Html::encode($data['value']) . '">'; }], ['class' => '\\yii\\grid\\ActionColumn', 'template' => '{remove}', 'buttons' => ['remove' => function ($url, $data) use($model) { return \yii\helpers\Html::a('<i class="icon remove"></i>', ['/redisman/item/remfield', 'RedisItem[key]' => urlencode($model->key), 'RedisItem[field]' => $data['field']], ['title' => Redisman::t('redisman', 'Remove field'), 'data-pjax' => 1]); }]]]]); ?> <?php \yii\widgets\Pjax::end(); ?> </div> <br/><br/> <div class="one"> <button class="ui blue icon button submit"><i class="save icon"></i><?php echo Yii::t('app', 'Update'); ?> </button> </div>