# Computer labs card

> Canonical HTML: https://screenrig.ai/docs/cards/computer-labs/

Free workstations in each campus computer lab, how full it is, which operating systems are free, when it closes and whether its printers work.

Category: Schools. Tags: Schools and campuses, Numbers and metrics.

## Previews

![Computer labs](/cards/computer-labs/v1/screenshots/canvas-bloom.webp?sha=f4d6a9569d40c0e661b92a517bcb517e9a42c0a5b659f5d0ec8508fafc0cfcd5)

Canvas

![Computer labs](/cards/computer-labs/v1/screenshots/corner-bloom.webp?sha=26a4bc0d9b56fe2ecb6f436b3ae138df86d6886d8fcc00fb47b8473c27bb6641)

Corner

![Computer labs](/cards/computer-labs/v1/screenshots/chip-bloom.webp?sha=48b6b374e9c367caafccabcc8b82bbebff850d3e30e870f26c5ae7c3c4f3df73)

Chip

## Views and forms

Views: canvas, corner, chip. Canvas forms: landscape, portrait, square, strip.

[Card views, themes and publishing](/docs/cards/). [Browse the gallery](/apps/#cards).

## Data and privacy

Feed: `screenrig.labs/v1`.

Feed documents carry source attribution. The Player supplies the feed to the card.

Counts only, never who is at a workstation.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `"Computer labs"` | maxLength: `40` |  |
| `sort` | string | `"feed"` | `"feed"`, `"free"` | feed keeps the order given; free puts the lab with the most free workstations first. |
| `lowPercent` | integer | `20` | minimum: `1`; maximum: `50` | A lab with this percent or fewer of its workstations free reads Filling up. |
| `showPlatforms` | boolean | `true` |  |  |
| `showPrinters` | boolean | `true` |  |  |
| `staleMinutes` | integer | `10` | minimum: `1`; maximum: `1440` |  |
| `hour12` | boolean | `false` |  |  |
| `timeZone` | string, null | `null` |  |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `labs` | array | `[]` | minItems: `0`; maxItems: `8` | The labs. A feed (screenrig.labs/v1) wins when present; the data store supplies the same rows otherwise. |
| `labs[].name` | string |  | minLength: `1`; maxLength: `40`; Required |  |
| `labs[].location` | string |  | maxLength: `40` | Building and room: Irving K. Barber, level 2. |
| `labs[].total` | integer |  | minimum: `0`; maximum: `2000`; Required | Workstations in the lab. |
| `labs[].free` | integer |  | minimum: `0`; maximum: `2000` | Workstations free now. Without it the card uses total minus inUse. |
| `labs[].inUse` | integer |  | minimum: `0`; maximum: `2000` |  |
| `labs[].open` | boolean | `true` |  |  |
| `labs[].closesAt` | string |  | maxLength: `32` | ISO 8601; with an offset or wall time in the screen's zone. |
| `labs[].opensAt` | string |  | maxLength: `32` | When a closed lab opens next, ISO 8601. |
| `labs[].platforms` | array |  | maxItems: `4` | Free workstations by operating system. |
| `labs[].platforms[].os` | string |  | maxLength: `20`; Required |  |
| `labs[].platforms[].free` | integer |  | minimum: `0`; maximum: `2000`; Required |  |
| `labs[].printers` | array |  | maxItems: `12` |  |
| `labs[].printers[].name` | string |  | maxLength: `30` |  |
| `labs[].printers[].status` | string |  | `"ready"`, `"low-paper"`, `"out-of-paper"`, `"low-toner"`, `"out-of-toner"`, `"jam"`, `"offline"`, `"error"`; Required |  |
| `updated` | string | `""` | maxLength: `32` | When the counts were taken, ISO 8601 (data store only; a feed carries fetchedAt). |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "computer-labs",
  "primitive": "card",
  "card": "computer-labs",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "computer-labs-main"
}
```

## Write live data

Create this document before showing the card, then replace it to update the screen without republishing. Use the same project as the playlist. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/computer-labs-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"labs":[],"updated":""}}'
```
