Skip to content

#435: show spinner indicating page is loading #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
no spinner if not specified
  • Loading branch information
Daniel Sheffield authored and Daniel Sheffield committed Jun 24, 2024
commit a98b39bb20a2512f16f3039a750aa902375c2cbd
6 changes: 4 additions & 2 deletions examples/show-progress/go.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SELECT 'shell' AS component, 'light' AS theme;

-- can disable the spinner to show only progress bar
SELECT 'loader-start' AS component, 'non-existent-class' AS spinner;
SELECT 'loader-start' AS component, NULL AS spinner;

SELECT 'progress' AS component,
NULL AS percent,
Expand All @@ -8,6 +10,6 @@ SELECT 'progress' AS component,
'Working on it' AS stage;
SELECT sqlpage.exec('sleep', '3');

SELECT 'loader-stop' AS component, NULL AS spinner;
SELECT 'loader-stop' AS component;

SELECT 'text' AS component, 'Processing complete.' AS contents;
9 changes: 4 additions & 5 deletions examples/show-progress/index.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
SELECT 'shell' AS component,
'dark' AS theme;
SELECT 'shell' AS component, 'dark' AS theme;

SELECT 'loader-start' AS component,
-- default is "spinner-border"
"spinner-grow text-red" AS spinner;
-- pick from the tabler spinners: https://tabler.io/docs/components/spinners
"spinner-border spinner-border-sm text-red" AS spinner;

SELECT 'progress' AS component,
'sm' AS size,
Expand Down Expand Up @@ -49,4 +48,4 @@ SELECT 'button' AS component;
SELECT 'Go' AS title, '/go.sql' AS link;

-- can use progress on it's own
SELECT 'progress' AS component, 'Waiting for user' AS stage;
SELECT 'progress' AS component, 'sm' AS size, 'Waiting for user' AS stage;
2 changes: 1 addition & 1 deletion sqlpage/templates/loader-start.handlebars
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<div {{#if id}}id="{{id}}"{{/if}} class="sqlpage-loader-start">
<span class="{{default spinner "spinner-border"}}"></span>
{{#if spinner}}<span class="{{spinner}}"></span>{{/if}}