Logs Terminal Emulator React App

The web console’s Terminal page: a bash shell inside the server’s container, for superusers.

The page is the single-page console’s (ADR-035): it renders @smarter/terminal-emulator, which draws a window styled after macOS Terminal.app with xterm.js. The terminal POSTs to the ticket api for a single use ticket, then opens the terminal’s WebSocket with it, which runs a bash shell in the server process that accepts it. See api.tickets and api.consumers.

Classes:

TerminalEmulatorView: The Terminal page, which Django keeps at the path it served the page at.

Example

Wire up the view in your URL configuration:

from smarter.apps.dashboard.views.terminal_emulator.enabled import require_terminal
from smarter.apps.dashboard.views.terminal_emulator.reactapp import TerminalEmulatorView

urlpatterns = [
    path("terminal/", require_terminal(TerminalEmulatorView.as_view()), name="terminal_emulator_view"),
]
class smarter.apps.dashboard.views.terminal_emulator.reactapp.TerminalEmulatorView(**kwargs)[source]

Bases: ConsoleAppView

The Terminal page, /dashboard/terminal/: the single-page console’s.

The url patterns wrap it in enabled.require_terminal(), so that the page is a 404 while the terminal is disabled, and for every user but a superuser, as the ticket api is. The console’s session says the same, so that a user who reaches the page within the console sees its Page not found.