Skip to content

Commit

Permalink
prettify file size (fixes #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashinsch committed Apr 13, 2016
1 parent 00d16f3 commit 071ddfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.2.10
- Set content type in log response (fixes [#21](https://github.com/lukashinsch/spring-boot-actuator-logview/issues/21))
- Prettify file size display (fixes [#23](https://github.com/lukashinsch/spring-boot-actuator-logview/issues/23))

## 0.2.9
- Add configuration option to override stylesheet urls (fixes [#20](https://github.com/lukashinsch/spring-boot-actuator-logview/issues/20))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package eu.hinsch.spring.boot.actuator.logview;

import org.apache.commons.io.FileUtils;

import java.nio.file.attribute.FileTime;

/**
Expand Down Expand Up @@ -60,4 +62,9 @@ public void setDisplayFilename(String displayFilename) {
public String getDisplayFilename() {
return displayFilename;
}

public String getSizePretty() {
return FileUtils.byteCountToDisplaySize(size);
}

}
2 changes: 1 addition & 1 deletion lib/src/main/resources/templates/logview.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</td>
<td>
<#if file.fileType != 'DIRECTORY'>
${file.size}
${file.sizePretty}
</#if>
</td>
<td title="${file.modified}">${file.modifiedPretty}</td>
Expand Down

0 comments on commit 071ddfd

Please sign in to comment.