mirror of https://github.com/IoTcat/PyOne.git
parent
2ad8054bac
commit
09320ab27c
7 changed files with 146 additions and 12 deletions
@ -0,0 +1,41 @@ |
||||
{%extends 'admin/layout.html'%} |
||||
|
||||
{%block content%} |
||||
<div class="mdui-container-fluid"> |
||||
<div class="mdui-typo"> |
||||
<h1> 网盘管理 <small>添加网盘/删除网盘/编辑网盘</small></h1> |
||||
</div> |
||||
<div class="mdui-row"> |
||||
<div class="mdui-col-xs-2"> |
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple" onclick="window.location.href='{{url_for("admin.add_pan")}}'">添加盘位</button> |
||||
</div> |
||||
<div class="mdui-col-xs-2"> |
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent" onclick="window.location.href='{{url_for("admin.rm_pan")}}'">删除网盘</button> |
||||
</div> |
||||
<div class="mdui-col-xs-8"></div> |
||||
</div> |
||||
<form action="{{url_for('admin.panage')}}" method="POST"> |
||||
<div class="mdui-textfield"> |
||||
<h4>网盘信息编辑</h4> |
||||
{%for user in get_od_user()%} |
||||
{%if user[1]!='添加网盘'%} |
||||
<div class="mdui-panel" mdui-panel> |
||||
<div class="mdui-panel-item"> |
||||
<div class="mdui-panel-item-header">{{user[1]}}</div> |
||||
<div class="mdui-panel-item-body"> |
||||
<h5>显示名称</h5> |
||||
<input class="mdui-textfield-input" type="text" name="other_name[{{user[0]}}]" placeholder="请输入显示名称" value="{{user[1]}}" /> |
||||
<h5>分享目录</h5> |
||||
<input class="mdui-textfield-input" type="text" name="share_path[{{user[0]}}]" placeholder="请输入分享目录" value="{{user[3]}}" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{%endif%} |
||||
{%endfor%} |
||||
</div> |
||||
<button type="submit" class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-float-right"> |
||||
<i class="mdui-icon material-icons"></i> 保存 |
||||
</button> |
||||
</form> |
||||
</div> |
||||
{%endblock content%} |
@ -0,0 +1,55 @@ |
||||
{%extends 'admin/layout.html'%} |
||||
{%block content%} |
||||
<div class="mdui-container-fluid"> |
||||
<div class="mdui-typo"> |
||||
<h1>删除网盘 <small>谨慎操作!</small></h1> |
||||
</div> |
||||
<div class="mdui-table-fluid"> |
||||
<table class="mdui-table mdui-table-hoverable"> |
||||
<thead> |
||||
<tr> |
||||
<th>删除</th> |
||||
<th>盘符</th> |
||||
<th>网盘名称</th> |
||||
<th>共享目录</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{%for user in get_od_user()%} |
||||
<tr> |
||||
<td><i class="mdui-list-item-icon mdui-icon material-icons" onclick="rmPan('{{user[0]}}')">delete</i></td> |
||||
<td>{{user[0]}}</td> |
||||
<td>{{user[1]}}</td> |
||||
<td>{{user[3]}}</td> |
||||
</tr> |
||||
{%endfor%} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
function rmPan(pan){ |
||||
if (!confirm("确定删除?")) { |
||||
return; |
||||
} |
||||
$.ajax({ |
||||
type: "POST", |
||||
url: "{{url_for('admin.rm_pan')}}", |
||||
dataType: 'json', |
||||
data: {user:pan}, |
||||
beforeSend: function(xhr) { |
||||
var index = layer.load(2, { |
||||
shade: [0.1, '#fff'] //0.1透明度的白色背景 |
||||
}); |
||||
}, |
||||
success: function(result) { |
||||
alert(result.msg); |
||||
window.location.reload(); |
||||
}, |
||||
complete: function(xhr) { |
||||
$('#layui-layer-shade1').remove(); |
||||
} |
||||
}); |
||||
} |
||||
</script> |
||||
{%endblock content%} |
Loading…
Reference in new issue