Skip to content

Commit b5607a2

Browse files
feat: add unit functions to dashboard (#890)
dashboard.json updated to have tick_config that contains list of column names and their unit names sample json - ` { "version": "v1", "name": "helloa", "description": "ahdkadkadvnasdsa", "dashboard_id": "admin.1724033591071", "user_id": "admin", "time_filter": null, "refresh_interval": 60, "tiles": [ { "name": "final", "tile_id": "admin.1724033591071255", "description": "sdsds", "query": "select * from teststream LIMIT 100", "order": 2, "visualization": { "visualization_type": "donut-chart", "circular_chart_config": { "name_key": "app_meta", "value_key": "device_id" }, "graph_config": null, "size": "sm", "color_config": [], "tick_config": [{"key": "device_id", "unit": "unit_name"}] } } ] } `
1 parent be0b961 commit b5607a2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/users/dashboards.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub struct Visualization {
4545
graph_config: Option<GraphConfig>,
4646
size: String,
4747
color_config: Vec<ColorConfig>,
48+
tick_config: Vec<TickConfig>,
4849
}
4950

5051
#[derive(Debug, Serialize, Deserialize, Default, Clone)]
@@ -65,6 +66,12 @@ pub struct ColorConfig {
6566
color_palette: String,
6667
}
6768

69+
#[derive(Debug, Serialize, Deserialize, Default, Clone)]
70+
pub struct TickConfig {
71+
key: String,
72+
unit: String,
73+
}
74+
6875
#[derive(Debug, Serialize, Deserialize, Default, Clone)]
6976
pub struct Dashboard {
7077
pub version: Option<String>,

0 commit comments

Comments
 (0)