Skip to content

Commit

Permalink
Unescape the ascii code for the plus sympol
Browse files Browse the repository at this point in the history
  • Loading branch information
Young Lee committed Sep 27, 2017
1 parent ec4d3d7 commit 8a9c52d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions volume/status.go
Expand Up @@ -303,13 +303,13 @@ Volume Path: {{.DriverPath}}
Thin Pool
---------
Logical Volume: {{.PoolName}}
Metadata (total/used/avail): {{bytes .PoolMetadataTotal}} / {{bytes .PoolMetadataUsed}} ({{percent .PoolMetadataUsed .PoolMetadataTotal}}) / {{bytes .PoolMetadataAvailable}} ({{percent .PoolMetadataAvailable .PoolMetadataTotal}})
Data (total/used/avail): {{bytes .PoolDataTotal}} / {{bytes .PoolDataUsed}} ({{percent .PoolDataUsed .PoolDataTotal}}) / {{bytes .PoolDataAvailable}} ({{percent .PoolDataAvailable .PoolDataTotal}})
Metadata (total/used/avail): {{bytes .PoolMetadataTotal}} / {{bytes .PoolMetadataUsed}} ({{percent .PoolMetadataUsed .PoolMetadataTotal | noescape}}) / {{bytes .PoolMetadataAvailable}} ({{percent .PoolMetadataAvailable .PoolMetadataTotal | noescape}})
Data (total/used/avail): {{bytes .PoolDataTotal}} / {{bytes .PoolDataUsed}} ({{percent .PoolDataUsed .PoolDataTotal | noescape}}) / {{bytes .PoolDataAvailable}} ({{percent .PoolDataAvailable .PoolDataTotal | noescape}})
{{with $parent := .}}{{range .Tenants}}
{{.TenantID}} Application Data
-----------------------------------------
Volume Mount Point: {{.VolumePath}}
Filesystem (total/used/avail): {{bytes .FilesystemTotal}} / {{bytes .FilesystemUsed}} ({{percent .FilesystemUsed .FilesystemTotal}}) / {{bytes .FilesystemAvailable}} ({{percent .FilesystemAvailable .FilesystemTotal}})
Filesystem (total/used/avail): {{bytes .FilesystemTotal}} / {{bytes .FilesystemUsed}} ({{percent .FilesystemUsed .FilesystemTotal | noescape}}) / {{bytes .FilesystemAvailable}} ({{percent .FilesystemAvailable .FilesystemTotal | noescape}})
Virtual device size: {{blocksToBytes .DeviceTotalBlocks}}
{{range .Errors}}
{{.}}
Expand All @@ -326,6 +326,7 @@ var funcMap = template.FuncMap{
"blocksToBytes": BlocksToBytes,
"bytesToBlocks": BytesToBlocks,
"percent": Percent,
"noescape": Noescape,
}

func (s DeviceMapperStatus) String() string {
Expand Down
4 changes: 4 additions & 0 deletions volume/utils.go
Expand Up @@ -24,6 +24,7 @@ import (
"sort"
"strings"
"syscall"
"html/template"

"github.com/docker/go-units"
"github.com/zenoss/glog"
Expand Down Expand Up @@ -170,3 +171,6 @@ func Percent(amt, total uint64) string {
func BytesToBlocks(bytes uint64) uint64 {
return bytes / blockSize
}
func Noescape(s string) template.HTML {
return template.HTML(s)
}

0 comments on commit 8a9c52d

Please sign in to comment.