django-sql-dashboard icon indicating copy to clipboard operation
django-sql-dashboard copied to clipboard

Auto-refreshing cells

Open simonw opened this issue 3 years ago • 1 comments

Since a cell has a SQL query, and is tied to a server-side template, it wouldn't be too hard to provide a mechanism whereby the cell periodically polls the server to refresh itself.

simonw avatar Mar 15 '21 22:03 simonw

I think I'd keep this off by default.

This could work by JavaScript adding a "refresh every 10s / 60s / 5m" UI widget to each cell - when selected, every x seconds a POST request is made back to the server with just the SQL for that cell (or maybe the cell reference if it's a saved dashboard - support this just for saved dashboards may be easier).

The backend knows how to return the rendered widget template for just this one item, which can then be innerHTML updated on the page.

simonw avatar May 08 '21 01:05 simonw