Example #1
0
 public function renderToggleButton($content, $options = [])
 {
     if (!isset($options['id'])) {
         $options['id'] = $this->getId() . '-button';
     }
     $this->getView()->registerJs('
     jQuery("#' . $options['id'] . '").on("click", function(event) {
         event.preventDefault();
         jQuery("#' . $this->getId() . '").modal("show");
     });
     ');
     return Elements::button($content, $options);
 }
Example #2
0
 * @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){
$("#quickmodal .content").html(data);
$("#quickmodal").modal({onHide:function(){ $("#quickmodal .content").html("");}}).modal("show");
});

   });
');
Example #3
0
echo $form->errorSummary($model);
?>
    <div class="one">
        <?php 
echo $form->field($model, 'connection')->dropDownList($module->connectionList(), ['id' => 'currentcon']);
?>
    </div>
    <div class="one">

        <?php 
echo $form->field($model, 'db')->dropDownList($module->dbList(), ['id' => 'currentdb']);
?>
    </div><br/>
<div class="one right ui aligned">
<?php 
echo Elements::button('<i class="plug icon"></i>' . \insolita\redisman\Redisman::t('redisman', 'Connect'), ['class' => 'green circular right  aligned', 'type' => 'submit', 'tag' => 'button']);
?>
    </div>

<?php 
ActiveForm::end();
$js = new \yii\web\JsExpression('var url="' . \yii\helpers\Url::to(['/redisman/default/dbload']) . '";
var cur=$("#connectionform-connection").val();
   $("#currentcon").dropdown
   ({
      onChange: function(value, text, $selectedItem)
      {
          console.log(value + "|"+ cur);
          if(value && value!=cur)
          {
             cur=value;
Example #4
0
<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();
       var url=$(this).attr("href");
$.get(url,function(data){
$("#quickmodal .content").html(data);
$("#quickmodal").modal({onHide:function(){ $("#quickmodal .content").html("");}}).modal("show");
});

   });
');
Example #5
0
echo $form->errorSummary($model);
?>
    <div class="one">
        <?php 
echo $form->field($model, 'pattern')->textInput()->hint(Redisman::t('redisman', 'support redis patterns (*,?,[var])'));
?>
    </div>
    <div class="one">

        <?php 
echo $form->field($model, 'type')->checkboxList([Redisman::REDIS_STRING => Redisman::t('redisman', 'string'), Redisman::REDIS_HASH => Redisman::t('redisman', 'hash'), Redisman::REDIS_LIST => Redisman::t('redisman', 'list'), Redisman::REDIS_SET => Redisman::t('redisman', 'set'), Redisman::REDIS_ZSET => Redisman::t('redisman', 'zset')]);
?>
    </div>
    <div class="one">
        <?php 
echo $form->field($model, 'perpage')->dropDownList([20 => 20, 30 => 30, 50 => 50, 100 => 100, 200 => 200, 500 => 500]);
?>
    </div>
    <div class="one">
        <?php 
echo $form->field($model, 'encache')->checkbox([]);
?>
    </div><br/>
<div class="one right aligned">
<?php 
echo Elements::button('<i class="find icon"></i>' . Yii::t('app', 'Search'), ['class' => 'teal circular right ui aligned', 'type' => 'submit', 'tag' => 'button']);
echo \yii\helpers\Html::a('<i class="remove icon"></i>' . Yii::t('app', 'Clear'), ['/redisman/default/reset-search'], ['class' => 'ui button blue circular left aligned']);
?>
</div>
<?php 
ActiveForm::end();
Example #6
0
echo $form->field($model, 'username', ['options' => ['class' => $model->hasErrors('username') ? 'field error' : 'field']])->textInput();
?>
</div>
<div class="one">

    <?php 
echo $form->field($model, 'password', ['options' => ['class' => $model->hasErrors('username') ? 'field error' : 'field']])->passwordInput();
?>
</div>
<div class="inline field">
    <?php 
echo $form->field($model, 'rememberMe')->checkbox();
?>
</div>
<?php 
echo Elements::button('<i class="sign in icon"></i>' . Yii::t('app', 'Login'), ['class' => 'green', 'type' => 'submit', 'tag' => 'button']);
ActiveForm::end();
?>
<div class="ui bottom attached info icon message">
    <i class="info icon"></i>

    <div class="content">
        <div class="header">
            <?php 
echo Yii::t('app', 'Don`t know password?');
?>
        </div>
        <?php 
echo Yii::t('app', 'To modify the username/password, please check out the code');
?>
<code> app\models\User::$users</code><?php