Put admin users in overview tab
This commit is contained in:
parent
bd898dd76b
commit
00004f7f6b
|
@ -6,7 +6,7 @@ import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
|
|||
import { SystemRoutes } from '@app/+admin/system'
|
||||
import { AdminComponent } from './admin.component'
|
||||
import { FollowsRoutes } from './follows'
|
||||
import { UsersRoutes } from './users'
|
||||
import { OverviewRoutes } from './overview'
|
||||
|
||||
const adminRoutes: Routes = [
|
||||
{
|
||||
|
@ -18,8 +18,9 @@ const adminRoutes: Routes = [
|
|||
redirectTo: 'users',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
|
||||
...FollowsRoutes,
|
||||
...UsersRoutes,
|
||||
...OverviewRoutes,
|
||||
...ModerationRoutes,
|
||||
...SystemRoutes,
|
||||
...ConfigRoutes,
|
||||
|
|
|
@ -31,8 +31,21 @@ 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 (overviewItems.children.length !== 0) {
|
||||
this.menuEntries.push(overviewItems)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import { AbuseListComponent, VideoBlockListComponent } from './moderation'
|
|||
import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist'
|
||||
import { ModerationComponent } from './moderation/moderation.component'
|
||||
import { VideoCommentListComponent } from './moderation/video-comment-list'
|
||||
import { UserCreateComponent, UserListComponent, UserPasswordComponent, UserUpdateComponent } from './overview'
|
||||
import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component'
|
||||
import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component'
|
||||
import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component'
|
||||
|
@ -41,7 +42,6 @@ import { PluginApiService } from './plugins/shared/plugin-api.service'
|
|||
import { JobService, LogsComponent, LogsService, SystemComponent } from './system'
|
||||
import { DebugComponent, DebugService } from './system/debug'
|
||||
import { JobsComponent } from './system/jobs/jobs.component'
|
||||
import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users'
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -73,7 +73,6 @@ import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersCom
|
|||
VideoRedundanciesListComponent,
|
||||
VideoRedundancyInformationComponent,
|
||||
|
||||
UsersComponent,
|
||||
UserCreateComponent,
|
||||
UserUpdateComponent,
|
||||
UserPasswordComponent,
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
export * from './users'
|
||||
export * from './overview.routes'
|
|
@ -0,0 +1,6 @@
|
|||
import { Routes } from '@angular/router'
|
||||
import { UsersRoutes } from './users'
|
||||
|
||||
export const OverviewRoutes: Routes = [
|
||||
...UsersRoutes
|
||||
]
|
|
@ -1,4 +1,3 @@
|
|||
export * from './user-edit'
|
||||
export * from './user-list'
|
||||
export * from './users.component'
|
||||
export * from './users.routes'
|
|
@ -4,7 +4,7 @@ import { AuthService, ScreenService, ServerService, User } from '@app/core'
|
|||
import { FormReactive } from '@app/shared/shared-forms'
|
||||
import { USER_ROLE_LABELS } from '@shared/core-utils/users'
|
||||
import { HTMLServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models'
|
||||
import { SelectOptionsItem } from '../../../../types/select-options-item.model'
|
||||
import { SelectOptionsItem } from '../../../../../types/select-options-item.model'
|
||||
|
||||
@Directive()
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
@ -1,3 +1,8 @@
|
|||
<h1>
|
||||
<my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
|
||||
<ng-container i18n>Users</ng-container>
|
||||
</h1>
|
||||
|
||||
<p-table
|
||||
[value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedUsers"
|
|
@ -3,12 +3,10 @@ import { UserRightGuard } from '@app/core'
|
|||
import { UserRight } from '@shared/models'
|
||||
import { UserCreateComponent, UserUpdateComponent } from './user-edit'
|
||||
import { UserListComponent } from './user-list'
|
||||
import { UsersComponent } from './users.component'
|
||||
|
||||
export const UsersRoutes: Routes = [
|
||||
{
|
||||
path: 'users',
|
||||
component: UsersComponent,
|
||||
canActivate: [ UserRightGuard ],
|
||||
data: {
|
||||
userRight: UserRight.MANAGE_USERS
|
|
@ -1,7 +0,0 @@
|
|||
import { Component } from '@angular/core'
|
||||
|
||||
@Component({
|
||||
template: '<router-outlet></router-outlet>'
|
||||
})
|
||||
export class UsersComponent {
|
||||
}
|
Loading…
Reference in New Issue