Skip to content

Commit

Permalink
hdomain/grid: added DNS_on label to the grid
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Nov 11, 2015
1 parent 7beeaa5 commit 1124053
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/grid/HdomainGridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use hipanel\modules\hosting\widgets\hdomain\State;
use hipanel\modules\server\grid\ServerColumn;
use hipanel\widgets\ArraySpoiler;
use hipanel\widgets\Label;
use Yii;
use yii\filters\auth\HttpBasicAuth;
use yii\helpers\Html;
Expand Down Expand Up @@ -63,7 +64,6 @@ static public function defaultColumns()
'filter' => false,
'format' => 'raw',
'value' => function ($model) {
$html = '';
$vhost = $model->getAttribute('vhost');

$html = $vhost['ip'];
Expand All @@ -90,7 +90,17 @@ static public function defaultColumns()
'class' => RefColumn::className(),
'format' => 'raw',
'value' => function ($model) {
return State::widget(compact('model'));
$html = '';
if ($model->dns_on) {
$html .= Label::widget([
'color' => 'success',
'label' => Yii::t('app', 'DNS'),
'tag' => 'span',
'labelOptions' => ['title' => Yii::t('app', 'DNS is enabled')],
]);
}
$html .= ' ' . State::widget(compact('model'));
return $html;
},
'gtype' => 'state,hdomain',
],
Expand Down

0 comments on commit 1124053

Please sign in to comment.