mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
chore: fix errors
This commit is contained in:
1 parent
f7658ab167
commit
07ab76d26b
25 files changed
+56
-63
No files matched your search
@@ -2,13 +2,13 @@
|
||||
import { Layout, Typography, Input, Tag, Icon } from '@appwrite.io/pink-svelte';
|
||||
import { IconPencil } from '@appwrite.io/pink-icons-svelte';
|
||||
import { CustomId } from '$lib/components/index.js';
|
||||
import type { Region } from '$lib/sdk/billing';
|
||||
import { getFlagUrl } from '$lib/helpers/flag';
|
||||
import { isCloud } from '$lib/system.js';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let projectName: string;
|
||||
export let id: string;
|
||||
export let regions: Array<Region> = [];
|
||||
export let regions: Array<Models.ConsoleRegion> = [];
|
||||
export let region: string;
|
||||
export let showTitle = true;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { Card, Layout, Button } from '@appwrite.io/pink-svelte';
|
||||
import type { RegionList } from '$lib/sdk/billing';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID, Region } from '@appwrite.io/console';
|
||||
import { ID, Region, type Models } from '@appwrite.io/console';
|
||||
import Loading from './loading.svelte';
|
||||
import { BillingPlan, Dependencies } from '$lib/constants';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
@@ -18,7 +17,7 @@
|
||||
let startAnimation = false;
|
||||
let projectName = 'Appwrite project';
|
||||
let region = Region.Default;
|
||||
export let data: { regions: RegionList | null };
|
||||
export let data: { regions: Models.ConsoleRegionList | null };
|
||||
|
||||
async function createProject() {
|
||||
isLoading = true;
|
||||
|
||||
@@ -6,16 +6,15 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/state';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { ID, Region as ConsoleRegion } from '@appwrite.io/console';
|
||||
import { ID, Region as ConsoleRegion, type Models } from '@appwrite.io/console';
|
||||
import { createProject } from './wizard/store';
|
||||
import { Button } from '@appwrite.io/pink-svelte';
|
||||
import { base } from '$app/paths';
|
||||
import CreateProject from '$lib/layout/createProject.svelte';
|
||||
import { Modal } from '$lib/components';
|
||||
import type { Region } from '$lib/sdk/billing';
|
||||
|
||||
const teamId = page.params.organization;
|
||||
export let regions: Array<Region> = [];
|
||||
export let regions: Array<Models.ConsoleRegion> = [];
|
||||
export let showCreateProjectCloud: boolean;
|
||||
|
||||
async function onFinish() {
|
||||
|
||||
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ url, params, route, depends }) => {
|
||||
depends(Dependencies.MEMBERS);
|
||||
const page = getPage(url);
|
||||
const search = getSearch(url);
|
||||
const limit = getLimit('console', url, route, PAGE_LIMIT);
|
||||
const limit = getLimit(url, route, PAGE_LIMIT);
|
||||
const offset = pageToOffset(page, limit);
|
||||
|
||||
return {
|
||||
|
||||
+1
-4
@@ -14,9 +14,6 @@ export const load: PageLoad = async ({ params, url, route }) => {
|
||||
limit,
|
||||
logs: await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.databases.listDocumentLogs(params.database, params.collection, params.document, [
|
||||
Query.limit(limit),
|
||||
Query.offset(offset)
|
||||
])
|
||||
.teams.listLogs(params.team, [Query.limit(limit), Query.offset(offset)])
|
||||
};
|
||||
};
|
||||
@@ -58,7 +58,8 @@
|
||||
EmailTemplateType,
|
||||
EmailTemplateLocale
|
||||
} from '@appwrite.io/console';
|
||||
import { Accordion, Alert, Layout, Link, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { Accordion, Alert, Badge, Layout, Link, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -75,7 +76,7 @@
|
||||
|
||||
async function openEmail(type: string) {
|
||||
type === emailOpen ? (emailOpen = null) : (emailOpen = type);
|
||||
$emailTemplate = await loadEmailTemplate(data.project.$id, type, 'en');
|
||||
$emailTemplate = await loadEmailTemplate(page.params.project, type, 'en');
|
||||
$baseEmailTemplate = { ...$emailTemplate };
|
||||
}
|
||||
</script>
|
||||
@@ -91,7 +92,7 @@
|
||||
<Button
|
||||
compact
|
||||
slot="actions"
|
||||
href={`${base}/project-${data.project.region}-${data.project.$id}/settings/smtp`}>
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/settings/smtp`}>
|
||||
SMTP settings
|
||||
</Button>
|
||||
</Alert.Inline>
|
||||
@@ -183,7 +184,7 @@
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="actions">
|
||||
<Button
|
||||
href={`${base}/project-${data.project.region}-${data.project.$id}/settings/smtp`}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/settings/smtp`}
|
||||
secondary>
|
||||
SMTP settings
|
||||
</Button>
|
||||
|
||||
+21
-19
@@ -1,38 +1,40 @@
|
||||
import { Query } from '@appwrite.io/console';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { getLimit, getPage, getQuery, getSearch, pageToOffset } from '$lib/helpers/load';
|
||||
import { queries, queryParamToMap } from '$lib/components/filters';
|
||||
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import { getLimit, getPage, getQuery, getSearch, pageToOffset } from '$lib/helpers/load';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query } from '@appwrite.io/console';
|
||||
import type { PageLoad } from './$types';
|
||||
import { queryParamToMap, queries } from '$lib/components/filters';
|
||||
|
||||
export const load: PageLoad = async ({ params, url, route, depends }) => {
|
||||
depends(Dependencies.MESSAGING_TOPIC_SUBSCRIBERS);
|
||||
depends(Dependencies.USER_IDENTITIES);
|
||||
|
||||
const page = getPage(url);
|
||||
const limit = getLimit(url, route, PAGE_LIMIT);
|
||||
const offset = pageToOffset(page, limit);
|
||||
const search = getSearch(url);
|
||||
const query = getQuery(url);
|
||||
const search = getSearch(url);
|
||||
|
||||
const parsedQueries = queryParamToMap(query || '[]');
|
||||
queries.set(parsedQueries);
|
||||
|
||||
const identities = await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.users.listIdentities(
|
||||
[
|
||||
Query.equal('userId', params.user),
|
||||
Query.limit(limit),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc(''),
|
||||
...parsedQueries.values()
|
||||
],
|
||||
search
|
||||
);
|
||||
|
||||
return {
|
||||
offset,
|
||||
limit,
|
||||
search,
|
||||
query,
|
||||
subscribers: await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.messaging.listSubscribers(
|
||||
params.topic,
|
||||
[
|
||||
Query.limit(limit),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc(''),
|
||||
...parsedQueries.values()
|
||||
],
|
||||
search || undefined
|
||||
)
|
||||
search,
|
||||
identities
|
||||
};
|
||||
};
|
||||
@@ -15,7 +15,7 @@ export const load: PageLoad = async ({ url, route, depends, params, parent }) =>
|
||||
const page = getPage(url);
|
||||
const search = getSearch(url);
|
||||
const limit = getLimit(url, route, CARD_LIMIT);
|
||||
const view = getView(params.project, url, route, View.Grid);
|
||||
const view = getView(url, route, View.Grid);
|
||||
const offset = pageToOffset(page, limit);
|
||||
|
||||
// already loaded by parent.
|
||||
@@ -24,8 +24,8 @@ export const load: PageLoad = async ({ url, route, depends, params, parent }) =>
|
||||
const { databases, policies, lastBackups } = await fetchDatabasesAndBackups(
|
||||
limit,
|
||||
offset,
|
||||
search,
|
||||
params,
|
||||
search,
|
||||
currentPlan
|
||||
);
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
|
||||
const page = getPage(url);
|
||||
const search = getSearch(url);
|
||||
const limit = getLimit(url, route, CARD_LIMIT);
|
||||
const view = getView(params.project, url, route, View.Grid);
|
||||
const view = getView(url, route, View.Grid);
|
||||
const offset = pageToOffset(page, limit);
|
||||
const collections = await sdk
|
||||
.forProject(params.region, params.project)
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ export const load = async ({ params, url, route, depends, parent }) => {
|
||||
|
||||
const page = getPage(url);
|
||||
const limit = getLimit(url, route, PAGE_LIMIT);
|
||||
const view = getView(params.project, url, route, View.Grid);
|
||||
const view = getView(url, route, View.Grid);
|
||||
const offset = pageToOffset(page, limit);
|
||||
|
||||
let backups: BackupArchiveList = { total: 0, archives: [] };
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
|
||||
depends(Dependencies.DOCUMENTS);
|
||||
const page = getPage(url);
|
||||
const limit = getLimit(url, route, PAGE_LIMIT);
|
||||
const view = getView(params.project, url, route, View.Grid);
|
||||
const view = getView(url, route, View.Grid);
|
||||
const offset = pageToOffset(page, limit);
|
||||
const query = getQuery(url);
|
||||
|
||||
|
||||
+1
@@ -13,6 +13,7 @@
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Icon, Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { func } from '../store';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Confirm } from '$lib/components';
|
||||
import { func } from '../store';
|
||||
import { func } from './store';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
+1
@@ -8,6 +8,7 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { isValueOfStringEnum } from '$lib/helpers/types';
|
||||
import { Runtime, type Models } from '@appwrite.io/console';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let func: Models.Function;
|
||||
let buildCommand = func.commands;
|
||||
|
||||
+1
@@ -24,6 +24,7 @@
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { ConnectGit, ConnectRepoModal, RepositoryCard } from '$lib/components/git';
|
||||
import { isValueOfStringEnum } from '$lib/helpers/types';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let func: Models.Function;
|
||||
export let installations: Models.InstallationList;
|
||||
|
||||
+1
@@ -13,6 +13,7 @@
|
||||
import { upgradeURL } from '$lib/stores/billing';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let func: Models.Function;
|
||||
export let specs: Models.SpecificationList;
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import Onboard from '../overview/onboard.svelte';
|
||||
|
||||
$: projectId = page.params.project;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Console - Appwrite</title>
|
||||
</svelte:head>
|
||||
|
||||
<Onboard
|
||||
{projectId}
|
||||
platforms={page.data.project.platforms}
|
||||
pingCount={page.data.project.pingCount} />
|
||||
<Onboard platforms={page.data.project.platforms} pingCount={page.data.project.pingCount} />
|
||||
@@ -18,7 +18,7 @@ export const load: PageLoad = async ({ depends, url, route, params }) => {
|
||||
|
||||
const page = getPage(url);
|
||||
const search = getSearch(url);
|
||||
const view = getView(params.project, url, route, View.Grid);
|
||||
const view = getView(url, route, View.Grid);
|
||||
const limit = getLimit(url, route, CARD_LIMIT);
|
||||
const offset = pageToOffset(page, limit);
|
||||
const query = getQuery(url);
|
||||
|
||||
@@ -18,7 +18,7 @@ export const load: PageLoad = async ({ depends, url, route, params }) => {
|
||||
|
||||
const page = getPage(url);
|
||||
const search = getSearch(url);
|
||||
const view = getView(params.project, url, route, View.Grid);
|
||||
const view = getView(url, route, View.Grid);
|
||||
const limit = getLimit(url, route, PAGE_LIMIT);
|
||||
const offset = pageToOffset(page, limit);
|
||||
const query = getQuery(url);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
import { Badge, FloatingActionBar, Icon, Table, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { IconCheckCircle } from '@appwrite.io/pink-icons-svelte';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
export let projectId: string;
|
||||
export let platforms: Models.Platform[] = [];
|
||||
export let pingCount = 0;
|
||||
|
||||
|
||||
+4
-6
@@ -12,12 +12,10 @@ export const load: PageLoad = async ({ url, depends, params }) => {
|
||||
const siteId = url.searchParams.get('site');
|
||||
const deploymentId = url.searchParams.get('deployment');
|
||||
const [site, deployment, proxyRuleList] = await Promise.all([
|
||||
sdk.forProject(page.params.region, page.params.project).sites.get(siteId),
|
||||
sdk.forProject(params.region, params.project).sites.get(siteId),
|
||||
sdk.forProject(params.region, params.project).sites.getDeployment(siteId, deploymentId),
|
||||
sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.sites.getDeployment(siteId, deploymentId),
|
||||
sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.forProject(params.region, params.project)
|
||||
.proxy.listRules([
|
||||
Query.equal('type', RuleType.DEPLOYMENT),
|
||||
Query.equal('deploymentResourceType', DeploymentResourceType.SITE),
|
||||
@@ -33,7 +31,7 @@ export const load: PageLoad = async ({ url, depends, params }) => {
|
||||
proxyRuleList,
|
||||
repository: site?.installationId
|
||||
? await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.forProject(params.region, params.project)
|
||||
.vcs.getRepository(site.installationId, site.providerRepositoryId)
|
||||
: undefined
|
||||
};
|
||||
|
||||
+2
-2
@@ -12,10 +12,10 @@ export const load: PageLoad = async ({ params, depends, parent }) => {
|
||||
|
||||
const [deployment, proxyRuleList] = await Promise.all([
|
||||
sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.forProject(params.region, params.project)
|
||||
.sites.getDeployment(params.site, params.deployment),
|
||||
sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.forProject(params.region, params.project)
|
||||
.proxy.listRules([
|
||||
Query.equal('type', RuleType.DEPLOYMENT),
|
||||
Query.equal('deploymentId', params.deployment),
|
||||
|
||||
+1
-3
@@ -9,9 +9,7 @@ export const load: PageLoad = async ({ params }) => {
|
||||
? params.period
|
||||
: SiteUsageRange.ThirtyDays;
|
||||
try {
|
||||
return sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.sites.getUsage(params.site, period);
|
||||
return sdk.forProject(params.region, params.project).sites.getUsage(params.site, period);
|
||||
} catch (e) {
|
||||
error(e.code, e.message);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export const load: PageLoad = async ({ params }) => {
|
||||
? params.period
|
||||
: SiteUsageRange.ThirtyDays;
|
||||
try {
|
||||
return sdk.forProject(page.params.region, page.params.project).sites.listUsage(period);
|
||||
return sdk.forProject(params.region, params.project).sites.listUsage(period);
|
||||
} catch (e) {
|
||||
error(e.code, e.message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user