mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
add file size to log file view
This commit is contained in:
parent
b1bb295d57
commit
f5e3755c51
@ -1,5 +1,6 @@
|
||||
var async = require('async')
|
||||
var fs = require('fs.extra')
|
||||
var filesize = require('filesize')
|
||||
var path = require('path')
|
||||
var userhome = require('userhome')
|
||||
|
||||
@ -62,6 +63,7 @@ Logs.prototype.logFiles = function (callback) {
|
||||
|
||||
async.filter(files, function (file, cb) {
|
||||
fs.stat(file.path, function (err, stat) {
|
||||
file.formattedSize = filesize(stat.size)
|
||||
file.size = stat.size
|
||||
cb(!err && stat.isFile())
|
||||
})
|
||||
|
@ -8,7 +8,9 @@ define(function (require) {
|
||||
|
||||
return Backbone.Model.extend({
|
||||
defaults: {
|
||||
name: ''
|
||||
name: '',
|
||||
formattedSize: '0 B',
|
||||
size: 0,
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Log</th>
|
||||
<th width="100%">Filename</th>
|
||||
<th>Size</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
<td style="width: 100%;">
|
||||
<td>
|
||||
<a href='/api/logs/<%-name%>'><%-name%></a>
|
||||
</td>
|
||||
<td style="text-align: right; white-space: nowrap;">
|
||||
<%-formattedSize%>
|
||||
</td>
|
||||
|
Loading…
Reference in New Issue
Block a user