The ban list page (fl_ban_list): a search field, the buttons that turn the pages and a scrollable list with an fl_ban_row for every ban on the current page. The plugin calls set_bans with what the server has sent and request_bans when the bans have changed. Derives from fl_base_panel.

Summary

Methods

Init()client
Creates the search field, the page buttons and the scroll panel that holds the list, asks the server for the first page and makes the panel known to the plugin.
Puts the search field and the page buttons in a bar at the top and the list below it.
Asks the server for a page of the ban list, after a short delay that lets several changes in a row make a single request.
Shows a page of bans that the server has sent: recreates the rows and updates the page number and the page buttons.
Replaces the list with a single line of text, such as the notice that there are no bans.
Think()client
Sends the request for a page once the delay since the last change has passed.

Methods

Creates the search field, the page buttons and the scroll panel that holds the list, asks the server for the first page and makes the panel known to the plugin.

PANEL:PerformLayout(w, h)

client plugins/admin/plugin/views/cl_ban_list.lua:97

Puts the search field and the page buttons in a bar at the top and the list below it.

Parameters

  • w Number panel width
  • h Number panel height

PANEL:request_bans(page, immediately)

client plugins/admin/plugin/views/cl_ban_list.lua:125

Asks the server for a page of the ban list, after a short delay that lets several changes in a row make a single request.

Parameters

  • page Number optional, defaults to nil page to ask for; the current page by default
  • immediately Boolean optional, defaults to false send the request on the next frame

Shows a page of bans that the server has sent: recreates the rows and updates the page number and the page buttons. A page that arrives while a new request is waiting to be sent is ignored.

Parameters

  • data Map the page: page (its number), pages (how many there are), total (how many bans match the search) and bans (a List of rows with the steam_id, name, reason, admin, permanent and time_left fields)

PANEL:show_notice(text)

client plugins/admin/plugin/views/cl_ban_list.lua:132

Replaces the list with a single line of text, such as the notice that there are no bans.

Parameters

  • text String

Sends the request for a page once the delay since the last change has passed.

Defined in