index.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2016-03-23 17:51
  7. */
  8. /**
  9. * @var $this yii\web\View
  10. * @var $dataProvider common\models\AdminLog
  11. * @var $searchModel backend\models\search\AdminLogSearch
  12. */
  13. use backend\grid\DateColumn;
  14. use backend\grid\GridView;
  15. use yii\helpers\StringHelper;
  16. use backend\widgets\Bar;
  17. use backend\grid\CheckboxColumn;
  18. use backend\grid\ActionColumn;
  19. $this->title = "Admin Log";
  20. $this->params['breadcrumbs'][] = Yii::t('app', 'Admin Log');
  21. ?>
  22. <div class="row">
  23. <div class="col-sm-12">
  24. <div class="ibox">
  25. <?= $this->render('/widgets/_ibox-title') ?>
  26. <div class="ibox-content">
  27. <?= Bar::widget([
  28. 'template' => '{refresh} {delete}'
  29. ]) ?>
  30. <?= GridView::widget([
  31. 'dataProvider' => $dataProvider,
  32. 'filterModel' => $searchModel,
  33. 'columns' => [
  34. [
  35. 'class' => CheckboxColumn::className(),
  36. ],
  37. [
  38. 'attribute' => 'id',
  39. ],
  40. [
  41. 'label' => Yii::t('app', 'Admin'),
  42. 'attribute' => 'admin_username',
  43. 'value' => 'user.username',
  44. ],
  45. [
  46. 'attribute' => 'route',
  47. ],
  48. [
  49. 'attribute' => 'description',
  50. 'format' => 'html',
  51. 'value' => function ($model, $key, $index, $column) {
  52. return StringHelper::truncate($model->description, 200);
  53. }
  54. ],
  55. [
  56. 'class' => DateColumn::className(),
  57. 'attribute' => 'created_at',
  58. ],
  59. [
  60. 'class' => ActionColumn::className(),
  61. 'template' => '{view-layer} {delete}'
  62. ],
  63. ]
  64. ]); ?>
  65. </div>
  66. </div>
  67. </div>
  68. </div>