Skip to content

Conversation

@nikhilsinhaparseable
Copy link
Contributor

@nikhilsinhaparseable nikhilsinhaparseable commented Jul 22, 2024

feature to support various operations of dashboards APIs

  • POST /dashboards - to create dashboard
  • GET /dashboards/ - to list dashboards for a user
  • GET /dashboards/dashboard/ - to get dashboard
  • PUT /dashboards/dashboard/ - to update dashboard
  • DELETE /dashboards/dashboard/ - to delete dashboard

sample JSON -
{ "name": "Backend dashboard", "description": "This is a description for the dashboard", "user_id": "nikhil", "time_filter": { "to": "2024-07-09T07:10:00.000Z", "from": "2024-07-09T07:00:00.000Z" }, "refresh_interval": 60, "tiles": [ { "name": "Donut Tile", "description": "Description for the tile", "stream": "backend", "query": "SELECT level, COUNT(*) AS level_count FROM teststream GROUP BY level;", "visualization": { "visualization_type": "donut-chart", "circular_chart_config": { "name_key": "level", "value_key": "level_count" }, "size": "sm", "color_config": [{ "field_name": "level_count", "color_palette": "red"} ] } }, { "name": "Line Chart", "description": "Description for the tile", "stream": "backend", "query": "SELECT level, COUNT(*) AS level_count FROM teststream GROUP BY level;", "visualization": { "visualization_type": "line-chart", "graph_config": { "x_key": "level", "y_key": ["level_count"] }, "size": "sm", "color_config": [ { "field_name": "level_count", "color_palette": "red" } ] } } ] }

feature to support various operations of dashboards APIs
- POST /dashboards - to create dashboard
- GET /dashboards/<user-id> - to list dashboards for a user
- GET /dashboards/dashboard/<dashboard-id> - to get dashboard
- PUT /dashboards/dashboard/<dashboard-id> - to update dashboard
- DELETE /dashboards/dashboard/<dashboard-id> - to delete dashboard

sample JSON -
`
{
  "name": "Backend dashboard",
  "description": "This is a description for the dashboard",
  "user_id": "nikhil",
  "time_filter": {
    "to": "2024-07-09T07:10:00.000Z",
    "from": "2024-07-09T07:00:00.000Z"
  },
  "refresh_interval": 60,
  "tiles": [
    {
      "name": "Donut Tile",
      "description": "Description for the tile",
      "stream": "backend",
      "query": "SELECT level, COUNT(*) AS level_count FROM teststream GROUP BY level;",
      "visualization": {
        "visualization_type": "donut-chart",
        "circular_chart_config": {
          "name_key": "level",
          "value_key": "level_count"
        },
        "size": "sm",
        "color_config": [{
        "field_name": "level_count",
        "color_palette": "red"}
        ]
      }
    },
    {
      "name": "Line Chart",
      "description": "Description for the tile",
      "stream": "backend",
      "query": "SELECT level, COUNT(*) AS level_count FROM teststream GROUP BY level;",
      "visualization": {
        "visualization_type": "line-chart",
        "graph_config": {
          "x_key": "level",
          "y_key": ["level_count"]
        },
        "size": "sm",
        "color_config": [
            {
            "field_name": "level_count",
            "color_palette": "red"
            }
        ]
      }
    }
  ]
}
`
added new field to maintain the order of the tiles for dashboard
generate id for each tile in the dashboard
@nitisht nitisht merged commit 03b3226 into parseablehq:main Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants