diff --git a/.env.example b/.env.example index 897876704..06149b167 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ VITE_APPWRITE_ENDPOINT= -VITE_GOOGLE_ANALYTICS= -VITE_SENTRY_DSN= \ No newline at end of file +VITE_GA_PROJECT= +VITE_SENTRY_DSN= +VITE_CONSOLE_MODE=self-hosted \ No newline at end of file diff --git a/README.md b/README.md index eceed7586..0dd094894 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ [](https://twitter.com/appwrite) [](https://appwrite.io) -
-  [Appwrite](https://appwrite.io) Console is the Graphical User Interface that developers interact with when accessing their Appwrite instance in the web browser. diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 1f77d0cc3..d169790ac 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -3,12 +3,13 @@ import googleAnalytics from '@analytics/google-analytics'; import { get } from 'svelte/store'; import { page } from '$app/stores'; import { user } from '$lib/stores/user'; +import { Mode } from '$lib/constants'; const analytics = Analytics({ app: 'appwrite', plugins: [ googleAnalytics({ - measurementIds: ['G-R4YJ9JN8L4'] + measurementIds: [import.meta.env.VITE_GA_PROJECT?.toString() || 'G-R4YJ9JN8L4'] }) ] }); @@ -48,6 +49,7 @@ function sendEventToGrowth(event: string, path: string, data: object = null): vo action: event, label: event, url: window.location.origin + path, + account: import.meta.env.VITE_CONSOLE_MODE?.toString() || Mode.SELF_HOSTED, data: { email, name, diff --git a/src/lib/constants.ts b/src/lib/constants.ts index b4942bebc..721c3db12 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -2,6 +2,11 @@ export const PAGE_LIMIT = 12; // default page limit export const CARD_LIMIT = 6; // default card limit export const INTERVAL = 5 * 60000; // default interval to check for feedback +export enum Mode { + CLOUD = 'mode:cloud', + SELF_HOSTED = 'mode:self-hosted' +} + export enum Dependencies { ORGANIZATION = 'dependency:organization', PROJECT = 'dependency:project', diff --git a/src/lib/helpers/array.ts b/src/lib/helpers/array.ts index cd7a923fb..12cde8c4b 100644 --- a/src/lib/helpers/array.ts +++ b/src/lib/helpers/array.ts @@ -3,6 +3,7 @@ export function intersection(arr1: unknown[], arr2: unknown[]) { const intersection = new Set(arr1.filter((elem) => set.has(elem))); return Array.from(intersection); } + export function difference(arr1: unknown[], arr2: unknown[]) { const set = new Set(arr2); const intersection = new Set(arr1.filter((elem) => !set.has(elem))); @@ -12,3 +13,17 @@ export function difference(arr1: unknown[], arr2: unknown[]) { export function symmetricDifference(arr1: unknown[], arr2: unknown[]) { return difference(arr1, arr2).concat(difference(arr2, arr1)); } + +/** + * Removes the element at the specified index from the array, and returns a new array. + * + * @export + * @template T + * @param {T[]} arr + * @param {number} index + * @returns {T[]} + */ +export function remove+ To use {provider.name} authentication in your application, first fill in this form. For more + info you can + visit the docs. +
+URI
++ To use {provider.name} authentication in your application, first fill in this form. For more + info you can + visit the docs. +
+URI
+{$user.email}
- {/if} - {#if $user.phone} -{$user.phone}
- {/if} -Joined: {toLocaleDateTime($user.registration)}
-- The user will be permanently deleted, including all data associated with this user. This - action is irreversible. -
-- {$user.email && $user.phone - ? [$user.email, $user.phone].join(',') - : $user.email || $user.phone} -
-+ The user will be permanently deleted, including all data associated with this user. This + action is irreversible. +
++ {$user.email && $user.phone + ? [$user.email, $user.phone].join(',') + : $user.email || $user.phone} +
++ Enter a new password. A password must contain at least 8 characters. +
++ You can update your user preferences by storing information on the user's objects so + they can easily be shared across devices and sessions. +
+{$user.email}
+ {/if} + {#if $user.phone} +{$user.phone}
+ {/if} +Joined: {toLocaleDateTime($user.registration)}
+