@model string
<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">数据库备份</a></li>
        <li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>
    </ul>
</div>
<div class="main">
    <form class="form-horizontal form ui-validForm" action="@Url.Action()" method="post">
        <div class="control-group">
            <label class="control-label">使用的数据库</label>
            <div class="controls form-inline form-group-sm">
                <input type="text" value="@ViewBag.DBName" readonly class="form-control" maxlength="50" id="name" name="name" data-validate="dataType:'*" nullMsg:'请填写采集名称!" style="width:50%" />
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">数据库类型</label>
            <div class="controls form-inline form-group-sm">
                <input type="text" value="@ViewBag.DBType" readonly class="form-control" maxlength="30" data-validate="dataType:'s1-40" nullMsg:'请填写采集类型！" id="type" name="type" style="width:50%" />
                <span class="help-block"></span>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">备份保存路径</label>
            <div class="controls form-inline">
                <input name="path" type="text" maxlength="50" value="@ViewBag.Path" readonly class="form-control" id="path" style="width:50%" />
                <span class="help-block"></span>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls form-inline">
                <button type="button" class="btn btn-primary btn-sm ui-pagePost"  data-custom-params="url:'@Url.Action("Backups")',callBack:'CallBack'">备份数据</button>
                <button type="button" class="btn btn-default btn-sm ui-closeDialog" id="clearLog"  data-custom-params="url:'@Url.Action("ClearLog")'">清理sql日志</button>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="clearfix"><span class="help-block"></span></div>
    </form>
    <table border=0 cellpadding=0 cellspacing=0 align="center" class="table table-bordered" id="tb_list">
        <thead>
            <tr>
                <td width=15% nawrap align="center">文件类型</td>
                <td width=35% nawrap align="center">备份保存路径</td>
                <td width=15% nawrap align="center">文件大小</td>
                <td width=20% nawrap align="center">备份时间</td>
                <td width=15% nawrap align="center">操作</td>
            </tr>
        </thead>
            <tr class="item" id="item_{id}">
                <td align="center">{Type}</td>
                <td align="center">{Name}</td>
                <td align="center">{Length}</td>
                <td align="center">{CreationTime}</td>
                <td align="center">
                    <div class="btn-group btn-group-sm">
                        <a href="javascript:void(0)" class="btn btn-default btn-sm ui-deleteSingle" data-custom-params="url:'@Url.Action("Delete")',addParams:'backupPath={Name}&type={Type}'">删除</a>
                    </div>
                </td>
            </tr>
</table>
</div>
<script type="text/javascript">
    //绑定数据
    function LoadData()
    {
        var url = "@Url.Action("ListData")";
        $("#tb_list").ListBind(url, {callBack: "LoadedInit" });
    }
    LoadData();



    $(function () {
        if("@ViewBag.DBType"=="Access")
        {
            $("#clearLog").css({"display":"none"})
        }

    })
</script>