Reference Source
import UserListPage from 'flarum/admin/components/UserListPage'
public class | source

UserListPage

Extends:

src/admin/components/AdminPage.js~AdminPage → UserListPage

Admin page which displays a paginated list of all users on the forum.

Member Summary

Public Members
public
public

Are there more users available?

public

Number of users to load per page.

public

This page's array of users.

undefined when page loads as no data has been fetched.

public

Current page number.

public

Total number of forum users.

Method Summary

Public Methods
public

columns(): *

Build an item list of columns to show for each user.

public

Component to render.

public

Get total number of user pages.

public

headerInfo(): {"className": string, "icon": string, "title": *, "description": *}

public

async loadPage(pageNumber: *)

Asynchronously fetch the next set of users to be rendered.

public
public

Public Members

public isLoadingPage: * source

public moreData: * source

Are there more users available?

public numPerPage: * source

Number of users to load per page.

public pageData: * source

This page's array of users.

undefined when page loads as no data has been fetched.

public pageNumber: * source

Current page number. Zero-indexed.

public userCount: * source

Total number of forum users.

Fetched from the active AdminApplication (app), with data provided by AdminPayload.php, or flarum/statistics if installed.

Public Methods

public columns(): * source

Build an item list of columns to show for each user.

Each column in the list should be an object with keys name and content.

name is a string that will be used as the column name. content is a function with the User model passed as the first and only argument.

See UserListPage.tsx for examples.

Return:

*

public content(): undefined[] source

Component to render.

Return:

undefined[]

public getTotalPageCount(): * source

Get total number of user pages.

Return:

*

public headerInfo(): {"className": string, "icon": string, "title": *, "description": *} source

Return:

{"className": string, "icon": string, "title": *, "description": *}

public async loadPage(pageNumber: *) source

Asynchronously fetch the next set of users to be rendered.

Returns an array of Users, plus the raw API payload.

Uses the this.numPerPage as the response limit, and automatically calculates the offset required from pageNumber.

Params:

NameTypeAttributeDescription
pageNumber *

The page number to load and display

public nextPage() source

public previousPage() source