Repository navigation
Conversation
|
@lovasoa can you take a look to see if it's ok in principle before I start on documentation? |
| The name of a [spinner](https://tabler.io/docs/components/spinners) (from tabler.io). | ||
| Default is "spinner-border". | ||
| Set to the empty string to disable the spinner - e.g. to display only progress | ||
| updates. |
There was a problem hiding this comment.
I've noticed this whole approach doesn't work inside run_sql for some reason. So I should note that 'loader-start' component should be selected before descending into run_sql.
There was a problem hiding this comment.
Yes, run_sql is a function, it returns a single json value all at once, it can't stream its results.
There was a problem hiding this comment.
I thought as much but didn't want to assume. It's good to have the clarification.
Fix spinner defaults
1c3024a to
0bd66fb
Compare
| <div {{#if id}}id="{{id}}"{{/if}} class="sqlpage-loader-start"> | ||
| <div class="sqlpage-loader-container"> | ||
| <span class="{{default spinner "spinner-border"}} | ||
| {{#if size}}spinner-border-{{size}}{{/if}} | ||
| {{#if color}}text-{{color}}{{/if}}"> | ||
| </span> |
There was a problem hiding this comment.
errors between loader-start and loader-stop show up in the spinner's box
There was a problem hiding this comment.
Yeah, I knew about this one. I didn't even begin to think about how to solve that... lol, just make sure it doesn't error.
There was a problem hiding this comment.
I think you can fix it by closing the <div>. something like
<div {{#if id}}id="{{id}}"{{/if}} class="sqlpage-loader" role="status">
<span class="{{default spinner "spinner-border"}} {{#if color}}text-{{color}}{{/if}}"></span>
</div>There was a problem hiding this comment.
I could be forgetting, but I thought the whole hack here was leaving the div open so the spinner disappears when it's closed... My CSS evolved over time though, and it looks as though closing the div should work.
I just recall leaving it open was important for some reason.
It's closed in the sqlpage-loader-stop element.
| {{~#if (not percent)}} progress-bar-indeterminate{{/if}} | ||
| {{~#if color}} bg-{{color}}{{/if}}" | ||
| role="progressbar" | ||
| aria-valuenow="{{percent}}" | ||
| {{~#if percent}}style="width: {{percent}}%; display: block"{{/if}} |
There was a problem hiding this comment.
SELECT 'progress' AS component, 0 AS percent renders progress-bar-indeterminate because of an improper null check
| {{~#if stage}} | ||
| <br> | ||
| <label for="sqlpage-loading-{{default stage "progress"}}">{{stage}}</label> | ||
| {{/if}} |
There was a problem hiding this comment.
labels don't work on divs iirc
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/label
| -- Disable actix-web compression middleware: | ||
| -- https://github.com/actix/actix-web/issues/3410 | ||
| SELECT 'http_header' AS component, 'Identity' AS "Content-Encoding"; | ||
|
|
There was a problem hiding this comment.
do we need this still? actix/actix-web#341 is closed
There was a problem hiding this comment.
It's not immediately obvious to me how actix/actix-web#341 is related.
There was a problem hiding this comment.
ope, sorry missed a 0 at the end
There was a problem hiding this comment.
I implemented this not as a work around for some buffering issue, but because I have some legitimately long running queries so the spinner helps indicate something is happening.
There was a problem hiding this comment.
sure, but its fixed upstream now. I think the better approach would be to update the actix-web dependency and use the upstream fix :)
There was a problem hiding this comment.
I misunderstood your comment at the first. My bad.
There was a problem hiding this comment.
nw, thanks for the PR, excited to see the next revision :)
please re-request review when ready
|
I switched the pr to draft, @djyotta feel free to switch it back when ready |
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 2 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 5045a4f | Docs | View more details | Give us feedback! |
Closes #435