1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 21:17:59 +00:00

Show spinner

This commit is contained in:
Romein van Buren 2023-06-24 10:28:49 +02:00
parent c284cb4cfc
commit 51897adf8d
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -12,9 +12,12 @@
let result = {}; let result = {};
let copySucceeded = false; let copySucceeded = false;
let timeout; let timeout;
let busy = false;
async function run() { async function run() {
busy = true;
result = await collection.executeShellScript(script); result = await collection.executeShellScript(script);
busy = false;
} }
async function copyErrorDescription() { async function copyErrorDescription() {
@ -34,7 +37,9 @@
</label> </label>
<div class="output"> <div class="output">
{#if result.errorTitle || result.errorDescription} {#if busy}
<BlankState icon="loading" label="Executing…" />
{:else if result.errorTitle || result.errorDescription}
<BlankState title={result.errorTitle} label={result.errorDescription} icon="!"> <BlankState title={result.errorTitle} label={result.errorDescription} icon="!">
<button class="button-small" on:click={copyErrorDescription}> <button class="button-small" on:click={copyErrorDescription}>
<Icon name={copySucceeded ? 'check' : 'clipboard'} /> Copy error message <Icon name={copySucceeded ? 'check' : 'clipboard'} /> Copy error message