]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/admin.component.ts
Support official plugins
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / admin.component.ts
index 15739f8d34dc59ec2d78a72aaf9fc790a7c6a64c..b8a957d1c451cccf3468e630debdc7ef6a9f2391 100644 (file)
@@ -31,8 +31,29 @@ export class AdminComponent implements OnInit {
   }
 
   private buildOverviewItems () {
+    const overviewItems: TopMenuDropdownParam = {
+      label: $localize`Overview`,
+      children: []
+    }
+
     if (this.hasUsersRight()) {
-      this.menuEntries.push({ label: $localize`Users`, routerLink: '/admin/users' })
+      overviewItems.children.push({
+        label: $localize`Users`,
+        routerLink: '/admin/users',
+        iconName: 'user'
+      })
+    }
+
+    if (this.hasVideosRight()) {
+      overviewItems.children.push({
+        label: $localize`Videos`,
+        routerLink: '/admin/videos',
+        iconName: 'videos'
+      })
+    }
+
+    if (overviewItems.children.length !== 0) {
+      this.menuEntries.push(overviewItems)
     }
   }
 
@@ -204,4 +225,8 @@ export class AdminComponent implements OnInit {
   private hasVideoCommentsRight () {
     return this.auth.getUser().hasRight(UserRight.SEE_ALL_COMMENTS)
   }
+
+  private hasVideosRight () {
+    return this.auth.getUser().hasRight(UserRight.SEE_ALL_VIDEOS)
+  }
 }