parent
272361de34
commit
d0ad489f16
|
@ -3,6 +3,7 @@ package lila.challenge
|
|||
import play.api.libs.json._
|
||||
|
||||
import lila.common.PimpedJson._
|
||||
import lila.socket.UserLagCache
|
||||
|
||||
final class JsonView(
|
||||
getLightUser: lila.common.LightUser.GetterSync,
|
||||
|
@ -67,7 +68,8 @@ final class JsonView(
|
|||
"rating" -> r.rating.int,
|
||||
"provisional" -> r.rating.provisional,
|
||||
"patron" -> light.??(_.isPatron).option(true),
|
||||
"online" -> isOnline(r.id).option(true)
|
||||
"online" -> isOnline(r.id).option(true),
|
||||
"lag" -> UserLagCache.getLagRating(r.id)
|
||||
).noNull
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ export interface ChallengeUser {
|
|||
title?: string
|
||||
online?: boolean
|
||||
patron?: boolean
|
||||
lag?: number
|
||||
}
|
||||
|
||||
export interface TimeControl {
|
||||
|
|
|
@ -136,7 +136,8 @@ function renderUser(u?: ChallengeUser): VNode {
|
|||
class: { online: !!u.online }
|
||||
}, [
|
||||
h('i.line' + (u.patron ? '.patron' : '')),
|
||||
h('name', (u.title ? u.title + ' ' : '') + u.name + ' (' + rating + ')')
|
||||
h('name', (u.title ? u.title + ' ' : '') + u.name + ' (' + rating + ') '),
|
||||
h('signal', Array.apply(null, {length: u.lag || 0}).map(() => h('i')))
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue