mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: bucket limits
This commit is contained in:
1 parent
9ca7c317e7
commit
398ea403b5
2 files changed
+14
-18
No files matched your search
@@ -2,6 +2,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { Empty } from '$lib/components';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import { getServiceLimit } from '$lib/stores/billing';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import { isCloud } from '$lib/system';
|
||||
import CardPlanLimit from './cardPlanLimit.svelte';
|
||||
@@ -10,6 +11,9 @@
|
||||
export let total = 0;
|
||||
export let event: string = null;
|
||||
export let service = '';
|
||||
export let serviceId = service;
|
||||
|
||||
$: planLimit = getServiceLimit(serviceId);
|
||||
|
||||
$: limit = preferences.get($page.route)?.limit ?? CARD_LIMIT;
|
||||
</script>
|
||||
@@ -21,7 +25,7 @@
|
||||
<slot />
|
||||
|
||||
{#if total > 3 ? total < limit + offset : total % 2 !== 0}
|
||||
{#if isCloud && !!service}
|
||||
{#if isCloud && total >= planLimit}
|
||||
<CardPlanLimit {service} />
|
||||
{:else}
|
||||
<Empty on:click target={event}>
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { goto } from '$app/navigation';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import {
|
||||
Empty,
|
||||
GridItem1,
|
||||
CardContainer,
|
||||
Heading,
|
||||
PaginationWithLimit,
|
||||
Id
|
||||
} from '$lib/components';
|
||||
import { Empty, GridItem1, CardContainer, PaginationWithLimit, Id } from '$lib/components';
|
||||
import { Pill } from '$lib/elements';
|
||||
import Create from './create.svelte';
|
||||
import { Container } from '$lib/layout';
|
||||
import { Container, ContainerHeader } from '$lib/layout';
|
||||
import { base } from '$app/paths';
|
||||
import { tooltip } from '$lib/actions/tooltip';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
@@ -31,19 +23,19 @@
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Buckets</Heading>
|
||||
|
||||
<Button on:click={() => (showCreate = true)} event="create_bucket">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create bucket</span>
|
||||
</Button>
|
||||
</div>
|
||||
<ContainerHeader
|
||||
title="Buckets"
|
||||
total={data.buckets.total}
|
||||
buttonText="Create bucket"
|
||||
buttonEvent="create_bucket"
|
||||
buttonMethod={() => (showCreate = true)} />
|
||||
|
||||
{#if data.buckets.total}
|
||||
<CardContainer
|
||||
total={data.buckets.total}
|
||||
offset={data.offset}
|
||||
event="bucket"
|
||||
service="buckets"
|
||||
on:click={() => (showCreate = true)}>
|
||||
{#each data.buckets.buckets as bucket}
|
||||
<GridItem1 href={`${base}/console/project-${project}/storage/bucket-${bucket.$id}`}>
|
||||
|
||||
Reference in new issue
Block a user