mirror of https://github.com/Chocobozzz/PeerTube
Adapt requests controller/front to new informations
parent
c625a9560b
commit
872a4c7cea
|
@ -1,23 +1,33 @@
|
|||
<h3>Requests stats</h3>
|
||||
|
||||
<div *ngIf="stats !== null">
|
||||
<div>
|
||||
<span class="label-description">Interval seconds between requests:</span>
|
||||
{{ stats.secondsInterval }}
|
||||
<div class="requests-general">
|
||||
<div>
|
||||
<span class="label-description">Remaining requests:</span>
|
||||
{{ stats.totalRequests }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="label-description">Interval seconds between requests:</span>
|
||||
{{ stats.secondsInterval }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="label-description">Remaining time before the scheduled request:</span>
|
||||
{{ stats.remainingSeconds }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="label-description">Remaining time before the scheduled request:</span>
|
||||
{{ stats.remainingSeconds }}
|
||||
<div class="requests-limit">
|
||||
<div>
|
||||
<span class="label-description">Maximum number of different pods for a scheduled request:</span>
|
||||
{{ stats.requestsLimitPods }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="label-description">Maximum number of requests per pod for a scheduled request:</span>
|
||||
{{ stats.requestsLimitPerPod }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="label-description">Maximum number of requests per interval:</span>
|
||||
{{ stats.maxRequestsInParallel }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="label-description">Remaining requests:</span>
|
||||
{{ stats.totalRequests }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
.label-description {
|
||||
display: inline-block;
|
||||
width: 350px;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.requests-general {
|
||||
.label-description {
|
||||
width: 320px;
|
||||
}
|
||||
}
|
||||
|
||||
.requests-limit {
|
||||
margin-top: 20px;
|
||||
|
||||
.label-description {
|
||||
width: 430px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ export class RequestStatsComponent implements OnInit, OnDestroy {
|
|||
|
||||
ngOnInit() {
|
||||
this.getStats();
|
||||
this.runInterval();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@ -27,10 +28,7 @@ export class RequestStatsComponent implements OnInit, OnDestroy {
|
|||
|
||||
getStats() {
|
||||
this.requestService.getStats().subscribe(
|
||||
stats => {
|
||||
this.stats = stats;
|
||||
this.runInterval();
|
||||
},
|
||||
stats => this.stats = stats,
|
||||
|
||||
err => alert(err.text)
|
||||
);
|
||||
|
@ -42,7 +40,6 @@ export class RequestStatsComponent implements OnInit, OnDestroy {
|
|||
|
||||
if (this.stats.remainingMilliSeconds <= 0) {
|
||||
setTimeout(() => this.getStats(), this.stats.remainingMilliSeconds + 100);
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
|
|
@ -4,18 +4,21 @@ export interface Request {
|
|||
}
|
||||
|
||||
export class RequestStats {
|
||||
maxRequestsInParallel: number;
|
||||
requestsLimitPods: number;
|
||||
requestsLimitPerPod: number;
|
||||
milliSecondsInterval: number;
|
||||
remainingMilliSeconds: number;
|
||||
totalRequests: number;
|
||||
|
||||
constructor(hash: {
|
||||
maxRequestsInParallel: number,
|
||||
requestsLimitPods: number,
|
||||
requestsLimitPerPod: number,
|
||||
milliSecondsInterval: number,
|
||||
remainingMilliSeconds: number,
|
||||
totalRequests: number;
|
||||
}) {
|
||||
this.maxRequestsInParallel = hash.maxRequestsInParallel;
|
||||
this.requestsLimitPods = hash.requestsLimitPods;
|
||||
this.requestsLimitPerPod = hash.requestsLimitPerPod;
|
||||
this.milliSecondsInterval = hash.milliSecondsInterval;
|
||||
this.remainingMilliSeconds = hash.remainingMilliSeconds;
|
||||
this.totalRequests = hash.totalRequests;
|
||||
|
|
|
@ -28,7 +28,8 @@ function getStatsRequests (req, res, next) {
|
|||
|
||||
return res.json({
|
||||
totalRequests: totalRequests,
|
||||
maxRequestsInParallel: constants.REQUESTS_IN_PARALLEL,
|
||||
requestsLimitPods: constants.REQUESTS_LIMIT_PODS,
|
||||
requestsLimitPerPod: constants.REQUESTS_LIMIT_PER_POD,
|
||||
remainingMilliSeconds: db.Request.remainingMilliSeconds(),
|
||||
milliSecondsInterval: constants.REQUESTS_INTERVAL
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue