mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #2051 from appwrite/fix-calc-usage
Fix: usage calc on function.
This commit is contained in:
+7
-1
@@ -9,6 +9,12 @@
|
||||
$: count = data.executions;
|
||||
$: gbHoursTotal = data.executionsMbSecondsTotal / 1000 / 3600;
|
||||
$: mbSecondsCount = data.executionsMbSeconds;
|
||||
$: gbHoursCount = data.executionsMbSeconds
|
||||
?.map((metric) => ({
|
||||
...metric,
|
||||
value: metric.value / 1000 / 3600
|
||||
}))
|
||||
.filter(({ value }) => value);
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
@@ -33,7 +39,7 @@
|
||||
title: 'Total GB hours'
|
||||
}}
|
||||
total={gbHoursTotal}
|
||||
count={mbSecondsCount} />
|
||||
count={gbHoursCount} />
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
</Container>
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ export const load: PageLoad = async ({ params }) => {
|
||||
const period = isValueOfStringEnum(FunctionUsageRange, params.period)
|
||||
? params.period
|
||||
: FunctionUsageRange.ThirtyDays;
|
||||
|
||||
return sdk
|
||||
.forProject(params.region, params.project)
|
||||
.functions.getUsage(params.function, period);
|
||||
|
||||
Reference in New Issue
Block a user