examples: add media-stats-ui plugin
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7c9ccac175440d278fd129dbd53f04d66a6a6964
This commit is contained in:
parent
613f6cab54
commit
8ded6fedc8
6 changed files with 466 additions and 0 deletions
132
examples/plugins/media-stats-ui/pages/stats.json
Normal file
132
examples/plugins/media-stats-ui/pages/stats.json
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
{
|
||||
"id": "stats",
|
||||
"title": "Library Statistics",
|
||||
"route": "/plugins/media-stats-ui/stats",
|
||||
"icon": "chart-bar",
|
||||
"layout": {
|
||||
"type": "tabs",
|
||||
"default_tab": 0,
|
||||
"tabs": [
|
||||
{
|
||||
"label": "Overview",
|
||||
"content": {
|
||||
"type": "container",
|
||||
"gap": 24,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"level": 2,
|
||||
"content": "Library Statistics"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"content": "Live summary of your media library. Refreshes every 30 seconds.",
|
||||
"variant": "secondary"
|
||||
},
|
||||
{
|
||||
"type": "card",
|
||||
"title": "Summary",
|
||||
"content": [
|
||||
{
|
||||
"type": "description_list",
|
||||
"data": "stats",
|
||||
"horizontal": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "chart",
|
||||
"chart_type": "bar",
|
||||
"data": "type-breakdown",
|
||||
"title": "Files by Type",
|
||||
"x_axis_label": "Media Type",
|
||||
"y_axis_label": "Count",
|
||||
"height": 280
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Recent Files",
|
||||
"content": {
|
||||
"type": "container",
|
||||
"gap": 16,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"level": 2,
|
||||
"content": "Recently Added"
|
||||
},
|
||||
{
|
||||
"type": "data_table",
|
||||
"data": "recent",
|
||||
"sortable": true,
|
||||
"filterable": true,
|
||||
"page_size": 10,
|
||||
"columns": [
|
||||
{
|
||||
"key": "title",
|
||||
"header": "Title"
|
||||
},
|
||||
{
|
||||
"key": "media_type",
|
||||
"header": "Type"
|
||||
},
|
||||
{
|
||||
"key": "file_size",
|
||||
"header": "Size",
|
||||
"data_type": "file_size"
|
||||
},
|
||||
{
|
||||
"key": "created_at",
|
||||
"header": "Added",
|
||||
"data_type": "date_time"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Media Grid",
|
||||
"content": {
|
||||
"type": "container",
|
||||
"gap": 16,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"level": 2,
|
||||
"content": "Browse Media"
|
||||
},
|
||||
{
|
||||
"type": "media_grid",
|
||||
"data": "recent",
|
||||
"columns": 4,
|
||||
"gap": 12
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data_sources": {
|
||||
"stats": {
|
||||
"type": "endpoint",
|
||||
"path": "/api/v1/statistics",
|
||||
"poll_interval": 30
|
||||
},
|
||||
"recent": {
|
||||
"type": "endpoint",
|
||||
"path": "/api/v1/media"
|
||||
},
|
||||
"type-breakdown": {
|
||||
"type": "static",
|
||||
"value": [
|
||||
{ "type": "Audio", "count": 0 },
|
||||
{ "type": "Video", "count": 0 },
|
||||
{ "type": "Image", "count": 0 },
|
||||
{ "type": "Document", "count": 0 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue