{include file="public/header" /}
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" id="LAY-user">
			<blockquote class="layui-elem-quote">
				<p style="color:red">微软OneDrive网盘，分为国际版和国内（世纪互联）版，需要有API权限的账号才支持解析，没有API权限的，不支持解析，请按教程说明添加账号</p>
			</blockquote>
            <div>		
				<div class="layui-form-item">
					<div class="layui-inline">
						<button class="layui-btn" style="width:100%" data-type="add" onclick="wk.layer_show('添加账号','{:url('userAdd')}')"><i class="fa fa-plus"></i> 添加账号</button>
					</div>
				</div>
            </div>
        </div>

        <div class="layui-card-body">
            <table id="LAY-table-manage" lay-filter="LAY-table-manage"></table>
			<!--账号模板-->
            <script type="text/html" id="userBar">
				<a lay-href="{:url('panList')}?id={{d.id}}" class="layui-btn layui-btn-xs" title="点击进入管理网盘文件" >【{{# if(d.panType == '1'){ }}国际版{{# }else{ }}世纪互联版{{# } }}】{{d.username}}</a>
            </script>
			<!--操作模板-->
            <script type="text/html" id="opeBar">
				<a class="layui-btn layui-btn-xs" title="编辑" onclick="wk.layer_show('编辑账号','{:url('userEdit')}?id={{d.id}}')"><i class="fa fa-pencil"></i></a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" title="删除" onclick="wk.confirm('{{d.id}}','{:url('userDel')}','删除后该账号生成的外链数据均会同步删除，请谨慎确认是否删除？')"><i class="fa fa-trash-o"></i></a>
            </script>			
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['index', 'table'], function () {
        var $ = layui.$
            , form = layui.form
            , table = layui.table;
        table.render({
            elem: '#LAY-table-manage'
            , url: '{:url("userList")}'
            , page: true
            , even: false 
            , size: 'lg' 
            , autoSort: false
            , cellMinWidth: 150
            , limits: [10, 20, 30, 40, 50]
            , limit: "15"
            , loading: true
            , id: 'LAY-table'
            , cols: [[
                {type: 'checkbox', fixed: 'left'}
                , {field: 'username', minwidth: 250, title: '网盘账号', align: 'center', toolbar: '#userBar'}
                , {field: 'beizhu', minWidth: 200, title: '备注', edit:'text', align: 'center'}
                , {field: 'time', width: 200, title: '更新时间', align: 'center'}				
                , {fixed: 'right', width: 100, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.layui-circle').viewer({
                    url: 'data-original',
                });
				if(count==0 && res.code==0){
					layer.alert('您还未添加过账号，请先点击添加账号',{icon:0});
				}
            }
        });
    });
</script>
</body>
</html>