From 5fe003bcbf6459c6a818060d03b6b923cdfd1d26 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sat, 1 Feb 2025 21:06:01 +1100 Subject: [PATCH] Add loading icons to sql plot and add clear button to results container --- templates/partials/sql_explorer/results.html | 63 ++++++++++++------- .../partials/sql_explorer/sql_query.html | 31 ++++++++- 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/templates/partials/sql_explorer/results.html b/templates/partials/sql_explorer/results.html index 1974cd0..a273932 100644 --- a/templates/partials/sql_explorer/results.html +++ b/templates/partials/sql_explorer/results.html @@ -1,26 +1,43 @@ -{% if error %} -
- Error: {{ error }} -
-{% endif %} +{% if error or results %} +
+ + -{% if results %} - - - - {% for col in columns %} - + + {% if error %} +
+ Error: {{ error }} +
+ {% endif %} + + {% if results %} +
{{ col }}
+ + + {% for col in columns %} + + {% endfor %} + + + + {% for row in results %} + + {% for col in columns %} + + {% endfor %} + {% endfor %} - - - - {% for row in results %} - - {% for col in columns %} - - {% endfor %} - - {% endfor %} - -
{{ col }}
{{ row[col] }}
{{ row[col] }}
+ + + {% endif %} +
{% endif %} \ No newline at end of file diff --git a/templates/partials/sql_explorer/sql_query.html b/templates/partials/sql_explorer/sql_query.html index 518d6f4..465c4b8 100644 --- a/templates/partials/sql_explorer/sql_query.html +++ b/templates/partials/sql_explorer/sql_query.html @@ -42,8 +42,9 @@ @@ -69,14 +81,15 @@ +
-
+

Saved Queries

@@ -118,7 +131,7 @@ + hx-trigger="click" hx-indicator="#sql-plot-results-loader-{{ saved.id }}"> @@ -126,6 +139,18 @@ d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" /> Plot + + +
+ + + + +