diff --git a/src/lib/components/chat.svelte b/src/lib/components/chat.svelte new file mode 100644 index 000000000..c8877ba23 --- /dev/null +++ b/src/lib/components/chat.svelte @@ -0,0 +1,98 @@ + + +
+ +
+ + + + Chat + { + showChat = false; + }} + > + + + + + +
+ +
+ + + + +
+
+
+
+
+
+
+ + diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index d827c596f..c49202c02 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -81,3 +81,4 @@ export { default as Sidebar } from './sidebar.svelte'; export { default as BottomSheet } from './bottom-sheet/index'; export { default as Confirm } from './confirm.svelte'; export { default as UsageCard } from './usageCard.svelte'; +export { default as Chat } from './chat.svelte'; diff --git a/src/lib/components/studio/sidebarProject.svelte b/src/lib/components/studio/sidebarProject.svelte index 309b23d82..697324d21 100644 --- a/src/lib/components/studio/sidebarProject.svelte +++ b/src/lib/components/studio/sidebarProject.svelte @@ -5,35 +5,45 @@ IconCog, IconDatabase, IconFolder, + IconSparkles, IconTemplate, IconUserGroup } from '@appwrite.io/pink-icons-svelte'; import { base } from '$app/paths'; export let project; + export let showChat; diff --git a/src/lib/layout/cover.svelte b/src/lib/layout/cover.svelte index fff0765ea..b9db2553a 100644 --- a/src/lib/layout/cover.svelte +++ b/src/lib/layout/cover.svelte @@ -1,5 +1,6 @@ -
-
- - - - +{#if isStudio} + + +{:else} +
+
+ + + + +
-
+{/if} - diff --git a/src/routes/(studio)/+layout.ts b/src/routes/(studio)/+layout.ts deleted file mode 100644 index d51edd31e..000000000 --- a/src/routes/(studio)/+layout.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Dependencies } from '$lib/constants'; -import type { Plan } from '$lib/sdk/billing'; -import type { Tier } from '$lib/stores/billing'; -import { sdk } from '$lib/stores/sdk'; -import { isCloud } from '$lib/system'; -import type { LayoutLoad } from './$types'; -import { Query } from '@appwrite.io/console'; - -export const load: LayoutLoad = async ({ params, fetch, depends, parent }) => { - await parent(); - depends(Dependencies.RUNTIMES); - depends(Dependencies.CONSOLE_VARIABLES); - depends(Dependencies.ORGANIZATION); - - const prefs = await sdk.forConsole.account.getPrefs(); - - const { endpoint, project } = sdk.forConsole.client.config; - const versionPromise = fetch(`${endpoint}/health/version`, { - headers: { - 'X-Appwrite-Project': project - } - }).then((response) => response.json() as { version?: string }); - - const variablesPromise = sdk.forConsole.console.variables(); - - const [data, variables] = await Promise.all([versionPromise, variablesPromise]); - - let plansInfo = new Map(); - if (isCloud) { - const plansArray = await sdk.forConsole.billing.getPlansInfo(); - plansInfo = plansArray.plans.reduce((map, plan) => { - map.set(plan.$id as Tier, plan); - return map; - }, new Map()); - } - - const organizations = !isCloud - ? await sdk.forConsole.teams.list() - : await sdk.forConsole.billing.listOrganization(); - - let projects = []; - let currentOrgId = params.organization ? params.organization : prefs.organization; - - if (!currentOrgId && organizations.teams.length > 0) { - currentOrgId = organizations.teams[0].$id; - } - if (currentOrgId) { - const orgProjects = await sdk.forConsole.projects.list([ - Query.equal('teamId', currentOrgId), - Query.limit(100), - Query.orderDesc('$updatedAt') - ]); - projects = orgProjects.projects.length > 0 ? orgProjects.projects : []; - } - - const selectedOrganizationId = - params && params.organization ? params.organization : prefs.organization; - - return { - consoleVariables: variables, - version: data?.version ?? null, - plansInfo, - roles: [], - scopes: [], - projects: projects, - currentProjectId: params.project ?? '', - organizations: organizations, - currentOrganization: organizations.teams.find((org) => org.$id === selectedOrganizationId) - }; -}; diff --git a/src/routes/(studio)/org-[organization]/+page.svelte b/src/routes/(studio)/org-[organization]/+page.svelte deleted file mode 100644 index b97b46e7c..000000000 --- a/src/routes/(studio)/org-[organization]/+page.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Projects - Create project - - - - - - {#each data.projects as project} - - {/each} - - - diff --git a/src/routes/(studio)/proj-[project]/+page.svelte b/src/routes/(studio)/proj-[project]/+page.svelte deleted file mode 100644 index 625bf240e..000000000 --- a/src/routes/(studio)/proj-[project]/+page.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - - -
- - - Chat - - - Phasellus a ultricies nulla. Proin tristique aliquam dui. Phasellus porta - sodales justo, et feugiat ligula pulvinar sed. Morbi et nulla hendrerit, - pellentesque est sodales, euismod magna. Suspendisse vel massa arcu. Nulla - ultrices sit amet metus ac euismod. Curabitur ultrices aliquet libero, a - pharetra orci tristique in. Etiam egestas fermentum justo ut semper. Sed - vulputate eros erat, ac sollicitudin nulla condimentum volutpat. Sed vulputate - est ante. - - - -
- Iframe -
- - diff --git a/src/routes/+page.ts b/src/routes/+page.ts index b7e139a94..5df877230 100644 --- a/src/routes/+page.ts +++ b/src/routes/+page.ts @@ -41,9 +41,8 @@ export const load: PageLoad = async ({ parent, url }) => { } else { redirect( 303, - isStudio - ? `${base}/org-${teamId}${url.search}` - : `${base}/organization-${teamId}${url.search}` + + `${base}/organization-${teamId}${url.search}` ); } } else {