]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts
Add MANAGE_PEERTUBE_FOLLOW right
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / request-schedulers / shared / request-schedulers-stats-attributes.model.ts
1 import { RequestSchedulerStatsAttributes as FormattedRequestSchedulerStatsAttributes } from '../../../../../../shared'
2
3 export interface Request {
4 request: any
5 to: any
6 }
7
8 export class RequestSchedulerStatsAttributes implements FormattedRequestSchedulerStatsAttributes {
9 requestsLimitPods: number
10 requestsLimitPerPod: number
11 milliSecondsInterval: number
12 remainingMilliSeconds: number
13 totalRequests: number
14
15 constructor (hash: {
16 requestsLimitPods: number,
17 requestsLimitPerPod: number,
18 milliSecondsInterval: number,
19 remainingMilliSeconds: number,
20 totalRequests: number
21 }) {
22 this.requestsLimitPods = hash.requestsLimitPods
23 this.requestsLimitPerPod = hash.requestsLimitPerPod
24 this.milliSecondsInterval = hash.milliSecondsInterval
25 this.remainingMilliSeconds = hash.remainingMilliSeconds
26 this.totalRequests = hash.totalRequests
27 }
28
29 get remainingSeconds () {
30 return Math.floor(this.remainingMilliSeconds / 1000)
31 }
32
33 get secondsInterva () {
34 return Math.floor(this.milliSecondsInterval / 1000)
35 }
36
37 }