]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Adapt requests controller/front to new informations
authorChocobozzz <florian.bigard@gmail.com>
Thu, 19 Jan 2017 21:38:34 +0000 (22:38 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Thu, 19 Jan 2017 21:38:34 +0000 (22:38 +0100)
client/src/app/admin/requests/request-stats/request-stats.component.html
client/src/app/admin/requests/request-stats/request-stats.component.scss
client/src/app/admin/requests/request-stats/request-stats.component.ts
client/src/app/admin/requests/shared/request-stats.model.ts
server/controllers/api/requests.js

index 6698eac48c958dc2f993174dd66996253ac8ff36..9dbed17391ff4b71e3ec2aeb0ef9025ce0d5884c 100644 (file)
@@ -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>
+  <div class="requests-general">
+    <div>
+      <span class="label-description">Remaining requests:</span>
+      {{ stats.totalRequests }}
+    </div>
 
-  <div>
-    <span class="label-description">Remaining time before the scheduled request:</span>
-    {{ stats.remainingSeconds }}
-  </div>
+    <div>
+      <span class="label-description">Interval seconds between requests:</span>
+      {{ stats.secondsInterval }}
+    </div>
 
-  <div>
-    <span class="label-description">Maximum number of requests per interval:</span>
-    {{ stats.maxRequestsInParallel }}
+    <div>
+      <span class="label-description">Remaining time before the scheduled request:</span>
+      {{ stats.remainingSeconds }}
+    </div>
   </div>
 
-  <div>
-    <span class="label-description">Remaining requests:</span>
-    {{ stats.totalRequests }}
+  <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>
index 92c28dc99521bca903cc02286a44570d471d3890..9c68fba9900487d65866d2b138058c4bfbd5f230 100644 (file)
@@ -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;
+  }
+}
index 66075e4b5e7d0e24e122ca6e4badb7867cb56397..23b8367792329efe36696bbb38480a36c93bf622 100644 (file)
@@ -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);
   }
index 49ecbc79e868494851b328c755491d17baaf8c1d..f658c468260e10ca0b5cfe2387e40b6d627a82a5 100644 (file)
@@ -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;
index 1f9193fc87fd56ea2b23ac7010d77539ce436bd8..3e0d246d1ef882102d000f8250bd47719f5fdb6e 100644 (file)
@@ -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
     })