Fixed negative strings.Repeat value

This commit is contained in:
Eduard Urbach 2017-11-29 19:23:14 +01:00
parent 92a1d33698
commit 7fb6eb0a50
2 changed files with 10 additions and 4 deletions

View File

@ -6,7 +6,7 @@ sidebar-spacing-y = 0.7rem
left 0
top 0
z-index 10
min-width 250px
width 60vw
height 100%
background sidebar-opaque-background
transform translateX(-100%)
@ -27,7 +27,7 @@ sidebar-spacing-y = 0.7rem
> 800px
#sidebar
opacity 1
min-width 180px
width 180px
transform none
position static
pointer-events auto
@ -37,7 +37,7 @@ sidebar-spacing-y = 0.7rem
> 1400px
#sidebar
min-width 200px
width 200px
.sidebar-visible
transform translateX(0) !important

View File

@ -37,7 +37,13 @@ func Log() aero.Middleware {
// Logs a single request
func logRequest(ctx *aero.Context, responseTime time.Duration) {
responseTimeString := strconv.Itoa(int(responseTime.Nanoseconds()/1000000)) + " ms"
responseTimeString = strings.Repeat(" ", 8-len(responseTimeString)) + responseTimeString
repeatSpaceCount := 8 - len(responseTimeString)
if repeatSpaceCount < 0 {
repeatSpaceCount = 0
}
responseTimeString = strings.Repeat(" ", repeatSpaceCount) + responseTimeString
user := utils.GetUser(ctx)
ip := ctx.RealIP()