# base


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-fasthtml-sysmon/blob/main/cjm_fasthtml_sysmon/components/base.py#L24"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_process_count

>  render_process_count (total:int)

*Render the process count badge.*

<table>
<colgroup>
<col style="width: 9%" />
<col style="width: 38%" />
<col style="width: 52%" />
</colgroup>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>total</td>
<td>int</td>
<td>The total number of processes</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td><strong>FT</strong></td>
<td><strong>A Span element containing the process count
badge</strong></td>
</tr>
</tbody>
</table>

``` python
from cjm_fasthtml_sysmon.monitors.processes import get_process_info

proc_info = get_process_info()
render_process_count(total=proc_info['total'])
```

``` html
<span id="process-count" class="badge badge-primary badge-lg">41 processes</span>
```

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-fasthtml-sysmon/blob/main/cjm_fasthtml_sysmon/components/base.py#L35"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_process_status

>  render_process_status (status_counts:dict)

*Render the process status badges.*

<table>
<colgroup>
<col style="width: 9%" />
<col style="width: 38%" />
<col style="width: 52%" />
</colgroup>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>status_counts</td>
<td>dict</td>
<td>Dictionary mapping process status names to their counts</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td><strong>FT</strong></td>
<td><strong>A Div element containing status badges</strong></td>
</tr>
</tbody>
</table>

``` python
from cjm_fasthtml_sysmon.monitors.processes import get_process_info

proc_info = get_process_info()
render_process_status(status_counts=proc_info['status_counts'])
```

``` html
<div id="process-status" class="flex flex-wrap gap-1 mb-4">
<span class="badge badge-neutral badge-sm mr-2">sleeping: 37</span><span class="badge badge-info badge-sm mr-2">running: 4</span></div>
```
