mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: Alert preference for deployment failures
This commit is contained in:
1 parent
20e5930ddf
commit
af257857c4
3 files changed
+44
No files matched your search
@@ -9,6 +9,7 @@ export type Account = Models.User<
|
||||
organization?: string;
|
||||
console: Models.Preferences;
|
||||
notificationPrefs: Record<string, NotificationPrefItem>;
|
||||
deploymentFailedEmailAlert: boolean;
|
||||
} & Record<string, string>
|
||||
>;
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<script>
|
||||
import { CardGrid } from "$lib/components";
|
||||
import { InputChoice } from "$lib/elements/forms";
|
||||
import { Container } from "$lib/layout";
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { Layout } from "@appwrite.io/pink-svelte";
|
||||
|
||||
let deploymentFailedEmailAlert = $user.prefs.deploymentFailedEmailAlert ?? true;
|
||||
|
||||
function toggleDeploymentFailedEmailAlert() {
|
||||
deploymentFailedEmailAlert = !deploymentFailedEmailAlert;
|
||||
const newPrefs = {
|
||||
...$user.prefs,
|
||||
deploymentFailedEmailAlert: deploymentFailedEmailAlert
|
||||
};
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
<CardGrid>
|
||||
<svelte:fragment slot="title">Email Alerts</svelte:fragment>
|
||||
Toggle email preferences to receive notifications when certain events occur.
|
||||
|
||||
<svelte:fragment slot="aside">
|
||||
<Layout.Stack gap="xl">
|
||||
<InputChoice
|
||||
on:change={toggleDeploymentFailedEmailAlert}
|
||||
type="switchbox"
|
||||
id="mfa"
|
||||
label="Deployment Failed"
|
||||
value={deploymentFailedEmailAlert} />
|
||||
</Layout.Stack>
|
||||
</svelte:fragment>
|
||||
</CardGrid>
|
||||
</Container>
|
||||
@@ -33,6 +33,11 @@
|
||||
title: 'Organizations',
|
||||
event: 'organizations',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/alerts`,
|
||||
title: 'Alerts',
|
||||
event: 'alerts',
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in new issue
Block a user