---
title: "Dashboards"
description: "Raporty i wykresy. Każda aplikacja jest modułem na jednym modelu danych."
canonical: "https://obop.dev/pl/apps/dashboards/"
lang: "pl"
---

# Dashboards

## Do czego służy

Store dashboards and widgets as data (KPI, bar, line, pie and table definitions) for a client to render. The package never runs a query and does not check that the models it names exist.

## Co pakiet robi, a czego nie robi

Dashboards and their widgets stored as data, for a UI to render. A dashboard has a title and an owner. A widget describes one tile with these fields: kind (kpi, bar, line, pie or table), model_name (the model to read, for example sale_order), measure_field (the field to aggregate; empty for count), aggregate (count or sum; sum needs a number or money measure_field), group_by (field to split by, for bar, line, pie and table; empty for a single kpi value), filter (a JSON object of field names to exact values, for example {"state":"paid"}; empty means all records) and position (order on the dashboard, lowest first). The package only stores the definition; it does not check that the model or fields exist and it computes nothing.

## Modele

### `dashboards_dashboard`

A dashboard: a titled, ordered collection of widgets

Grupa odczytu: `dashboards.user`. Grupa zapisu: `dashboards.manager`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `title` | text | `none` | nie | `dashboards.user` | jawnie | Dashboard title, for example Sales overview |
| `owner` | text | `internal` | tak | `dashboards.user` | zamaskowane | Name of the person who owns the dashboard |
| `description` | longtext | `none` | nie | `dashboards.user` | jawnie | What the dashboard shows and for whom |
| `shared` | bool | `none` | nie | `dashboards.user` | jawnie | Whether everyone with access to the Dashboards app sees it, or only the owner |
| `position` | number | `none` | nie | `dashboards.user` | jawnie | Order among dashboards, lowest first |

### `dashboards_widget`

One tile on a dashboard, defined by what to read and how to aggregate it

Grupa odczytu: `dashboards.user`. Grupa zapisu: `dashboards.manager`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `dashboard_id` | ref → dashboards_dashboard | `none` | nie | `dashboards.user` | jawnie | The dashboard the widget is on |
| `title` | text | `none` | nie | `dashboards.user` | jawnie | Tile title, for example Paid orders |
| `kind` | select (kpi, bar, line, pie, table) | `none` | nie | `dashboards.user` | jawnie | How the tile is drawn: kpi, bar, line, pie, table |
| `model_name` | text | `none` | nie | `dashboards.user` | jawnie | Model the tile reads, for example sale_order |
| `measure_field` | text | `none` | nie | `dashboards.user` | jawnie | Field to aggregate: a number or money field of the model; empty when counting |
| `aggregate` | select (count, sum) | `none` | nie | `dashboards.user` | jawnie | How records are combined: count or sum |
| `group_by` | text | `none` | nie | `dashboards.user` | jawnie | Field to split the result by (a select, ref or date field); empty for one value |
| `filter` | longtext | `none` | nie | `dashboards.user` | jawnie | JSON object of field names to exact values that records must match, for example {"state":"paid"}; empty means all records |
| `position` | number | `none` | nie | `dashboards.user` | jawnie | Order of the tile on the dashboard, lowest first |

## Przepływy pracy

Ta aplikacja nie ma akcji przepływu pracy; rekordy są tworzone i edytowane bezpośrednio.

## Grupy uprawnień

Grupy używane przez tę aplikację:

- `dashboards.manager`
- `dashboards.user`

## Kroki zatwierdzania

Żaden krok w tej aplikacji nie wymaga zatwierdzenia, poza usuwaniem rekordów.

## Co agenci mogą, a czego nie mogą

Agent może odczytywać, wyszukiwać, tworzyć i aktualizować rekordy tej aplikacji oraz uruchamiać akcje niewymagające zatwierdzenia, w ramach grup uprawnień swojego tokenu.

Te kroki może tylko zaproponować, a człowiek musi je zatwierdzić: `dashboards_dashboard.delete`, `dashboards_widget.delete`.

Dane osobowe są maskowane jako tokeny zastępcze: `dashboards_dashboard.owner`.

## Zależności

Brak.

## Instalacja

Zainstaluj ją w aplikacji Customize (Marketplace) lub z wiersza poleceń:

```bash
obop modules install-from dashboards
```

Wymaga bazy danych i uprawnień administratora.

## Zbuduj własną

[Przewodnik po modułach pokazuje, jak pisze się takie aplikacje](/pl/docs/reference/module-manifest/)
