feat: more plan limits

This commit is contained in:
Arman
2023-10-10 18:42:01 +02:00
parent 81277ff9a4
commit 53bbe7abd3
4 changed files with 25 additions and 12 deletions
+1 -1
View File
@@ -288,7 +288,7 @@
}
function checkForUsageLimit() {
console.log('test');
console.log('TODO: set read only mode here');
}
async function paymentExpired() {
@@ -15,8 +15,12 @@
import AddressModal from './addressModal.svelte';
import type { Models } from '@appwrite.io/console';
import DeleteAddress from './deleteAddress.svelte';
import EditAddressModal from './editAddressModal.svelte';
import type { Address } from '$lib/sdk/billing';
let show = false;
let showEdit = false;
let selectedAddress: Address;
let showDelete = false;
let showDropdown = [];
let countryList: Models.CountryList;
@@ -72,7 +76,9 @@
<DropListItem
icon="pencil"
on:click={() => {
console.log('test');
showEdit = true;
selectedAddress = address;
showDropdown[i] = false;
}}>
Edit
</DropListItem>
@@ -105,4 +111,5 @@
</CardGrid>
<AddressModal bind:show />
<EditAddressModal bind:show={showEdit} {selectedAddress} />
<DeleteAddress bind:showDelete />
@@ -13,6 +13,8 @@
import { columns } from './store';
import Table from './table.svelte';
import { registerCommands } from '$lib/commandCenter';
import { tooltip } from '$lib/actions/tooltip';
import { getServiceLimit } from '$lib/stores/billing';
export let data: PageData;
@@ -47,11 +49,19 @@
view={data.view}
hideColumns={!data.databases.total}
hideView={!data.databases.total} />
<Button on:click={() => (showCreate = true)} event="create_database">
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create database</span>
</Button>
<div
use:tooltip={{
content: `Upgrade to add more databases`,
disabled: data?.databases?.total < getServiceLimit('databases')
}}>
<Button
on:click={() => (showCreate = true)}
event="create_database"
disabled={data?.databases?.total >= getServiceLimit('databases')}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create database</span>
</Button>
</div>
</div>
</ContainerHeader>
@@ -74,11 +74,7 @@
};
</script>
<ContainerHeader
title="Platforms"
titleTag="h3"
titleSize="7"
total={data?.platforms?.platforms?.length}>
<ContainerHeader title="Platforms" titleTag="h3" titleSize="7" total={data?.platforms?.total}>
<DropList bind:show={showDropdown} placement="bottom-start">
<Button
on:click={() => (showDropdown = !showDropdown)}