+ ngOnInit (): void {
+ this.serverConfig = this.serverService.getHTMLConfig()
+
+ this.buildRoles()
+ }
+
+ get subscribersCount () {
+ const forAccount = this.user
+ ? this.user.account.followersCount
+ : 0
+ const forChannels = this.user
+ ? this.user.videoChannels.map(c => c.followersCount).reduce((a, b) => a + b, 0)
+ : 0
+ return forAccount + forChannels
+ }
+
+ getAuthPlugins () {
+ return this.serverConfig.plugin.registeredIdAndPassAuths.map(p => p.npmName)
+ .concat(this.serverConfig.plugin.registeredExternalAuths.map(p => p.npmName))
+ }
+
+ isInBigView () {
+ return this.screenService.getWindowInnerWidth() > 1600
+ }
+
+ buildRoles () {
+ const authUser = this.auth.getUser()
+
+ if (authUser.role === UserRole.ADMINISTRATOR) {
+ this.roles = Object.keys(USER_ROLE_LABELS)
+ .map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] }))
+ return
+ }
+
+ this.roles = [
+ { value: UserRole.USER.toString(), label: USER_ROLE_LABELS[UserRole.USER] }
+ ]
+ }
+