Initial commit,修正
This commit is contained in:
Executable
+43
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\bootstrap\Alert;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
$params = Yii::$app->params;
|
||||
|
||||
?>
|
||||
|
||||
<div class="user-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
|
||||
<?php
|
||||
if( Yii::$app->getSession()->hasFlash('error') ) {
|
||||
echo Alert::widget([
|
||||
'options' => [
|
||||
'class' => 'alert alert-danger',
|
||||
],
|
||||
'body' => Yii::$app->getSession()->getFlash('error'),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<?= $form->field($model, 'avatar')->textInput(['value'=>'@web/img/profile_small.png'])->label('头像')?>
|
||||
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'mobile')->textInput(['label' => '']) ?>
|
||||
|
||||
<?= $form->field($model1, 'name' )->dropDownList($item)->label(Yii::t('common' ,'Role'))?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
|
||||
$this->title = '新增用户';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="user-create">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<hr/>
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
'model1' => $model1,
|
||||
'item' => $item,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Users';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
'id',
|
||||
'username',
|
||||
'auth_key',
|
||||
'password_hash',
|
||||
'password_reset_token',
|
||||
// 'email:email',
|
||||
// 'role',
|
||||
// 'status',
|
||||
// 'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
Executable
+75
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '运维人员列表';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('adminer/create')?>">新增运维</a>
|
||||
</div>
|
||||
<div class="col-sm-3 pull-right">
|
||||
<form action="<?=Url::toRoute('adminer/list')?>" method="post">
|
||||
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
|
||||
<div class="input-group">
|
||||
<input type="text" placeholder="请输入用户名或工号" name="username" class="input-sm form-control"> <span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>账号</th>
|
||||
<th>邮箱</th>
|
||||
<th>手机</th>
|
||||
<th>用户组</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach($user as $vo){?>
|
||||
<tr>
|
||||
<td><?=$vo['id']?></td>
|
||||
<td><img src="<?=Url::to($vo['avatar'])?>" alt="" style="width:40px;height:40px;"><?=$vo['username']?></td>
|
||||
<td><?=$vo['email']?></td>
|
||||
<td><?=$vo['mobile']?></td>
|
||||
<td><?=$vo['usergroup']['item_name']?></td>
|
||||
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['adminer/update','item_name'=>$vo['usergroup']['item_name'],'id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a> <?php if(!in_array($vo['username'],array('fm453','admin'))):?><a href="<?=Url::toRoute(['adminer/delete','id'=>$vo['id']])?>" class="btn btn-default btn-xs"><i class="fa fa-close"></i>删除</a><?php endif;?></td>
|
||||
</tr>
|
||||
<?php };?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--分页-->
|
||||
<div class="f-r">
|
||||
<?= LinkPager::widget([
|
||||
'pagination'=>$pages,
|
||||
'firstPageLabel' => '首页',
|
||||
'nextPageLabel' => '下一页',
|
||||
'prevPageLabel' => '上一页',
|
||||
'lastPageLabel' => '末页',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItem */
|
||||
|
||||
$this->title = '更新用户 ';
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content">
|
||||
<div class="row pd-10">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<hr>
|
||||
<div class="auth-item-form col-sm-4">
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput(['readonly'=>true])->label('账号') ?>
|
||||
|
||||
<?= $form->field($model, 'avatar')->textInput(['placeholder'=>'@web/img/profile_small.png'])->label('头像')?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['placheholder'=>''])->label('邮箱')?>
|
||||
<?= $form->field($model, 'mobile')->textInput(['placheholder'=>''])->label('手机号')?>
|
||||
|
||||
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
|
||||
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
|
||||
|
||||
<?php if($model->username =='fm453' || $model->username =='admin'):?>
|
||||
<?= $form->field($model->usergroup, 'item_name' )->dropDownList($item,['disabled'=>true])->label('用户组')?>
|
||||
<?php else:?>
|
||||
<?= $form->field($model->usergroup, 'item_name' )->dropDownList($item)->label('用户组')?>
|
||||
<?php endif;?>
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
|
||||
$this->title = $model->id;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'username',
|
||||
'auth_key',
|
||||
'password_hash',
|
||||
'password_reset_token',
|
||||
'email:email',
|
||||
'role',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '登陆日志';
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<span class="label label-primary pull-right">历史</span>
|
||||
<h5>访客</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins"><?=\backend\components\Helper::getHistoryVisNum()?></h1>
|
||||
<small>访客</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<span class="label label-danger pull-right">最近一个月</span>
|
||||
<h5>活跃用户</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins"><?=\backend\components\Helper::getMonthHistoryVisNum()?></h1>
|
||||
<small><?= date('m')?>月</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div id="history"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(\Yii::$app->user->can('/log/login')):?> <!--判断是否有权限,有则显示,无则隐藏-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="ibox-content">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>用户名</th>
|
||||
<th>登录IP</th>
|
||||
<th>登录时间</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($log as $vo):?>
|
||||
<tr>
|
||||
<td><?=$vo['id']?></td>
|
||||
<td><?=$vo['username']?></td>
|
||||
<td><?=$vo['ip']?></td>
|
||||
<td><?= date('Y-m-d H:i:s',$vo['create_time'])?></td>
|
||||
<td><?=str_replace('-','',$vo['data'])?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--分页-->
|
||||
<div class="f-r">
|
||||
<?= LinkPager::widget([
|
||||
'pagination'=>$pages,
|
||||
'firstPageLabel' => '首页',
|
||||
'nextPageLabel' => '下一页',
|
||||
'prevPageLabel' => '上一页',
|
||||
'lastPageLabel' => '末页',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?=Html::jsFile('@web/js/plugins/Highcharts/4.1.7/js/highcharts.js')?>
|
||||
<?=Html::jsFile('@web/js/plugins/Highcharts/4.1.7/js/modules/exporting.js')?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#history').highcharts({
|
||||
title: {
|
||||
text: '',
|
||||
x: -20 //center
|
||||
},
|
||||
credits: { enabled:false }, //屏蔽右下角
|
||||
exporting: { enabled:false }, //屏蔽右上角
|
||||
subtitle: {
|
||||
text: '',
|
||||
x: -20
|
||||
},
|
||||
xAxis: {
|
||||
categories: [<?=$HistoryMonthStr?>]
|
||||
},
|
||||
yAxis: {
|
||||
|
||||
title: {
|
||||
text: '访客/人'
|
||||
},
|
||||
//min: 7.5, // 这个用来控制y轴的开始刻度(最小刻度),另外还有一个表示最大刻度的max属性
|
||||
startOnTick: false, // y轴坐标是否从某一刻度开始(这个设定与标题无关)
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
color: '#808080'
|
||||
}]
|
||||
},
|
||||
tooltip: {
|
||||
valueSuffix: '人',
|
||||
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y:,.0f} 人</b><br/>',
|
||||
shared: true
|
||||
},
|
||||
/*legend: {
|
||||
layout: 'vertical',
|
||||
align: 'right',
|
||||
verticalAlign: 'middle',
|
||||
borderWidth: 0
|
||||
},*/
|
||||
series: [{
|
||||
name: '访客数',
|
||||
data: [<?=$HistoryMonthNum?>]
|
||||
}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\Menu */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="menu-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'parent' )->dropDownList($menuArr)?>
|
||||
|
||||
<?= $form->field($model, 'route')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'sort')->textInput()->label('排序') ?>
|
||||
|
||||
<?= $form->field($model, 'status')->radioList(['1'=>'显示','0'=>'隐藏'])->label('显示')?>
|
||||
|
||||
<?= $form->field($model, 'data')->textarea(['rows' => 6]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\Menu */
|
||||
|
||||
$this->title = '创建菜单';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<hr>
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
'menuArr' => $menuArr,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Executable
+85
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '菜单';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<p>
|
||||
<?= Html::a('创建菜单', ['create'], ['class' => 'btn btn-sm btn-primary']) ?>
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>父级</th>
|
||||
<th>路由</th>
|
||||
<th>状态</th>
|
||||
<th>排序</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($menu as $vo):?>
|
||||
<tr>
|
||||
<td><?=$vo['id']?></td>
|
||||
<td><?=$vo['name']?></td>
|
||||
<td><?=$vo['parent']?></td>
|
||||
<td><?=$vo['route']?></td>
|
||||
<td><?=$vo['status'] >0 ? '显示 ' : '隐藏'?></td>
|
||||
<td><?=($vo['sort']==''?'未排序':$vo['sort'])?></td>
|
||||
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['menu/update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a> <a class="btn btn-default btn-xs" href="<?=Url::toRoute(['menu/delete','id'=>$vo['id']])?>"><i class="fa fa-close"></i>删除</a></td>
|
||||
</tr>
|
||||
<?php if(!empty($vo['_child'])):?>
|
||||
<?php foreach($vo['_child'] as $v):?>
|
||||
<tr>
|
||||
<td><?=$v['id']?></td>
|
||||
<td><?=$v['name']?></td>
|
||||
<td><?=$v['parent']?></td>
|
||||
<td><?=$v['route']?></td>
|
||||
<td><?=$v['status'] > 0 ? '显示' : '隐藏'?></td>
|
||||
<td><?=($v['sort']==''?'未排序':$v['sort'])?></td>
|
||||
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['menu/update','id'=>$v['id']])?>"><i class="fa fa-edit"></i>编辑</a> <a class="btn btn-default btn-xs" href="<?=Url::toRoute(['menu/delete','id'=>$v['id']])?>"><i class="fa fa-close"></i>删除</a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--分页-->
|
||||
<!--<div class="f-r">
|
||||
<?/*= LinkPager::widget([
|
||||
'pagination'=>$pages,
|
||||
'firstPageLabel' => '首页',
|
||||
'nextPageLabel' => '下一页',
|
||||
'prevPageLabel' => '上一页',
|
||||
'lastPageLabel' => '末页',
|
||||
]) */?>
|
||||
</div>-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\Menu */
|
||||
|
||||
$this->title = '更新菜单: ' . ' ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<hr>
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
'menuArr' => $menuArr,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\Menu */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('创建', ['create'], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('删除', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
'parent',
|
||||
'route',
|
||||
'sort',
|
||||
'data:ntext',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItemChild */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="auth-item-child-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'parent')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'child')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItemChild */
|
||||
|
||||
$this->title = 'Create Auth Item Child';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="auth-item-child-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Auth Item Children';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="auth-item-child-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create Auth Item Child', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'parent',
|
||||
'child',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
Executable
+75
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItemChild */
|
||||
|
||||
$this->title = '配置权限';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<hr>
|
||||
<form action="<?=Url::toRoute(['permission/set','id'=>$id])?>" method="post">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<?php foreach($menu as $vo):?>
|
||||
<div class="col-sm-12 permission-block">
|
||||
<div class="ibox-permission">
|
||||
<h3><?= $vo->name?></h3>
|
||||
<hr>
|
||||
<input name="parent" type="hidden" value="<?=$id?>">
|
||||
<!--<label><input type="checkbox" class="chkall" name="checkall" value="1">全选</label> -->
|
||||
|
||||
<?php foreach($items as $v):?>
|
||||
<?php if($vo['id'] == $v->permissionName['parent']):?>
|
||||
<?php if($id == '超级管理员'):?>
|
||||
<label><input type="checkbox" class="chk" disabled name="permission[]" value="<?=$v->name?>"><?=($v->permissionName['name'] ==''? $v->name : $v->permissionName['name'])?></label>
|
||||
<?php else:?>
|
||||
<label><input type="checkbox" class="chk" name="permission[]" value="<?=$v->name?>"><?=($v->permissionName['name'] ==''? $v->name : $v->permissionName['name'])?></label>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="clear"></div>
|
||||
<input type="submit" value="保存" class="btn btn-primary">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var num = 0;
|
||||
var permission = <?= json_encode($Permission);?>;
|
||||
$('.chk').each(function(){
|
||||
var self = $(this);
|
||||
var selfVal = self.val();
|
||||
$.each(permission, function(n, v){
|
||||
if(v.name == selfVal){
|
||||
self.attr('checked' , 'true');
|
||||
num++;
|
||||
};
|
||||
});
|
||||
});
|
||||
var nums = $('.chk').size(); //全选勾中
|
||||
if(nums == num){
|
||||
$('.chkall').attr("checked",true);
|
||||
}
|
||||
|
||||
$(".chkall").click(function(){
|
||||
var isChecked = $(this).prop("checked");
|
||||
$("input[name='permission[]']").prop("checked", isChecked);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItemChild */
|
||||
|
||||
$this->title = 'Update Auth Item Child: ' . ' ' . $model->parent;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->parent, 'url' => ['view', 'parent' => $model->parent, 'child' => $model->child]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="auth-item-child-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItemChild */
|
||||
|
||||
$this->title = $model->parent;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="auth-item-child-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'parent' => $model->parent, 'child' => $model->child], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['delete', 'parent' => $model->parent, 'child' => $model->child], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'parent',
|
||||
'child',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\bootstrap\Alert;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
$params = Yii::$app->params;
|
||||
|
||||
?>
|
||||
|
||||
<div class="user-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
|
||||
<?php
|
||||
if( Yii::$app->getSession()->hasFlash('error') ) {
|
||||
echo Alert::widget([
|
||||
'options' => [
|
||||
'class' => 'alert alert-danger',
|
||||
],
|
||||
'body' => Yii::$app->getSession()->getFlash('error'),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<?= $form->field($model, 'avatar')->textInput(['value'=>'@web/img/profile_small.png'])->label('头像')?>
|
||||
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'mobile')->textInput(['label' => '']) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
|
||||
$this->title = '新增用户';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="user-create">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<hr/>
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Users';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'username',
|
||||
'auth_key',
|
||||
'password_hash',
|
||||
'password_reset_token',
|
||||
// 'email:email',
|
||||
// 'role',
|
||||
// 'status',
|
||||
// 'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
Executable
+80
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '用户列表';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('user/create')?>">新增用户</a>
|
||||
</div>
|
||||
<div class="col-sm-3 pull-right">
|
||||
<form action="<?=Url::toRoute('user/list')?>" method="post">
|
||||
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
|
||||
<div class="input-group">
|
||||
<input type="text" placeholder="请输入用户名" name="username" class="input-sm form-control"> <span class="input-group-btn">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input type="text" placeholder="请输入手机号" name="mobile" class="input-sm form-control"> <span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>账号</th>
|
||||
<th>联系方式</th>
|
||||
<th>站点</th>
|
||||
<th>授权信息</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach($user as $vo):?>
|
||||
<tr>
|
||||
<td><?=$vo['id']?></td>
|
||||
<td><img src="<?=Url::to($vo['avatar'])?>" alt="" style="width:40px;height:40px;"><?=$vo['username']?></td>
|
||||
<td><?=$vo['mobile']?><br><?=$vo['email']?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><?=$vo['status']?></td>
|
||||
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['user/update','item_name'=>$vo['usergroup']['item_name'],'id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a> <?php if(!in_array($vo['username'],array('publicapi','test'))):?><a href="<?=Url::toRoute(['user/delete','id'=>$vo['id']])?>" class="btn btn-default btn-xs"><i class="fa fa-close"></i>删除</a><?php endif;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--分页-->
|
||||
<div class="f-r">
|
||||
<?= LinkPager::widget([
|
||||
'pagination'=>$pages,
|
||||
'firstPageLabel' => '首页',
|
||||
'nextPageLabel' => '下一页',
|
||||
'prevPageLabel' => '上一页',
|
||||
'lastPageLabel' => '末页',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItem */
|
||||
|
||||
$this->title = '更新用户 ';
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content">
|
||||
<div class="row pd-10">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<hr>
|
||||
<div class="auth-item-form col-sm-4">
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput(['readonly'=>true])->label('账号') ?>
|
||||
|
||||
<?= $form->field($model, 'avatar')->textInput(['placeholder'=>'@web/img/profile_small.png'])->label('头像')?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['placheholder'=>''])->label('邮箱')?>
|
||||
<?= $form->field($model, 'mobile')->textInput(['placheholder'=>''])->label('手机号')?>
|
||||
|
||||
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
|
||||
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
|
||||
|
||||
<?= $form->field($model, 'status')->textInput(['placheholder'=>''])->label('状态码(0~10)')?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
|
||||
$this->title = $model->id;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'username',
|
||||
'auth_key',
|
||||
'password_hash',
|
||||
'password_reset_token',
|
||||
'email:email',
|
||||
'role',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user