From 818045ef04b321aa0a66bb8abce30a2e94e9fefa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Aug 2021 09:00:08 +0200 Subject: Update client dependencies --- .../video-redundancies-list.component.ts | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'client/src/app/+admin/follows') diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index 7ffed83e8..2f87c6743 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts @@ -1,3 +1,4 @@ +import { ChartData, ChartOptions, TooltipItem } from 'chart.js' import { SortMeta } from 'primeng/api' import { Component, OnInit } from '@angular/core' import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' @@ -21,7 +22,7 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit pagination: RestPagination = { count: this.rowsPerPage, start: 0 } displayType: VideoRedundanciesTarget = 'my-videos' - redundanciesGraphsData: { stats: VideosRedundancyStats, graphData: any, options: any }[] = [] + redundanciesGraphsData: { stats: VideosRedundancyStats, graphData: ChartData, options: ChartOptions }[] = [] noRedundancies = false @@ -114,21 +115,22 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit ] }, options: { - title: { - display: true, - text: stats.strategy - }, - - tooltips: { - callbacks: { - label: (tooltipItem: any, data: any) => { - const dataset = data.datasets[tooltipItem.datasetIndex] - let label = data.labels[tooltipItem.index] - if (label) label += ': ' - else label = '' - - label += this.bytesPipe.transform(dataset.data[tooltipItem.index], 1) - return label + plugins: { + title: { + display: true, + text: stats.strategy + }, + + tooltip: { + callbacks: { + label: (tooltip: TooltipItem) => { + let label = tooltip.label || '' + if (label) label += ': ' + + label += this.bytesPipe.transform(tooltip.raw as number, 1) + + return label + } } } } -- cgit v1.2.3