2019-01-18 14:33:54 +08:00
|
|
|
|
{extend name="public:base" /}
|
|
|
|
|
{block name="menu"}数据字段{/block}
|
|
|
|
|
{block name="table-head"}
|
|
|
|
|
<tr>
|
|
|
|
|
<th>表名</th>
|
|
|
|
|
<th>引擎</th>
|
|
|
|
|
<th>字符集</th>
|
|
|
|
|
<th>索引大小</th>
|
|
|
|
|
<th>数据大小</th>
|
|
|
|
|
<th>行数</th>
|
|
|
|
|
<th>备注</th>
|
|
|
|
|
<th>创建时间</th>
|
|
|
|
|
<th>操作</th>
|
|
|
|
|
</tr>
|
|
|
|
|
{/block}
|
|
|
|
|
{block name="table-body"}
|
|
|
|
|
{if condition="!count($tables)"}
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="7" class="text-center">没有数据</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{else/}
|
|
|
|
|
{foreach $tables as $key => $table}
|
|
|
|
|
<tr>
|
|
|
|
|
<td>{$table['Name']}</td>
|
|
|
|
|
<td>{$table['Engine']}</td>
|
|
|
|
|
<td>{$table['Collation']}</td>
|
|
|
|
|
<td>{$table['Index_length']}</td>
|
|
|
|
|
<td>{$table['Data_length']}</td>
|
|
|
|
|
<td>{$table['Rows']}</td>
|
|
|
|
|
<td>{$table['Comment']}</td>
|
|
|
|
|
<td>{$table['Create_time']}</td>
|
|
|
|
|
<td>
|
2019-01-18 15:03:30 +08:00
|
|
|
|
<button class="btn btn-info btn-xs" type="button" data="{$table['Name']}" onclick="optimize($(this).attr('data'));"><i class="fa fa-paper-plane-o"></i>优化</button>
|
|
|
|
|
<button class="btn btn-primary btn-xs" type="button" data="{:url('database/view', ['table' => $table['Name']])}" onclick="view($(this).attr('data'));"><i class="fa fa-eye"></i>查看</button>
|
2019-01-18 14:33:54 +08:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{/foreach}
|
|
|
|
|
{/if}
|
|
|
|
|
{/block}
|
|
|
|
|
{block name="js"}
|
|
|
|
|
<script>
|
|
|
|
|
// 优化
|
|
|
|
|
function optimize(table) {
|
|
|
|
|
$.post("{:url('database/optimize')}", {table: table}, function (response) {
|
|
|
|
|
if (!response.code) {
|
|
|
|
|
error(response.msg);
|
|
|
|
|
} else {
|
|
|
|
|
success(response.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 查看数据表结构
|
|
|
|
|
function view(url) {
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: '数据表结构',
|
|
|
|
|
closeBtn: 1, //不显示关闭按钮
|
|
|
|
|
area: ['800px', '600px'],
|
|
|
|
|
content: url, //iframe的url,no代表不显示滚动条
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
{/block}
|