diff --git a/deno.json b/deno.json index 62995fd..c9654c0 100644 --- a/deno.json +++ b/deno.json @@ -11,7 +11,9 @@ "$http/": "./src/utils/http/", "$api": "./src/utils/api/request.ts", "$utils/": "./src/utils/", - "@std/assert": "jsr:@std/assert@^1.0.0" + "$notifications/": "./src/notifications/", + "@std/assert": "jsr:@std/assert@^1.0.0", + "simple-icons": "npm:simple-icons@^15.17.0" }, "tasks": { "dev": "APP_BASE_PATH=./temp vite dev", diff --git a/package.json b/package.json index e1c0c6a..f377332 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dependencies": { "@jsr/db__sqlite": "^0.12.0", "lucide-svelte": "^0.546.0", + "simple-icons": "^15.17.0", "sveltekit-adapter-deno": "^0.16.1" }, "devDependencies": { diff --git a/src/components/notifications/DiscordConfiguration.svelte b/src/components/notifications/DiscordConfiguration.svelte new file mode 100644 index 0000000..9b5fd9d --- /dev/null +++ b/src/components/notifications/DiscordConfiguration.svelte @@ -0,0 +1,109 @@ + + +
+ {#if mode === 'edit'} + Leave blank to keep existing webhook URL + {:else} + Get this from Server Settings → Integrations → Webhooks in Discord + {/if} +
++ Custom username for the webhook bot +
++ Custom avatar image for the webhook bot +
++ Mention @here in notifications to alert online users +
+| + Time + | ++ Service + | ++ Type + | ++ Title + | ++ Status + | +
|---|---|---|---|---|
| + {formatDateTime(record.sent_at)} + | + + ++ {getServiceName(record.service_id)} + | + + ++ + {formatNotificationType(record.notification_type)} + + | + + ++ {record.title} + | + + ++ {#if record.status === 'success'} + + Success + + {:else} + + Failed + + {/if} + | +
| + No notification history available yet. + | +||||
+ Manage notification services and delivery settings +
+| + Service + | ++ Type + | ++ Status + | ++ Enabled Types + | ++ Statistics + | ++ Actions + | +
|---|---|---|---|---|---|
| + {service.name} + | + + +
+
+ {#if service.service_type === 'discord'}
+
+ {:else}
+
+ |
+
+
+ + + | + + +
+
+ {#each getEnabledTypes(service.enabled_types) as type}
+
+ {formatNotificationType(type)}
+
+ {:else}
+ None
+ {/each}
+
+ |
+
+
+
+ {#if service.successCount + service.failedCount > 0}
+
+ {service.successCount} sent
+ •
+ {service.failedCount} failed
+ •
+ {formatSuccessRate(service.successRate)}
+
+ {:else}
+ No notifications sent
+ {/if}
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+
| + No notification services configured. Click "Add Service" to get started. + | +|||||
+ Update notification service configuration +
++ Configure a new notification service +
+