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

AdminPage

Extends:

src/common/Component.js~ComponentPage → AdminPage

Member Summary

Public Members
public
public

settings: {}

Method Summary

Public Methods
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(): *

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: *)

Public Members

public loading: boolean source

public settings: {} source

Public Methods

public buildSettingComponent(setting: *): JSX.Element source

buildSettingComponent takes a settings object and turns it into a component. Depending on the type of input, you can set the type to 'bool', 'select', or any standard <input> type. Any values inside the 'extra' object will be added to the component as an attribute.

Alternatively, you can pass a callback that will be executed in ExtensionPage's context to include custom JSX elements.

Params:

NameTypeAttributeDescription
setting *

Return:

JSX.Element

Example:


{
   setting: 'acme.checkbox',
   label: app.translator.trans('acme.admin.setting_label'),
   type: 'bool',
   help: app.translator.trans('acme.admin.setting_help'),
   className: 'Setting-item'
}

{
   setting: 'acme.select',
   label: app.translator.trans('acme.admin.setting_label'),
   type: 'select',
   options: {
     'option1': 'Option 1 label',
     'option2': 'Option 2 label',
   },
   default: 'option1',
}

public content(): string source

Return:

string

public dirty(): * source

Return:

*

public header(): * source

Return:

*

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

Return:

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

public isChanged(): * source

Return:

*

public oninit(vnode: *) source

Override:

Page#oninit

Params:

NameTypeAttributeDescription
vnode *

public onsaved() source

public saveSettings(e: *): * source

Params:

NameTypeAttributeDescription
e *

Return:

*

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

Params:

NameTypeAttributeDescription
key *
fallback string
  • optional
  • default:

Return:

*

public submitButton(): * source

Return:

*

public view(): * source

Return:

*