-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2713c3c
commit 5d6c817
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
web-admin/src/features/projects/status/RefreshConfirmDialog.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script lang="ts"> | ||
import { | ||
AlertDialog, | ||
AlertDialogContent, | ||
AlertDialogDescription, | ||
AlertDialogFooter, | ||
AlertDialogHeader, | ||
AlertDialogTitle, | ||
AlertDialogTrigger, | ||
} from "@rilldata/web-common/components/alert-dialog/index.js"; | ||
import { Button } from "@rilldata/web-common/components/button/index.js"; | ||
export let open = false; | ||
export let onRefresh: () => void; | ||
async function handleRefresh() { | ||
try { | ||
onRefresh(); | ||
open = false; | ||
} catch (error) { | ||
console.error("Failed to refresh resource:", error); | ||
} | ||
} | ||
</script> | ||
|
||
<AlertDialog bind:open> | ||
<AlertDialogTrigger asChild> | ||
<div class="hidden"></div> | ||
</AlertDialogTrigger> | ||
<AlertDialogContent> | ||
<AlertDialogHeader> | ||
<AlertDialogTitle>Refresh all sources and models?</AlertDialogTitle> | ||
<AlertDialogDescription> | ||
<div class="mt-1"> | ||
This will refresh all sources and models in the project. | ||
</div> | ||
</AlertDialogDescription> | ||
</AlertDialogHeader> | ||
<AlertDialogFooter> | ||
<Button | ||
type="plain" | ||
on:click={() => { | ||
open = false; | ||
}}>Cancel</Button | ||
> | ||
<Button type="primary" on:click={handleRefresh}>Yes, refresh</Button> | ||
</AlertDialogFooter> | ||
</AlertDialogContent> | ||
</AlertDialog> |