-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close fwdata file when leaving the editor (#925)
* close fwdata project when the client disconnects, notify all clients in the group that the project is closed. * add button to navigate home from project view * setup client side notifications * only log auth warnings * fix bug where the home button wouldn't show correctly which was caused by dynamically rendering it with #if
- Loading branch information
Showing
13 changed files
with
124 additions
and
11 deletions.
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
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
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
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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information" | ||
"Default": "Information", | ||
"LocalWebApp.Auth.LoggerAdapter": "Warning", | ||
} | ||
} | ||
} |
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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
frontend/viewer/src/lib/notifications/NotificationOutlet.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,32 @@ | ||
<script lang="ts"> | ||
import {AppNotification} from './notifications'; | ||
import {Notification, Icon} from 'svelte-ux'; | ||
import { | ||
mdiAlert, | ||
mdiAlertCircleOutline, | ||
mdiCheckCircleOutline, | ||
mdiInformationOutline | ||
} from '@mdi/js'; | ||
const notifications = AppNotification.notifications; | ||
</script> | ||
<div class="fixed bottom-0 z-50 flex flex-col gap-2 p-4 w-full overflow-y-auto"> | ||
{#each $notifications as notification} | ||
<div class="w-[400px] mx-auto"> | ||
<Notification open closeIcon> | ||
<div slot="icon"> | ||
{#if notification.type === 'success'} | ||
<Icon path={mdiCheckCircleOutline} size="1.5rem" class="text-success"/> | ||
{:else if notification.type === 'error'} | ||
<Icon path={mdiAlert} size="1.5rem" class="text-danger"/> | ||
{:else if notification.type === 'info'} | ||
<Icon path={mdiInformationOutline} size="1.5rem" class="text-info"/> | ||
{:else if notification.type === 'warning'} | ||
<Icon path={mdiAlertCircleOutline} size="1.5rem" class="text-warning"/> | ||
{/if} | ||
</div> | ||
<div slot="title">{notification.message}</div> | ||
</Notification> | ||
</div> | ||
{/each} | ||
</div> |
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,21 @@ | ||
import {writable, type Writable, type Readable, readonly} from 'svelte/store'; | ||
|
||
export class AppNotification { | ||
private static _notifications: Writable<AppNotification[]> = writable([]); | ||
public static get notifications(): Writable<AppNotification[]> { | ||
return this._notifications; | ||
} | ||
public static display(message: string, type: 'success' | 'error' | 'info' | 'warning', timeout: 'short' | 'long' | number = 'short') { | ||
const notification = new AppNotification(message, type); | ||
this._notifications.update(notifications => [...notifications, notification]); | ||
if (timeout === -1) return; | ||
if (typeof timeout === 'string') { | ||
timeout = timeout === 'short' ? 5000 : 30000; | ||
} | ||
setTimeout(() => { | ||
this._notifications.update(notifications => notifications.filter(n => n !== notification)); | ||
}, timeout); | ||
} | ||
|
||
private constructor(public message: string, public type: 'success' | 'error' | 'info' | 'warning') {} | ||
} |
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