@@ -106,14 +127,38 @@
- | {{ user.videoQuotaUsed }} / {{ user.videoQuota }} |
- {{ user.roleLabel }} |
+
+
+
+
+ {{ user.videoQuotaUsed }}
+ {{ user.videoQuota }}
+
+ |
-
+ |
+
+
+
+ {{ user.videoQuotaUsedDaily }}
+ {{ user.videoQuotaDaily }}
+
+ |
+
+
+ {{ user.roleLabel }}
+ {{ user.roleLabel }}
+ |
+
+
{{ user.pluginAuth }}
|
- {{ user.createdAt | date: 'short' }} |
+ {{ user.createdAt | date: 'short' }} |
+
+ {{ user.lastLoginDate | date: 'short' }} |
td {
background-color: lighten($color: $red, $amount: 40) !important;
}
+.table-email {
+ @include disable-default-a-behaviour;
+ color: pvar(--mainForegroundColor);
+}
+
.banned-info {
font-style: italic;
}
@@ -36,10 +41,24 @@ p-tableCheckbox {
top: -2.5px;
}
+my-global-icon {
+ width: 18px;
+}
+
.chip {
@include chip;
}
+.badge {
+ @include table-badge;
+}
+
+.progress {
+ @include progressbar;
+ width: auto;
+ max-width: 100%;
+}
+
.input-group {
@include peertube-input-group(300px);
input {
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index 0b72b07c1..b2978212e 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -4,7 +4,7 @@ import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, Serve
import { Actor, DropdownAction } from '@app/shared/shared-main'
import { UserBanModalComponent } from '@app/shared/shared-moderation'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { ServerConfig, User } from '@shared/models'
+import { ServerConfig, User, UserRole } from '@shared/models'
import { Params, Router, ActivatedRoute } from '@angular/router'
@Component({
@@ -19,9 +19,12 @@ export class UserListComponent extends RestTable implements OnInit {
totalRecords = 0
sort: SortMeta = { field: 'createdAt', order: 1 }
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
+ highlightBannedUsers = false
selectedUsers: User[] = []
bulkUserActions: DropdownAction[][] = []
+ columns: { key: string, label: string }[]
+ _selectedColumns: { key: string, label: string }[]
private serverConfig: ServerConfig
@@ -46,6 +49,14 @@ export class UserListComponent extends RestTable implements OnInit {
return this.serverConfig.signup.requiresEmailVerification
}
+ get selectedColumns () {
+ return this._selectedColumns
+ }
+
+ set selectedColumns (val) {
+ this._selectedColumns = val
+ }
+
ngOnInit () {
this.serverConfig = this.serverService.getTmpConfig()
this.serverService.getConfig()
@@ -92,12 +103,47 @@ export class UserListComponent extends RestTable implements OnInit {
}
]
]
+
+ this.columns = [
+ { key: 'username', label: 'Username' },
+ { key: 'email', label: 'Email' },
+ { key: 'quota', label: 'Video quota' },
+ { key: 'role', label: 'Role' },
+ { key: 'createdAt', label: 'Created' }
+ ]
+ this.selectedColumns = [...this.columns]
+ this.columns.push({ key: 'quotaDaily', label: 'Daily quota' })
+ this.columns.push({ key: 'pluginAuth', label: 'Auth plugin' })
+ this.columns.push({ key: 'lastLoginDate', label: 'Last login' })
}
getIdentifier () {
return 'UserListComponent'
}
+ getRoleClass (role: UserRole) {
+ switch (role) {
+ case UserRole.ADMINISTRATOR:
+ return 'badge-purple'
+ case UserRole.MODERATOR:
+ return 'badge-blue'
+ default:
+ return 'badge-yellow'
+ }
+ }
+
+ getColumn (key: string) {
+ return this.selectedColumns.find((col: any) => col.key === key)
+ }
+
+ getUserVideoQuotaPercentage (user: User & { rawVideoQuota: number, rawVideoQuotaUsed: number}) {
+ return user.rawVideoQuotaUsed * 100 / user.rawVideoQuota
+ }
+
+ getUserVideoQuotaDailyPercentage (user: User & { rawVideoQuotaDaily: number, rawVideoQuotaUsedDaily: number}) {
+ return user.rawVideoQuotaUsedDaily * 100 / user.rawVideoQuotaDaily
+ }
+
openBanUserModal (users: User[]) {
for (const user of users) {
if (user.username === 'root') {
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
index 0727f90e8..9b5f2dd2f 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
@@ -6,7 +6,7 @@
|