]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
Small edit config refactor
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-live-configuration.component.html
index 4b1a55245bc2af50eca437be64ec85dea204d0c9..65fc314122d6e8befa51549b81c018d03371e352 100644 (file)
@@ -25,7 +25,7 @@
 
             <ng-container ngProjectAs="extra">
 
-              <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+              <div class="form-group" [ngClass]="getDisabledLiveClass()">
                 <my-peertube-checkbox
                   inputName="liveAllowReplay" formControlName="allowReplay"
                   i18n-labelText labelText="Allow your users to automatically publish a replay of their live"
                 </my-peertube-checkbox>
               </div>
 
-              <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
-                <label i18n for="liveMaxInstanceLives">Max simultaneous lives created on your instance <span class="text-muted">(-1 for "unlimited")</span></label>
+              <div class="form-group" [ngClass]="getDisabledLiveClass()">
+                <label i18n for="liveMaxInstanceLives">
+                  Max simultaneous lives created on your instance <span class="text-muted">(-1 for "unlimited")</span>
+                </label>
+
                 <div class="number-with-unit">
                   <input type="number" name="liveMaxInstanceLives" formControlName="maxInstanceLives" />
                   <span i18n>{form.value['live']['maxInstanceLives'], plural, =1 {live} other {lives}}</span>
                 </div>
               </div>
 
-              <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
-                <label i18n for="liveMaxUserLives">Max simultaneous lives created per user <span class="text-muted">(-1 for "unlimited")</span></label>
+              <div class="form-group" [ngClass]="getDisabledLiveClass()">
+                <label i18n for="liveMaxUserLives">
+                  Max simultaneous lives created per user <span class="text-muted">(-1 for "unlimited")</span>
+                </label>
+
                 <div class="number-with-unit">
                   <input type="number" name="liveMaxUserLives" formControlName="maxUserLives" />
                   <span i18n>{form.value['live']['maxUserLives'], plural, =1 {live} other {lives}}</span>
                 </div>
               </div>
 
-              <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+              <div class="form-group" [ngClass]="getDisabledLiveClass()">
                 <label i18n for="liveMaxDuration">Max live duration</label>
 
                 <my-select-options
@@ -81,7 +87,7 @@
       <ng-container formGroupName="live">
         <ng-container formGroupName="transcoding">
 
-          <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+          <div class="form-group" [ngClass]="getDisabledLiveClass()">
             <my-peertube-checkbox
               inputName="liveTranscodingEnabled" formControlName="enabled"
             >
             </my-peertube-checkbox>
           </div>
 
-          <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+          <div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()">
             <label i18n for="liveTranscodingThreads">Live resolutions to generate</label>
 
             <div class="ml-2 mt-2 d-flex flex-column">
               <ng-container formGroupName="resolutions">
+
                 <div class="form-group" *ngFor="let resolution of liveResolutions">
                   <my-peertube-checkbox
                     [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
                     </ng-template>
                   </my-peertube-checkbox>
                 </div>
+
               </ng-container>
             </div>
           </div>
 
-          <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+          <div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()">
             <label i18n for="liveTranscodingThreads">Live transcoding threads</label>
+
             <span class="text-muted ml-1">
-              <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n>will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding</ng-container>
-              <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n>will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding</ng-container>
+              <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n>
+                will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding
+              </ng-container>
+
+              <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n>
+                will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding
+              </ng-container>
             </span>
 
             <my-select-custom-value
             <div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div>
           </div>
 
-          <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+          <div class="form-group mt-4" [ngClass]="getDisabledLiveTranscodingClass()">
             <label i18n for="liveTranscodingProfile">Live transcoding profile</label>
             <span class="text-muted ml-1" i18n>new live transcoding profiles can be added by PeerTube plugins</span>
 
               [items]="getAvailableTranscodingProfile()"
               [clearable]="false"
             >
-              <ng-template ng-option-tmp let-item="item" let-index="index">
-                {{ item }}
-                <ng-container *ngIf="item === 'default'">
-                  <br>
-                  <span class="text-muted" i18n>x264, targeting maximum device compatibility</span>
-                </ng-container>
-              </ng-template>
             </my-select-options>
+
             <div *ngIf="formErrors.live.transcoding.profile" class="form-error">{{ formErrors.live.transcoding.profile }}</div>
           </div>