Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import { consoleVariables } from '$routes/(console)/store';
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
import { InvalidFileType, removeFile } from '$lib/helpers/files';
import { humanFileSize } from '$lib/helpers/sizeConvertion';
import { isCloud } from '$lib/system';
import { currentPlan } from '$lib/stores/organization';

export let data;
let showExitModal = false;
Expand All @@ -29,7 +32,7 @@

let name = 'My website';
let id = ID.unique();
let domain = id;
let domain = `${id}.${$consoleVariables._APP_DOMAIN_SITES}`;
let framework: Models.Framework =
data.frameworks.frameworks?.find((f) => f.key === 'other') ??
data.frameworks.frameworks?.[0];
Expand All @@ -40,9 +43,22 @@
let variables: Partial<Models.Variable>[] = [];
let files: FileList;

$: maxSize =
isCloud && $currentPlan
? $currentPlan.deploymentSize * 1000000
: $consoleVariables._APP_COMPUTE_SIZE_LIMIT; // already in MB

$: readableMaxSize = humanFileSize(maxSize);

async function create() {
try {
domain = await buildVerboseDomain(name, $organization.name, $project.name, id);
domain = await buildVerboseDomain(
$consoleVariables._APP_DOMAIN_SITES,
name,
$organization.name,
$project.name,
id
);

const fr = Object.values(Framework).find((f) => f === framework.key);
const buildRuntime = Object.values(BuildRuntime).find(
Expand Down Expand Up @@ -167,7 +183,7 @@
<Upload.Dropzone
extensions={['gz', 'tar']}
bind:files
maxSize={10000000}
{maxSize}
required
on:invalid={handleInvalid}>
<Layout.Stack alignItems="center" gap="s">
Expand All @@ -192,7 +208,8 @@
</Tooltip>
</Layout.Stack>
<Typography.Caption variant="400"
>Max file size 10MB</Typography.Caption>
>Max file size: {readableMaxSize.value +
readableMaxSize.unit}</Typography.Caption>
</Layout.Stack>
</Layout.Stack>
</Upload.Dropzone>
Expand Down