Skip to content

tables

process_manager.tables

Defines the ProcessTable for displaying process data in a structured table format.

Classes

ProcessTable

Bases: Table

Defines a Process Table for the data from the Process Manager.

Classes
Meta

Table meta options for rendering behavior and styling.

Functions
render_select(value)

Customize behavior of checkboxes in the select column.

Source code in process_manager/tables.py
def render_select(self, value: str) -> str:
    """Customize behavior of checkboxes in the select column."""
    return mark_safe(
        f'<input type="checkbox" name="select" value="{value}" '
        f'id="{value}-input" hx-preserve="true" '
        'class="form-check-input form-check-input-lg row-checkbox" '
        'style="transform: scale(1.5);" '
        f'_="{row_checkbox_hyperscript}">'
    )
render_status_code(value)

Render the status_code with custom badge classes.

Source code in process_manager/tables.py
def render_status_code(self, value: str) -> str:
    """Render the status_code with custom badge classes."""
    if value == "DEAD":
        return mark_safe('<span class="badge badge-dead">DEAD</span>')
    elif value == "RUNNING":
        return mark_safe('<span class="badge badge-running">RUNNING</span>')
    return mark_safe(
        f'<span class="badge bg-secondary px-3 py-2 rounded" '
        f'style="font-size: 1.1rem;">{value}</span>'
    )