Fixed negative strings.Repeat value
This commit is contained in:
parent
92a1d33698
commit
7fb6eb0a50
@ -6,7 +6,7 @@ sidebar-spacing-y = 0.7rem
|
|||||||
left 0
|
left 0
|
||||||
top 0
|
top 0
|
||||||
z-index 10
|
z-index 10
|
||||||
min-width 250px
|
width 60vw
|
||||||
height 100%
|
height 100%
|
||||||
background sidebar-opaque-background
|
background sidebar-opaque-background
|
||||||
transform translateX(-100%)
|
transform translateX(-100%)
|
||||||
@ -27,7 +27,7 @@ sidebar-spacing-y = 0.7rem
|
|||||||
> 800px
|
> 800px
|
||||||
#sidebar
|
#sidebar
|
||||||
opacity 1
|
opacity 1
|
||||||
min-width 180px
|
width 180px
|
||||||
transform none
|
transform none
|
||||||
position static
|
position static
|
||||||
pointer-events auto
|
pointer-events auto
|
||||||
@ -37,7 +37,7 @@ sidebar-spacing-y = 0.7rem
|
|||||||
|
|
||||||
> 1400px
|
> 1400px
|
||||||
#sidebar
|
#sidebar
|
||||||
min-width 200px
|
width 200px
|
||||||
|
|
||||||
.sidebar-visible
|
.sidebar-visible
|
||||||
transform translateX(0) !important
|
transform translateX(0) !important
|
||||||
|
@ -37,7 +37,13 @@ func Log() aero.Middleware {
|
|||||||
// Logs a single request
|
// Logs a single request
|
||||||
func logRequest(ctx *aero.Context, responseTime time.Duration) {
|
func logRequest(ctx *aero.Context, responseTime time.Duration) {
|
||||||
responseTimeString := strconv.Itoa(int(responseTime.Nanoseconds()/1000000)) + " ms"
|
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)
|
user := utils.GetUser(ctx)
|
||||||
ip := ctx.RealIP()
|
ip := ctx.RealIP()
|
||||||
|
Loading…
Reference in New Issue
Block a user