kritbit

kritbit Commit Details


Date:2015-12-15 22:17:40 (9 years 6 days ago)
Author:Natalie Adams
Branch:master
Commit:d953a5b40b768b0ca316507cafbde69c9da78966
Parents: 93fede2acff94764c1bebfbf68b7807c24674931
Message:Adding size display on history list

Changes:

File differences

web/application/models/histories.php
2121
2222
2323
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
2442
return "danger";
}
}
private function formatBytes($bytes, $precision = 2) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
// Uncomment one of the following alternatives
// $bytes /= pow(1024, $pow);
// $bytes /= (1 << (10 * $pow));
return round($bytes, $precision) . ' ' . $units[$pow];
}
public function getSize() {
return $this->formatBytes(strlen($this->output));
}
}
web/application/views/history.html
3838
3939
4040
41
4142
4243
4344
......
5253
5354
5455
56
5557
5658
5759
<th>Run Date</th>
<th>Time Taken</th>
<th>Result</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<td>{{history.run_date}}</td>
<td>{{history.time_taken}}</td>
<td>{{history.result}}</td>
<td>{{history.getSize}}</td>
</tr>
{% endfor %}
</tbody>

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05475s using 14 queries.