| 1 | <?php |
||||
| 2 | |||||
| 3 | use hipanel\modules\server\grid\BindingColumn; |
||||
| 4 | use hipanel\modules\server\grid\HubGridView; |
||||
| 5 | use hipanel\modules\server\grid\ServerGridView; |
||||
| 6 | use hipanel\modules\server\menus\HubDetailMenu; |
||||
| 7 | use hipanel\modules\server\models\Binding; |
||||
| 8 | use hipanel\widgets\Box; |
||||
| 9 | use hipanel\widgets\MainDetails; |
||||
| 10 | use hipanel\widgets\Pjax; |
||||
| 11 | use hipanel\widgets\SettingsModal; |
||||
| 12 | use yii\helpers\Html; |
||||
| 13 | |||||
| 14 | /** @var array $snmpOptions */ |
||||
| 15 | /** @var array $digitalCapacityOptions */ |
||||
| 16 | /** @var array $nicMediaOptions */ |
||||
| 17 | |||||
| 18 | $this->title = Html::encode($model->name); |
||||
| 19 | $this->params['breadcrumbs'][] = ['label' => Yii::t('hipanel:server', 'Switches'), 'url' => ['index']]; |
||||
| 20 | $this->params['breadcrumbs'][] = $this->title; |
||||
| 21 | |||||
| 22 | $this->registerCss(' |
||||
| 23 | .profile-block { |
||||
| 24 | text-align: center; |
||||
| 25 | } |
||||
| 26 | '); |
||||
| 27 | ?> |
||||
| 28 | <div class="row"> |
||||
| 29 | <div class="col-md-3"> |
||||
| 30 | <div class="row"> |
||||
| 31 | <div class="col-md-12"> |
||||
| 32 | <?= MainDetails::widget([ |
||||
| 33 | 'title' => $model->name, |
||||
| 34 | 'icon' => 'fa-arrows-alt', |
||||
| 35 | 'subTitle' => Html::a($model->buyer, ['@client/view', 'id' => $model->buyer_id]), |
||||
| 36 | 'menu' => HubDetailMenu::widget(['model' => $model], ['linkTemplate' => '<a href="{url}" {linkOptions}><span class="pull-right">{icon}</span> {label}</a>']), |
||||
| 37 | ]) ?> |
||||
| 38 | </div> |
||||
| 39 | <div class="col-md-12"> |
||||
| 40 | <?php |
||||
| 41 | $box = Box::begin(['renderBody' => false, 'bodyOptions' => ['class' => 'no-padding']]); |
||||
| 42 | $box->beginHeader(); |
||||
| 43 | echo $box->renderTitle(Yii::t('hipanel:server', 'Switches')); |
||||
| 44 | $box->endHeader(); |
||||
| 45 | $box->beginBody(); |
||||
| 46 | echo ServerGridView::detailView([ |
||||
| 47 | 'model' => $model, |
||||
| 48 | 'boxed' => false, |
||||
| 49 | 'columns' => array_map(function (Binding $binding) { |
||||
| 50 | return [ |
||||
| 51 | 'class' => BindingColumn::class, |
||||
| 52 | 'attribute' => $binding->typeWithNo, |
||||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||||
| 53 | ]; |
||||
| 54 | }, $model->bindings), |
||||
| 55 | ]); |
||||
| 56 | $box->endBody(); |
||||
| 57 | $box->end(); |
||||
| 58 | ?> |
||||
| 59 | </div> |
||||
| 60 | </div> |
||||
| 61 | </div> |
||||
| 62 | <div class="col-md-4"> |
||||
| 63 | <div class="row"> |
||||
| 64 | <div class="col-md-12"> |
||||
| 65 | <?php |
||||
| 66 | $box = Box::begin(['renderBody' => false]); |
||||
| 67 | $box->beginHeader(); |
||||
| 68 | echo $box->renderTitle(Yii::t('hipanel:server:hub', 'General information')); |
||||
| 69 | $box->endHeader(); |
||||
| 70 | $box->beginBody(); |
||||
| 71 | echo HubGridView::detailView([ |
||||
| 72 | 'model' => $model, |
||||
| 73 | 'boxed' => false, |
||||
| 74 | 'gridOptions' => [ |
||||
| 75 | 'extraOptions' => [ |
||||
| 76 | 'snmp_version_id' => $snmpOptions, |
||||
| 77 | 'digit_capacity_id' => $digitalCapacityOptions, |
||||
| 78 | 'nic_media' => $nicMediaOptions, |
||||
| 79 | ], |
||||
| 80 | ], |
||||
| 81 | 'columns' => [ |
||||
| 82 | 'switch', |
||||
| 83 | 'inn', |
||||
| 84 | 'buyer', |
||||
| 85 | 'model', |
||||
| 86 | 'type', |
||||
| 87 | 'ip', |
||||
| 88 | 'mac', |
||||
| 89 | 'login', |
||||
| 90 | 'ports_num', |
||||
| 91 | 'traf_server_id', |
||||
| 92 | 'vlan_server_id', |
||||
| 93 | 'community', |
||||
| 94 | 'snmp_version_id', |
||||
| 95 | 'digit_capacity_id', |
||||
| 96 | 'nic_media', |
||||
| 97 | 'base_port_no', |
||||
| 98 | ], |
||||
| 99 | ]); |
||||
| 100 | $box->endBody(); |
||||
| 101 | $box->end(); |
||||
| 102 | ?> |
||||
| 103 | </div> |
||||
| 104 | </div> |
||||
| 105 | <div class="row"> |
||||
| 106 | <?php Pjax::begin(['enablePushState' => false]) ?> |
||||
| 107 | <div class="col-md-12"> |
||||
| 108 | <?php |
||||
| 109 | $box = Box::begin(['renderBody' => false]); |
||||
| 110 | $box->beginHeader(); |
||||
| 111 | echo $box->renderTitle(Yii::t('hipanel:server', 'Financial information')); |
||||
| 112 | $box->endHeader(); |
||||
| 113 | $box->beginBody(); |
||||
| 114 | echo HubGridView::detailView([ |
||||
| 115 | 'boxed' => false, |
||||
| 116 | 'model' => $model, |
||||
| 117 | 'columns' => [ |
||||
| 118 | 'tariff', |
||||
| 119 | 'sale_time', |
||||
| 120 | ], |
||||
| 121 | ]); |
||||
| 122 | $box->endBody(); |
||||
| 123 | $box->beginFooter(); |
||||
| 124 | if (Yii::$app->user->can('hub.sell')) { |
||||
|
0 ignored issues
–
show
The method
can() does not exist on null.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 125 | echo SettingsModal::widget([ |
||||
| 126 | 'model' => $model, |
||||
| 127 | 'title' => Yii::t('hipanel:server', 'Change tariff'), |
||||
| 128 | 'scenario' => 'sell', |
||||
| 129 | 'toggleButton' => [ |
||||
| 130 | 'class' => 'btn btn-default', |
||||
| 131 | ], |
||||
| 132 | ]); |
||||
| 133 | } |
||||
| 134 | $box->endFooter(); |
||||
| 135 | $box->end(); |
||||
| 136 | ?> |
||||
| 137 | </div> |
||||
| 138 | <?php Pjax::end() ?> |
||||
| 139 | </div> |
||||
| 140 | <?= $this->render('@hipanel/modules/server/views/_configuration-view', [ |
||||
| 141 | 'model' => $model, |
||||
| 142 | 'configAttrs' => ['units'], |
||||
| 143 | ]) ?> |
||||
| 144 | </div> |
||||
| 145 | </div> |
||||
| 146 |