Fix quota in instance features table
authorChocobozzz <me@florianbigard.com>
Mon, 29 Jul 2019 14:30:01 +0000 (16:30 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 29 Jul 2019 14:30:01 +0000 (16:30 +0200)
client/src/app/shared/instance/instance-features-table.component.html
client/src/app/shared/instance/instance-features-table.component.ts
server/controllers/client.ts
server/controllers/static.ts

index 2885f97e3ab17d9d4f25a2d84554500a30bfa8a6..2987bd00e90338f2bd74d6f8d24dbc2281b2c73f 100644 (file)
@@ -22,7 +22,7 @@
         <ng-container *ngIf="initialUserVideoQuota !== -1">
           {{ initialUserVideoQuota | bytes: 0 }} <ng-container *ngIf="dailyUserVideoQuota !== -1">({{ dailyUserVideoQuota | bytes: 0 }} per day)</ng-container>
 
-          <my-help helpType="custom" [customHtml]="quotaHelpIndication"></my-help>
+          <my-help tooltipPlacement="auto" helpType="custom" [customHtml]="quotaHelpIndication"></my-help>
         </ng-container>
 
         <ng-container i18n *ngIf="initialUserVideoQuota === -1">
index 72e7c2730f3c93cd469c4a018e9d8cd263954696..a53082a93c234c32b2051afc887cb44bc8963389 100644 (file)
@@ -22,7 +22,7 @@ export class InstanceFeaturesTableComponent implements OnInit {
   }
 
   get dailyUserVideoQuota () {
-    return this.serverService.getConfig().user.videoQuotaDaily
+    return Math.min(this.initialUserVideoQuota, this.serverService.getConfig().user.videoQuotaDaily)
   }
 
   ngOnInit () {
index 51f610afaa001877511db0949a18c9e2f54a67ac..2af00e475ecefb82bba4cde8552ff7304e40b407 100644 (file)
@@ -1,7 +1,7 @@
 import * as express from 'express'
 import { join } from 'path'
 import { root } from '../helpers/core-utils'
-import { ACCEPT_HEADERS, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers/constants'
+import { ACCEPT_HEADERS, STATIC_MAX_AGE } from '../initializers/constants'
 import { asyncMiddleware, embedCSP } from '../middlewares'
 import { buildFileLocale, getCompleteLocale, is18nLocale, LOCALE_FILES } from '../../shared/models/i18n/i18n'
 import { ClientHtml } from '../lib/client-html'
index 4296183a0ba45533f27bd91ff5d428783c8574b3..110d25031ea08c5dad7881327c9b88351a23ef44 100644 (file)
@@ -1,7 +1,8 @@
 import * as cors from 'cors'
 import * as express from 'express'
 import {
-  HLS_STREAMING_PLAYLIST_DIRECTORY, PEERTUBE_VERSION,
+  HLS_STREAMING_PLAYLIST_DIRECTORY,
+  PEERTUBE_VERSION,
   ROUTE_CACHE_LIFETIME,
   STATIC_DOWNLOAD_PATHS,
   STATIC_MAX_AGE,