mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
more fixes
This commit is contained in:
@@ -41,7 +41,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
|
||||
// organization can be null if not in the filtered list!
|
||||
const includedInBasePlans = plansInfo.has(organization?.billingPlanId);
|
||||
|
||||
const [org, rawRegionalConsoleVariables, rolesResult, , platformList, keyList] =
|
||||
const [org, rawRegionalConsoleVariables, rolesResult, platformList, keyList] =
|
||||
await Promise.all([
|
||||
!organization
|
||||
? // TODO: @itznotabug - teams.get with Models.Organization?
|
||||
@@ -55,10 +55,9 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
|
||||
organizationId: project.teamId
|
||||
})
|
||||
: null,
|
||||
|
||||
loadAvailableRegions(project.teamId),
|
||||
projectSdk.listPlatforms({ queries: [Query.limit(1)] }),
|
||||
projectSdk.listKeys({ queries: [Query.limit(1)] })
|
||||
projectSdk.listKeys({ queries: [Query.limit(1)] }),
|
||||
loadAvailableRegions(project.teamId)
|
||||
]);
|
||||
|
||||
const regionalConsoleVariables = normalizeConsoleVariables(rawRegionalConsoleVariables);
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { writable } from 'svelte/store';
|
||||
import Scopes from '../api-keys/scopes.svelte';
|
||||
import { ID, type ProjectKeyScopes as ScopesType } from '@appwrite.io/console';
|
||||
import ScopesSelector from '../api-keys/scopes.svelte';
|
||||
import { ID, type ProjectKeyScopes } from '@appwrite.io/console';
|
||||
import { page } from '$app/state';
|
||||
import { copy } from '$lib/helpers/copy';
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
let formComponent: Form;
|
||||
let isSubmitting = writable(false);
|
||||
|
||||
let scopes: ScopesType[] = [];
|
||||
let scopes: ProjectKeyScopes[] = [];
|
||||
let name = '';
|
||||
let expire: string | null = null;
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
Choose which permission scopes to grant your application. It is best
|
||||
practice to allow only the permissions you need to meet your project goals.
|
||||
</Typography.Text>
|
||||
<Scopes bind:scopes />
|
||||
<ScopesSelector bind:scopes />
|
||||
</Layout.Stack>
|
||||
</Fieldset>
|
||||
</Layout.Stack>
|
||||
|
||||
+5
-5
@@ -12,16 +12,16 @@
|
||||
import { project } from '../../store';
|
||||
import Delete from './delete.svelte';
|
||||
import UpdateExpirationDate from './updateExpirationDate.svelte';
|
||||
import type { Models, ProjectKeyScopes as ScopesType } from '@appwrite.io/console';
|
||||
import type { Models, ProjectKeyScopes } from '@appwrite.io/console';
|
||||
import { symmetricDifference } from '$lib/helpers/array';
|
||||
import Scopes from '../api-keys/scopes.svelte';
|
||||
import ScopesSelector from '../api-keys/scopes.svelte';
|
||||
import { InteractiveText, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
export let key: Models.DevKey | Models.Key;
|
||||
export let keyType: 'api' | 'dev' = 'api';
|
||||
|
||||
let name: string = null;
|
||||
let scopes: ScopesType[] = null;
|
||||
let scopes: ProjectKeyScopes[] = null;
|
||||
|
||||
let showDelete = false;
|
||||
const isApiKey = keyType === 'api';
|
||||
@@ -32,7 +32,7 @@
|
||||
onMount(() => {
|
||||
name ??= key.name;
|
||||
if (isApiKey) {
|
||||
scopes ??= (key as Models.Key).scopes as ScopesType[];
|
||||
scopes ??= (key as Models.Key).scopes as ProjectKeyScopes[];
|
||||
}
|
||||
});
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
to allow only the permissions you need to meet your project goals.
|
||||
<svelte:fragment slot="aside">
|
||||
{#if scopes !== null}
|
||||
<Scopes bind:scopes />
|
||||
<ScopesSelector bind:scopes />
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import Details from './details.svelte';
|
||||
import ExportModal from './exportModal.svelte';
|
||||
import { readOnly } from '$lib/stores/billing';
|
||||
import { ID, ProjectKeyScopes as Scopes, type Models } from '@appwrite.io/console';
|
||||
import { ID, ProjectKeyScopes, type Models } from '@appwrite.io/console';
|
||||
import { canWriteProjects } from '$lib/stores/roles';
|
||||
import {
|
||||
IconCloud,
|
||||
@@ -92,23 +92,23 @@
|
||||
keyId: ID.unique(),
|
||||
name: `[AUTO-GENERATED] Migration ${new Date().toISOString()}`,
|
||||
scopes: [
|
||||
Scopes.UsersRead,
|
||||
Scopes.TeamsRead,
|
||||
Scopes.DatabasesRead,
|
||||
Scopes.CollectionsRead /* legacy */,
|
||||
Scopes.AttributesRead /* legacy */,
|
||||
Scopes.IndexesRead,
|
||||
Scopes.DocumentsRead /* legacy */,
|
||||
Scopes.TablesRead,
|
||||
Scopes.ColumnsRead,
|
||||
Scopes.RowsRead,
|
||||
Scopes.FilesRead,
|
||||
Scopes.BucketsRead,
|
||||
Scopes.FunctionsRead,
|
||||
Scopes.ExecutionsRead,
|
||||
Scopes.LocaleRead,
|
||||
Scopes.AvatarsRead,
|
||||
Scopes.HealthRead
|
||||
ProjectKeyScopes.UsersRead,
|
||||
ProjectKeyScopes.TeamsRead,
|
||||
ProjectKeyScopes.DatabasesRead,
|
||||
ProjectKeyScopes.CollectionsRead /* legacy */,
|
||||
ProjectKeyScopes.AttributesRead /* legacy */,
|
||||
ProjectKeyScopes.IndexesRead,
|
||||
ProjectKeyScopes.DocumentsRead /* legacy */,
|
||||
ProjectKeyScopes.TablesRead,
|
||||
ProjectKeyScopes.ColumnsRead,
|
||||
ProjectKeyScopes.RowsRead,
|
||||
ProjectKeyScopes.FilesRead,
|
||||
ProjectKeyScopes.BucketsRead,
|
||||
ProjectKeyScopes.FunctionsRead,
|
||||
ProjectKeyScopes.ExecutionsRead,
|
||||
ProjectKeyScopes.LocaleRead,
|
||||
ProjectKeyScopes.AvatarsRead,
|
||||
ProjectKeyScopes.HealthRead
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
+23
-23
@@ -10,7 +10,7 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { ID, ProjectKeyScopes as Scopes } from '@appwrite.io/console';
|
||||
import { ID, ProjectKeyScopes } from '@appwrite.io/console';
|
||||
|
||||
export let show = false;
|
||||
|
||||
@@ -94,28 +94,28 @@
|
||||
keyId: ID.unique(),
|
||||
name: `[AUTO-GENERATED] Migration ${new Date().toISOString()}`,
|
||||
scopes: [
|
||||
Scopes.UsersRead,
|
||||
Scopes.TeamsRead,
|
||||
Scopes.DatabasesRead,
|
||||
Scopes.CollectionsRead /* legacy */,
|
||||
Scopes.AttributesRead /* legacy */,
|
||||
Scopes.IndexesRead,
|
||||
Scopes.DocumentsRead /* legacy */,
|
||||
Scopes.TablesRead,
|
||||
Scopes.ColumnsRead,
|
||||
Scopes.RowsRead,
|
||||
Scopes.FilesRead,
|
||||
Scopes.BucketsRead,
|
||||
Scopes.FunctionsRead,
|
||||
Scopes.ExecutionsRead,
|
||||
Scopes.SitesRead,
|
||||
Scopes.ProvidersRead,
|
||||
Scopes.TopicsRead,
|
||||
Scopes.SubscribersRead,
|
||||
Scopes.MessagesRead,
|
||||
Scopes.LocaleRead,
|
||||
Scopes.AvatarsRead,
|
||||
Scopes.HealthRead
|
||||
ProjectKeyScopes.UsersRead,
|
||||
ProjectKeyScopes.TeamsRead,
|
||||
ProjectKeyScopes.DatabasesRead,
|
||||
ProjectKeyScopes.CollectionsRead /* legacy */,
|
||||
ProjectKeyScopes.AttributesRead /* legacy */,
|
||||
ProjectKeyScopes.IndexesRead,
|
||||
ProjectKeyScopes.DocumentsRead /* legacy */,
|
||||
ProjectKeyScopes.TablesRead,
|
||||
ProjectKeyScopes.ColumnsRead,
|
||||
ProjectKeyScopes.RowsRead,
|
||||
ProjectKeyScopes.FilesRead,
|
||||
ProjectKeyScopes.BucketsRead,
|
||||
ProjectKeyScopes.FunctionsRead,
|
||||
ProjectKeyScopes.ExecutionsRead,
|
||||
ProjectKeyScopes.SitesRead,
|
||||
ProjectKeyScopes.ProvidersRead,
|
||||
ProjectKeyScopes.TopicsRead,
|
||||
ProjectKeyScopes.SubscribersRead,
|
||||
ProjectKeyScopes.MessagesRead,
|
||||
ProjectKeyScopes.LocaleRead,
|
||||
ProjectKeyScopes.AvatarsRead,
|
||||
ProjectKeyScopes.HealthRead
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user