aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-04-05 14:03:52 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-04-15 09:49:35 +0200
commit384ba8b77a8e4805c099f5ea12b41c2ca5776e26 (patch)
tree6b517033d9265d283677b85e0f57486e0e7fd8cf /client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
parentb211106695bb82f6c32e53306081b5262c3d109d (diff)
downloadPeerTube-384ba8b77a8e4805c099f5ea12b41c2ca5776e26.tar.gz
PeerTube-384ba8b77a8e4805c099f5ea12b41c2ca5776e26.tar.zst
PeerTube-384ba8b77a8e4805c099f5ea12b41c2ca5776e26.zip
Support videos stats in client
Diffstat (limited to 'client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts')
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
index 5eef96145..ed6a4afc0 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
@@ -30,6 +30,7 @@ export type VideoActionsDisplayType = {
30 removeFiles?: boolean 30 removeFiles?: boolean
31 transcoding?: boolean 31 transcoding?: boolean
32 studio?: boolean 32 studio?: boolean
33 stats?: boolean
33} 34}
34 35
35@Component({ 36@Component({
@@ -61,9 +62,11 @@ export class VideoActionsDropdownComponent implements OnChanges {
61 liveInfo: false, 62 liveInfo: false,
62 removeFiles: false, 63 removeFiles: false,
63 transcoding: false, 64 transcoding: false,
64 studio: true 65 studio: true,
66 stats: true
65 } 67 }
66 @Input() placement = 'left' 68 @Input() placement = 'left'
69 @Input() moreActions: DropdownAction<{ video: Video }>[][] = []
67 70
68 @Input() label: string 71 @Input() label: string
69 72
@@ -156,6 +159,10 @@ export class VideoActionsDropdownComponent implements OnChanges {
156 return this.video.isEditableBy(this.user, this.serverService.getHTMLConfig().videoStudio.enabled) 159 return this.video.isEditableBy(this.user, this.serverService.getHTMLConfig().videoStudio.enabled)
157 } 160 }
158 161
162 isVideoStatsAvailable () {
163 return this.video.canSeeStats(this.user)
164 }
165
159 isVideoRemovable () { 166 isVideoRemovable () {
160 return this.video.isRemovableBy(this.user) 167 return this.video.isRemovableBy(this.user)
161 } 168 }
@@ -343,6 +350,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
343 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.studio && this.isVideoEditable() 350 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.studio && this.isVideoEditable()
344 }, 351 },
345 { 352 {
353 label: $localize`Stats`,
354 linkBuilder: ({ video }) => [ '/stats/videos', video.uuid ],
355 iconName: 'stats',
356 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.stats && this.isVideoStatsAvailable()
357 },
358 {
346 label: $localize`Block`, 359 label: $localize`Block`,
347 handler: () => this.showBlockModal(), 360 handler: () => this.showBlockModal(),
348 iconName: 'no', 361 iconName: 'no',
@@ -408,5 +421,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
408 } 421 }
409 ] 422 ]
410 ] 423 ]
424
425 this.videoActions = this.videoActions.concat(this.moreActions)
411 } 426 }
412} 427}