From d58fb6d2e0ced5ede8a5af8c29e12d382d673057 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 31 Jul 2024 15:24:45 +0900 Subject: [PATCH] Run Linter --- src/lib/elements/forms/inputSelect.svelte | 5 ++++- src/lib/sdk/functionsSpec.ts | 21 ++++++++++++------- .../settings/updateRuntime.svelte | 9 ++++---- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/lib/elements/forms/inputSelect.svelte b/src/lib/elements/forms/inputSelect.svelte index 6eac698cb..b6901ee31 100644 --- a/src/lib/elements/forms/inputSelect.svelte +++ b/src/lib/elements/forms/inputSelect.svelte @@ -71,7 +71,10 @@ {/if} {#each options as option} - {/each} diff --git a/src/lib/sdk/functionsSpec.ts b/src/lib/sdk/functionsSpec.ts index c47b54fcd..6c65a3943 100644 --- a/src/lib/sdk/functionsSpec.ts +++ b/src/lib/sdk/functionsSpec.ts @@ -149,7 +149,7 @@ export type Sizes = { export enum FunctionUsageRange { TwentyFourHours = '24h', ThirtyDays = '30d', - NinetyDays = '90d', + NinetyDays = '90d' } /** @@ -164,7 +164,7 @@ export type Metric = { * The date at which this metric was aggregated in ISO 8601 format. */ date: string; -} +}; /** * Metric Breakdown */ @@ -181,7 +181,7 @@ export type MetricBreakdown = { * The value of this metric at the timestamp. */ value: number; -} +}; /** * UsageFunction @@ -255,7 +255,7 @@ export type UsageFunction = { * Aggregated number of function executions compute time per period. */ executionsMbSeconds: Metric[]; -} +}; export class SizesFunctions { client: Client; @@ -412,7 +412,7 @@ export class SizesFunctions { * @param {FunctionUsageRange} range * @throws {AppwriteException} * @returns {Promise} - */ + */ async getFunctionUsage(functionId: string, range?: FunctionUsageRange): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); @@ -426,8 +426,13 @@ export class SizesFunctions { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { - 'content-type': 'application/json', - }, payload); + return await this.client.call( + 'get', + uri, + { + 'content-type': 'application/json' + }, + payload + ); } } diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte index 8d1291620..3c7350647 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte @@ -23,7 +23,7 @@ onMount(async () => { runtime ??= $func.runtime; - size ??= $func.size + size ??= $func.size; let runtimes = await $runtimesList; let allowedSizes = await $sizes; @@ -33,7 +33,9 @@ })); sizeOptions = allowedSizes.sizes.map((size) => ({ - label: `${size.cpus} CPU, ${size.memory} MB RAM` + (size.plan ? ` (${size.plan} and higher)` : ''), + label: + `${size.cpus} CPU, ${size.memory} MB RAM` + + (size.plan ? ` (${size.plan} and higher)` : ''), value: size.slug, disabled: !size.enabled })); @@ -78,8 +80,7 @@ } } - $: isUpdateButtonEnabled = - runtime !== $func?.runtime || size !== $func?.size; + $: isUpdateButtonEnabled = runtime !== $func?.runtime || size !== $func?.size;