Merge pull request #356 from FirmlyReality/master

Fix some bugs on history.html and imagemgr
This commit is contained in:
Yujian Zhu 2018-11-22 00:01:06 +08:00 committed by GitHub
commit 198a601eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View File

@ -387,10 +387,10 @@ class ImageMgr():
if imagename == "base" and imagetype == "base":
return 0
if imagetype == "private":
imgpath = self.imgpath + "private/" + user + "/"
imgpath = self.imgpath + "private/" + imageowner + "/"
else:
imgpath = self.imgpath + "public/" + imageowner + "/"
return os.stat(os.path.join(imgpath, imagename)).st_size // (1024*1024)
return os.stat(os.path.join(imgpath, imagename+".tz")).st_size // (1024*1024)
def format_size(self, size_in_byte):

View File

@ -32,8 +32,8 @@
</div>
</div>
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-bordered table-hover table-image" >
<div class="table">
<table width="100%" cellspacing="0" style="margin:0 auto;" class="table table-striped table-bordered table-hover table-history" >
<thead>
<tr>
<th>NO</th>
@ -65,17 +65,14 @@
{% endblock %}
{% block script_src %}
<script src="//cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/datatables/1.10.11/js/jquery.dataTables.js"></script>
<script src="http://cdn.bootcss.com/datatables/1.10.11/js/dataTables.bootstrap.js"></script>
<script src="http://cdn.bootcss.com/datatables-tabletools/2.1.5/js/TableTools.min.js"></script>
<script src="//cdn.bootcss.com/datatables/1.10.11/js/jquery.dataTables.min.js"></script>
<script src="//cdn.bootcss.com/datatables/1.10.11/js/dataTables.bootstrap.min.js"></script>
<script>
$(document).ready(function() {
$(".table-image").DataTable();
$(".table-history").DataTable({"scrollX":true});
});
</script>
{% endblock %}