aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-10 14:42:51 +0200
committerChocobozzz <me@florianbigard.com>2022-10-10 14:42:51 +0200
commit4624283054370834232134bc6c321797bdaa3284 (patch)
tree0ac279768cdcd1349eafa5ddaaed005c61293323 /client/src
parent3e74c22dcb5dd4ab0b533b8b9ca9a219195728c0 (diff)
downloadPeerTube-4624283054370834232134bc6c321797bdaa3284.tar.gz
PeerTube-4624283054370834232134bc6c321797bdaa3284.tar.zst
PeerTube-4624283054370834232134bc6c321797bdaa3284.zip
Add object storage info badge
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.html3
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts9
2 files changed, 11 insertions, 1 deletions
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html
index 14bbb55e9..fb5e533f1 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.html
+++ b/client/src/app/+admin/overview/videos/video-list.component.html
@@ -85,7 +85,8 @@
85 <td> 85 <td>
86 <span *ngIf="isHLS(video)" class="pt-badge badge-blue">HLS</span> 86 <span *ngIf="isHLS(video)" class="pt-badge badge-blue">HLS</span>
87 <span *ngIf="isWebTorrent(video)" class="pt-badge badge-blue">WebTorrent ({{ video.files.length }})</span> 87 <span *ngIf="isWebTorrent(video)" class="pt-badge badge-blue">WebTorrent ({{ video.files.length }})</span>
88 <span *ngIf="video.isLive" class="pt-badge badge-blue">Live</span> 88 <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span>
89 <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span>
89 90
90 <span *ngIf="!isImport(video) && !video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span> 91 <span *ngIf="!isImport(video) && !video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span>
91 </td> 92 </td>
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index cb693ce12..4d3e9873c 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -8,6 +8,7 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms'
8import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' 8import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
9import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' 9import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation'
10import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' 10import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
11import { getAllFiles } from '@shared/core-utils'
11import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' 12import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
12import { VideoAdminService } from './video-admin.service' 13import { VideoAdminService } from './video-admin.service'
13 14
@@ -166,6 +167,14 @@ export class VideoListComponent extends RestTable implements OnInit {
166 return video.files.length !== 0 167 return video.files.length !== 0
167 } 168 }
168 169
170 hasObjectStorage (video: Video) {
171 if (!video.isLocal) return false
172
173 const files = getAllFiles(video)
174
175 return files.some(f => !f.fileUrl.startsWith(window.location.origin))
176 }
177
169 canRemoveOneFile (video: Video) { 178 canRemoveOneFile (video: Video) {
170 return video.canRemoveOneFile(this.authUser) 179 return video.canRemoveOneFile(this.authUser)
171 } 180 }