Service webgui

The web-based graphical user interface of mercure.

class webgui.ExtendedUser(username: str, is_admin: bool = False)[source]

Bases: SimpleUser

property is_admin: bool
class webgui.SessionAuthBackend[source]

Bases: AuthenticationBackend

async authenticate(request)[source]
async webgui.configuration(request) Response[source]

Shows the current configuration of the mercure appliance.

async webgui.configuration_edit(request) Response[source]

Shows a configuration editor

async webgui.configuration_edit_post(request) Response[source]

Updates the configuration after post from editor

async webgui.control_services(request) Response[source]
async webgui.emergency_response(request) Response[source]

Shows emergency message about invalid configuration.

async webgui.error(request)[source]

An example error. Switch the debug setting to see either tracebacks or 500 pages.

webgui.get_nomad_logs(service, log_size: int) bytes[source]

Reads the service log when running a nomad-type installation.

async webgui.homepage(request) Response[source]

Renders the index page that shows information about the system status.

webgui.launch_emergency_app() None[source]

Launches a minimal application to inform the user about the incorrect configuration

async webgui.login(request) Response[source]

Shows the login page.

async webgui.login_post(request) Response[source]

Evaluate the submitted login information. Redirects to index page if login information valid, otherwise back to login. On the first login, the user will be directed to the settings page and asked to change the password.

async webgui.logout(request)[source]

Logouts the users by clearing the session cookie.

webgui.main(args=['-b', 'html', '-d', '_build/doctrees', '.', '_build/html']) None[source]
async webgui.not_found(request, exc) Response[source]

Return an HTTP 404 page.

async webgui.self_test(request) Response[source]

generate a test rule

async webgui.self_test_cleanup(test_id: str, delay: int = 60) None[source]

Delete the rules and targets for this test after a delay

async webgui.self_test_notification(request) Response[source]
async webgui.server_error(request, exc) Response[source]

Return an HTTP 500 page.

async webgui.settings_edit(request) Response[source]

Shows the settings for the current user. Renders the same template as the normal user edit, but with parameter own_settings=True.

async webgui.show_first_log(request) Response[source]

Get the first service entry and forward to corresponding log entry point.

async webgui.show_log(request) Response[source]

Render the log for the given service. The time range can be specified via URL parameters.