mud_server.admin_tui.screens.create_user

Create user screen for PipeWorks Admin TUI.

This screen presents a focused, single-purpose form that allows admins and superusers to create new accounts. It enforces: - Role selection constrained by the current user’s privileges - Password confirmation before submission - Clear inline feedback for validation and API errors

Attributes

ROLE_LABELS

ROLE_DESCRIPTIONS

Classes

CreateUserScreen

Screen for creating new user accounts.

Module Contents

mud_server.admin_tui.screens.create_user.ROLE_LABELS: dict[str, str]
mud_server.admin_tui.screens.create_user.ROLE_DESCRIPTIONS: dict[str, str]
class mud_server.admin_tui.screens.create_user.CreateUserScreen(allowed_roles)

Bases: textual.screen.Screen

Screen for creating new user accounts.

Accessible to admins and superusers. The UI is a compact form with: - Username input - Role dropdown (limited by the caller-provided role list) - Role description that updates when the role changes - Password + confirmation fields

The API enforces all security requirements (password policy, uniqueness). The screen performs basic client-side checks to guide the user before submitting the request.

BINDINGS
CSS = Multiline-String
Show Value
"""
    CreateUserScreen {
        layout: vertical;
    }

    .form-container {
        padding: 1 2;
    }

    .form-box {
        width: 70;
        height: auto;
        border: solid $primary;
        padding: 1 2;
    }

    .form-title {
        text-style: bold;
        color: $accent;
        padding-bottom: 1;
    }

    .form-label {
        padding-top: 1;
    }

    .form-input {
        margin-bottom: 1;
    }

    .role-description {
        color: $text-muted;
        padding: 0 0 1 0;
    }

    .form-actions {
        height: 3;
        padding-top: 1;
    }

    .action-button {
        margin-right: 1;
    }

    .form-status {
        padding-top: 1;
    }
    """
compose()
on_mount()
on_key(event)
action_back()
action_quit()
handle_role_changed(event)
handle_cancel()
async handle_create()