From a056ca4813c82f490dcd31ac97a64d6bf76d3dcc Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Wed, 28 Oct 2020 15:24:40 +0100
Subject: Add max lives limit

---
 .../shared-instance/instance-features-table.component.html |  7 +++++++
 .../shared-instance/instance-features-table.component.ts   | 14 ++++++++++++++
 2 files changed, 21 insertions(+)

(limited to 'client/src/app/shared')

diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.html b/client/src/app/shared/shared-instance/instance-features-table.component.html
index 002695238..ce2557147 100644
--- a/client/src/app/shared/shared-instance/instance-features-table.component.html
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.html
@@ -81,6 +81,13 @@
       </td>
     </tr>
 
+    <tr>
+      <th i18n class="sub-label" scope="row">Max parallel lives</th>
+      <td i18n>
+        {{ maxUserLives }} per user / {{ maxInstanceLives }} per instance
+      </td>
+    </tr>
+
     <tr>
       <th i18n class="label" colspan="2">Import</th>
     </tr>
diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.ts b/client/src/app/shared/shared-instance/instance-features-table.component.ts
index 76b595c20..0166157f9 100644
--- a/client/src/app/shared/shared-instance/instance-features-table.component.ts
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.ts
@@ -21,6 +21,20 @@ export class InstanceFeaturesTableComponent implements OnInit {
     return Math.min(this.initialUserVideoQuota, this.serverConfig.user.videoQuotaDaily)
   }
 
+  get maxInstanceLives () {
+    const value = this.serverConfig.live.maxInstanceLives
+    if (value === -1) return $localize`Unlimited`
+
+    return value
+  }
+
+  get maxUserLives () {
+    const value = this.serverConfig.live.maxUserLives
+    if (value === -1) return $localize`Unlimited`
+
+    return value
+  }
+
   ngOnInit () {
     this.serverConfig = this.serverService.getTmpConfig()
     this.serverService.getConfig()
-- 
cgit v1.2.3