<?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', 'nsa', ['attribute' => 'type', 'value' => $model->getType()], 'latitude', 'longitude', ['attribute' => 'domain_id', 'value' => $model->getDomainName()]]]); ?> </div> </div> </div> <div class="col-md-6"> <div class="box box-default"> <div class="box-header with-border"> <h3 class="box-title"><?php echo Yii::t("topology", "Services"); ?> </h3> <div class="box-tools"> <?php echo GridButtons::widget(['size' => 'small', 'addRoute' => ['/topology/service/create', 'id' => $model->id]]); ?> </div> </div> <div class="box-body"> <?php $form = ActiveForm::begin(['method' => 'post', 'action' => ['/topology/service/delete'], 'id' => 'service-form', 'enableClientScript' => false, 'enableClientValidation' => false]); echo Grid::widget(['dataProvider' => $services, 'columns' => array(array('class' => IcheckboxColumn::className(), 'name' => 'delete', 'multiple' => false, 'headerOptions' => ['style' => 'width: 2%;']), ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}', 'buttons' => ['update' => function ($url, $model) { return Html::a('<span class="fa fa-pencil"></span>', Url::to(['/topology/service/update', 'id' => $model->id])); }], 'headerOptions' => ['style' => 'width: 2%;']], ['attribute' => 'type', 'value' => function ($model) { return $model->getType(); }], 'url')]); ActiveForm::end(); ?> </div> </div>
?> <div class="row"> <div class="col-md-8"> <div class="box box-default"> <div class="box-header with-border"> <h3 class="box-title"><?php echo Yii::t("topology", "Rules"); ?> </h3> </div> <div class="box-body"> <?php echo GridButtons::widget(['addRoute' => ['create-rule']]) . '<br>'; $form = ActiveForm::begin(['method' => 'post', 'action' => ['delete-rule'], 'id' => 'rule-form', 'enableClientScript' => false, 'enableClientValidation' => false]); Pjax::begin(['id' => 'rule-pjax']); echo Grid::widget(['id' => 'rule-grid', 'dataProvider' => $ruleProvider, 'columns' => array(array('class' => IcheckboxColumn::className(), 'name' => 'delete', 'multiple' => false, 'headerOptions' => ['style' => 'width: 2%;']), ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update-rule}', 'buttons' => ['update-rule' => function ($url, $model) { return Html::a('<span class="fa fa-pencil"></span>', $url); }], 'headerOptions' => ['style' => 'width: 2%;']], "name", ['attribute' => 'auto_apply', 'value' => function ($model) { return $model->auto_apply ? Yii::t("topology", "Automatic") : Yii::t("topology", "Manual"); }], ['header' => 'Scheduled', 'value' => function ($model) { return $model->isScheduled() ? Yii::t("topology", "Yes") : Yii::t("topology", "No"); }], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{start}', 'buttons' => ['start' => function ($url, $model) { return '<button class="btn btn-sm btn-primary start-discovery"><span class="fa fa-compass "></span> Start Discovery</button>'; }], 'headerOptions' => ['style' => 'width: 2%;']])]); Pjax::end(); ActiveForm::end(); ?> </div>
*/ use yii\widgets\ActiveForm; use meican\base\grid\Grid; use meican\base\grid\IcheckboxColumn; use meican\base\grid\GridButtons; use yii\helpers\Html; use yii\helpers\Url; use yii\widgets\Pjax; \meican\topology\assets\domain\Index::register($this); $this->params['header'] = [Yii::t('topology', 'Domains'), [Yii::t('home', 'Home'), Yii::t('topology', 'Topology'), 'Domains']]; ?> <div class="box box-default"> <div class="box-header with-border"> <?php echo GridButtons::widget(); ?> </div> <div class="box-body"> <?php $form = ActiveForm::begin(['method' => 'post', 'action' => ['delete'], 'id' => 'domain-form', 'enableClientScript' => false, 'enableClientValidation' => false]); Pjax::begin(); echo Grid::widget(['dataProvider' => $domains, 'id' => 'grid', 'columns' => array(['class' => IcheckboxColumn::className(), 'name' => 'delete', 'multiple' => false, 'headerOptions' => ['style' => 'width: 2%;']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}', 'buttons' => ['update' => function ($url, $model) { return Html::a('<span class="fa fa-pencil"></span>', $url); }], 'headerOptions' => ['style' => 'width: 2%;']], ['label' => Yii::t('topology', 'Name'), 'value' => 'name', 'headerOptions' => ['style' => 'width: 50%;']], ['label' => Yii::t('topology', 'Default Policy'), 'value' => function ($dom) { return $dom->getPolicy(); }, 'headerOptions' => ['style' => 'width: 46%;']])]); Pjax::end(); ActiveForm::end(); ?> </div>