예제 #1
0
    
    <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>
        </div>  
        <div class="box box-default">
            <div class="box-header with-border">
예제 #2
0
use yii\widgets\Pjax;
use meican\base\grid\Grid;
use meican\base\grid\IcheckboxColumn;
use meican\base\grid\GridButtons;
\meican\topology\assets\network\Index::register($this);
$this->params['header'] = [Yii::t('topology', 'Networks'), [Yii::t('home', 'Home'), Yii::t('topology', 'Topology'), 'Networks']];
?>

<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' => 'network-form', 'enableClientScript' => false, 'enableClientValidation' => false]);
Pjax::begin();
echo Grid::widget(['dataProvider' => $networks, 'filterModel' => $searchModel, 'id' => 'gridNetowrks', '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: 25%;']], ['label' => Yii::t("topology", 'Urn'), 'value' => 'urn', 'headerOptions' => ['style' => 'width: 30%;']], ['label' => Yii::t("topology", 'Latitude'), 'value' => 'latitude', 'headerOptions' => ['style' => 'width: 8%;']], ['label' => Yii::t("topology", 'Longitude'), 'value' => 'longitude', 'headerOptions' => ['style' => 'width: 8%;']], ['label' => Yii::t("topology", 'Domain'), 'value' => function ($net) {
    return $net->getDomain()->one()->name;
}, 'filter' => Html::activeDropDownList($searchModel, 'domain_name', ArrayHelper::map($allowedDomains, 'name', 'name'), ['class' => 'form-control', 'prompt' => Yii::t("topology", 'any')]), 'headerOptions' => ['style' => 'width: 25%;']])]);
Pjax::end();
ActiveForm::end();
?>
    
    </div>
</div>
예제 #3
0
echo $userId;
?>
" class="btn btn-sm btn-primary add-domain-btn"><?php 
echo Yii::t("aaa", "Add");
?>
</a>
            <a id="delete-domain-role" class="btn btn-sm btn-default delete-btn"><?php 
echo Yii::t("aaa", "Delete");
?>
</a>
        </div>
    </div>
    <div class="box-body">
        <?php 
$form = ActiveForm::begin(['method' => 'post', 'action' => ['/aaa/role/delete'], 'id' => 'domain-role-form', 'enableClientScript' => false, 'enableClientValidation' => false]);
echo Grid::widget(['id' => 'role-domain-grid', 'dataProvider' => $rolesProvider, 'columns' => array(['class' => IcheckboxColumn::className(), 'checkboxOptions' => ['class' => 'deleteDomain'], 'name' => 'delete', 'multiple' => false, 'headerOptions' => ['style' => 'width: 2%;']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{edit}', 'contentOptions' => function ($model) {
    return ['class' => 'btn-edit', 'id' => $model->id];
}, 'buttons' => ['edit' => function ($url, $model) {
    return Html::a('<span class="fa fa-pencil"></span>', null);
}], 'headerOptions' => ['style' => 'width: 2%;']], ['attribute' => '_groupRoleName', 'format' => 'raw', 'value' => function ($model) {
    return $model->getGroup()->name;
}], ['attribute' => 'domain', 'format' => 'raw', 'value' => function ($model) {
    $type = $model->getGroup()->type;
    if ($type == Group::TYPE_DOMAIN) {
        $dom = $model->getDomain();
        if ($dom) {
            return $dom->name;
        }
        return Yii::t("aaa", "Any");
    } else {
        return Yii::t("aaa", "Any");
예제 #4
0
 * @copyright Copyright (c) 2016 RNP
 * @license http://github.com/ufrgs-hyman/meican#license
 */
use yii\widgets\ActiveForm;
use yii\helpers\Url;
use yii\helpers\Html;
use meican\base\grid\Grid;
use meican\base\grid\IcheckboxColumn;
use meican\base\grid\GridButtons;
\meican\aaa\assets\group\Index::register($this);
$this->params['header'] = ["Groups", ['Home', 'Groups']];
?>

<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' => 'group-form', 'enableClientScript' => false, 'enableClientValidation' => false]);
echo Grid::widget(['dataProvider' => $groups, 'columns' => array(array('class' => IcheckboxColumn::className(), 'name' => 'delete', 'multiple' => false, 'contentOptions' => ['style' => 'width: 15px;']), ['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%;']], 'name', ['label' => 'Tipo', 'value' => function ($group) {
    return $group->getType();
}])]);
ActiveForm::end();
?>
    </div>
</div>