You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, only users with the `superadmin` role can edit dashboards (add, rename, reorder, and remove groups or widgets). Use the `editRoles` option to grant editing to other roles:
193
+
194
+
```ts title="./globalPlugins.ts"
195
+
newDashboardPlugin({
196
+
dashboardConfigsResourceId: 'dashboard_configs',
197
+
editRoles: ['superadmin', 'admin'], // allow 'admin' users to edit dashboards too
198
+
});
199
+
```
200
+
201
+
Users whose role is not listed in `editRoles` can view dashboards but are not shown the editing controls and cannot modify dashboards, groups, or widgets through the API.
202
+
190
203
Then pass it to the AdminForth configuration:
191
204
192
205
```ts title="./index.ts"
@@ -216,7 +229,7 @@ widgets: []
216
229
If you need to configure dashboards without using the AI Agent, you can do so manually via the AdminForth interface:
217
230
218
231
1. **Access Dashboards**: Open the **Dashboards** group in the sidebar and choose a dashboard page.
219
-
2. **Interactive UI Editor**: Superadmins can add, rename, reorder, and remove groups or widgets directly from the user interface.
232
+
2. **Interactive UI Editor**: Users with a role listed in the plugin's `editRoles` option (defaults to `superadmin`) can add, rename, reorder, and remove groups or widgets directly from the user interface.
220
233
3. **YAML Configuration Editor**: The dashboard builder has built-in code editors. When editing a widget or a group manually, you write configurations using a YAML-based DSL.
221
234
222
235
For the complete schema specifications of queries, formulas, custom variables, layout fields, and advanced chart configurations, see the **[Dashboard Query Reference](/docs/tutorial/Plugins/dashboard-reference)**.
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/09-Plugins/27-1-dashboard-reference.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,9 @@ query:
30
30
direction: desc
31
31
```
32
32
33
-
Step-based charts use a `steps` query when each step needs its own resource, metric, and filters. Funnel charts always use this query shape.
33
+
Step-based charts use a `steps` query when each step needs its own resource, measure, and filters. Funnel charts can also use this query shape; like every other chart, they accept a single-resource query as well.
34
34
35
-
Depending on the widget, `query` can also use `limit`, `offset`, `calcs`, `time_series`, `period`, `bucket`, and `formatting`.
35
+
Depending on the widget, `query` can also use `limit`, `offset`, `calcs`, `bucket`, and `formatting`.
36
36
37
37
Widget-scoped constants can be defined with `variables`. They are available inside `query.calcs` through `lookup($variables.path, field, default)`.
38
38
@@ -50,19 +50,20 @@ chart:
50
50
y:
51
51
field: adjusted_value
52
52
query:
53
+
source: steps
53
54
steps:
54
55
- name: SQLite
55
56
resource: cars_sl
56
-
metric:
57
-
agg: avg
58
-
field: price
59
-
as: value
57
+
select:
58
+
- agg: avg
59
+
field: price
60
+
as: value
60
61
- name: MySQL
61
62
resource: cars_mysql
62
-
metric:
63
-
agg: avg
64
-
field: price
65
-
as: value
63
+
select:
64
+
- agg: avg
65
+
field: price
66
+
as: value
66
67
calcs:
67
68
- calc: value * lookup($variables.price_multipliers, resource, 1)
0 commit comments