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

UserListPage

Extends:

src/common/Component.js~ComponentPageAdminPage → 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

Inherited Summary

From class Page
public

A class name to apply to the body while the route is active.

public

Whether we should scroll to the top of the page when its rendered.

public

Whether the browser should restore scroll state on refreshes.

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

onremove(vnode: *)

From class AdminPage
public
public

settings: {}

public

buildSettingComponent(setting: *): JSX.Element

buildSettingComponent takes a settings object and turns it into a component.

public
public

dirty(): *

public

header(): *

public

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

public

isChanged(): *

public

oninit(vnode: *)

public
public

saveSettings(e: *): *

public

setting(key: *, fallback: string): *

public
public

view(): *

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.

Override:

AdminPage#content

Return:

undefined[]

public getTotalPageCount(): * source

Get total number of user pages.

Return:

*

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

Override:

AdminPage#headerInfo

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