mud_server.admin_tui.screens.create_user ======================================== .. py:module:: mud_server.admin_tui.screens.create_user .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: mud_server.admin_tui.screens.create_user.ROLE_LABELS mud_server.admin_tui.screens.create_user.ROLE_DESCRIPTIONS Classes ------- .. autoapisummary:: mud_server.admin_tui.screens.create_user.CreateUserScreen Module Contents --------------- .. py:data:: ROLE_LABELS :type: dict[str, str] .. py:data:: ROLE_DESCRIPTIONS :type: dict[str, str] .. py:class:: CreateUserScreen(allowed_roles) Bases: :py:obj:`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. .. py:attribute:: BINDINGS .. py:attribute:: CSS :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ 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; } """ .. raw:: html
.. py:method:: compose() .. py:method:: on_mount() .. py:method:: on_key(event) .. py:method:: action_back() .. py:method:: action_quit() .. py:method:: handle_role_changed(event) .. py:method:: handle_cancel() .. py:method:: handle_create() :async: