mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
more fixes
This commit is contained in:
1 parent
56396497b6
commit
7e08055ad0
11 files changed
+43
-12
No files matched your search
@@ -20,6 +20,7 @@
|
||||
import Delete from './delete.svelte';
|
||||
import Retry from './wizard/retry.svelte';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { canWriteRules } from '$lib/stores/roles';
|
||||
|
||||
export let rules: Models.ProxyRuleList;
|
||||
export let type: ResourceType;
|
||||
@@ -55,9 +56,11 @@
|
||||
<slot name="heading" />
|
||||
</Heading>
|
||||
|
||||
{#if $canWriteRules}
|
||||
<Button on:click={openWizard}>
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create domain</span>
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{#if rules.total}
|
||||
<TableScroll>
|
||||
@@ -65,7 +68,9 @@
|
||||
<TableCellHead width={150}>Name</TableCellHead>
|
||||
<TableCellHead width={120}>Verification Status</TableCellHead>
|
||||
<TableCellHead width={180}>Certificate Status</TableCellHead>
|
||||
{#if $canWriteRules}
|
||||
<TableCellHead width={40} />
|
||||
{/if}
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{#each rules.rules as domain, i}
|
||||
@@ -134,6 +139,7 @@
|
||||
</Pill>
|
||||
{/if}
|
||||
</TableCell>
|
||||
{#if $canWriteRules}
|
||||
<TableCell>
|
||||
<DropList
|
||||
bind:show={showDomainsDropdown[i]}
|
||||
@@ -168,6 +174,7 @@
|
||||
</svelte:fragment>
|
||||
</DropList>
|
||||
</TableCell>
|
||||
{/if}
|
||||
</TableRow>
|
||||
{/each}
|
||||
</TableBody>
|
||||
|
||||
@@ -3,17 +3,16 @@ import { sdk } from '$lib/stores/sdk';
|
||||
import { getLimit, getPage, pageToOffset } from '$lib/helpers/load';
|
||||
import { CARD_LIMIT, Dependencies } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
import { canSeeProjects } from '$lib/stores/roles';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const load: PageLoad = async ({ params, url, route, depends, parent }) => {
|
||||
await parent();
|
||||
const parentData = await parent();
|
||||
depends(Dependencies.ORGANIZATION);
|
||||
const page = getPage(url);
|
||||
const limit = getLimit(url, route, CARD_LIMIT);
|
||||
const offset = pageToOffset(page, limit);
|
||||
|
||||
if(!canSeeProjects) {
|
||||
if(!parentData.scopes.includes('projects.read')) {
|
||||
return redirect(301, `/console/organization-${params.organization}/billing`);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import Table from './table.svelte';
|
||||
import Grid from './grid.svelte';
|
||||
import type { PageData } from './$types';
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
|
||||
export let data: PageData;
|
||||
</script>
|
||||
@@ -17,10 +18,12 @@
|
||||
view={data.view}
|
||||
hideColumns={!data.collections.total}
|
||||
hideView={!data.collections.total}>
|
||||
{#if $canWriteCollections}
|
||||
<Button on:click={() => ($showCreate = true)} event="create_collection">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create collection</span>
|
||||
</Button>
|
||||
{/if}
|
||||
</GridHeader>
|
||||
|
||||
{#if data.collections.total}
|
||||
|
||||
+3
@@ -14,6 +14,7 @@
|
||||
TableRow
|
||||
} from '$lib/elements/table';
|
||||
import { Container } from '$lib/layout';
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
import Create from '../createAttribute.svelte';
|
||||
import { isRelationship } from '../document-[document]/attributes/store';
|
||||
import FailedModal from '../failedModal.svelte';
|
||||
@@ -51,7 +52,9 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Attributes</Heading>
|
||||
|
||||
{#if $canWriteCollections}
|
||||
<CreateAttributeDropdown bind:showCreateDropdown bind:selectedOption bind:showCreate />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if $attributes.length}
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
import { collection } from './store';
|
||||
|
||||
$: projectId = $page.params.project;
|
||||
@@ -38,11 +39,11 @@
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
...$canWriteCollections ? [{
|
||||
href: `${path}/settings`,
|
||||
title: 'Settings',
|
||||
event: 'settings'
|
||||
}
|
||||
}]:[]
|
||||
];
|
||||
</script>
|
||||
|
||||
|
||||
+3
@@ -21,6 +21,7 @@
|
||||
import CreateAttributeDropdown from '../attributes/createAttributeDropdown.svelte';
|
||||
import type { Option } from '../attributes/store';
|
||||
import FailedModal from '../failedModal.svelte';
|
||||
import { canWriteCollections } from '$lib/stores/roles';
|
||||
|
||||
let showDropdown = [];
|
||||
let selectedIndex: Models.Index = null;
|
||||
@@ -38,6 +39,7 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Indexes</Heading>
|
||||
|
||||
{#if $canWriteCollections}
|
||||
<Button
|
||||
event="create_index"
|
||||
disabled={!$collection?.attributes?.length}
|
||||
@@ -45,6 +47,7 @@
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create index</span>
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{#if $collection?.attributes?.length}
|
||||
{#if $indexes.length}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { canWriteDatabases } from '$lib/stores/roles';
|
||||
import { database } from './store';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
@@ -21,11 +22,15 @@
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
...($canWriteDatabases
|
||||
? [
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
]
|
||||
: [])
|
||||
];
|
||||
</script>
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
{#if data.functions.total}
|
||||
<CardContainer
|
||||
{offset}
|
||||
showEmpty={$canWriteFunctions}
|
||||
event="functions"
|
||||
total={data.functions.total}
|
||||
on:click={openWizard}
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
import DeploymentDomains from './deploymentDomains.svelte';
|
||||
import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system';
|
||||
import { readOnly } from '$lib/stores/billing';
|
||||
import { canWriteFunctions } from '$lib/stores/roles';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -59,7 +60,9 @@
|
||||
|
||||
<Container>
|
||||
<ContainerHeader title="Deployments">
|
||||
{#if $canWriteFunctions}
|
||||
<Create main />
|
||||
{/if}
|
||||
</ContainerHeader>
|
||||
{#if $deploymentList?.total}
|
||||
{@const activeDeployment = data.activeDeployment}
|
||||
@@ -163,9 +166,11 @@
|
||||
</CardGrid>
|
||||
{:else if $deploymentList.total}
|
||||
<Empty noMedia single>
|
||||
{#if $canWriteFunctions}
|
||||
<Create secondary round>
|
||||
<i class="icon-plus" />
|
||||
</Create>
|
||||
{/if}
|
||||
<div class="u-text-center">
|
||||
<p class="body-text-2 u-margin-block-start-4">
|
||||
Add a new deployment, or activate an existing one to see your function in
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { beforeNavigate } from '$app/navigation';
|
||||
import { DropList, DropListItem } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { canWriteFunctions } from '$lib/stores/roles';
|
||||
import CreateCli from './createCli.svelte';
|
||||
import CreateGit from './createGit.svelte';
|
||||
import CreateManual from './createManual.svelte';
|
||||
@@ -24,6 +25,7 @@
|
||||
</script>
|
||||
|
||||
<DropList bind:show placement="bottom-end">
|
||||
{#if $canWriteFunctions}
|
||||
<Button {secondary} {round} on:click={() => (show = !show)} event="create_deployment">
|
||||
<slot>
|
||||
{#if !secondary}
|
||||
@@ -32,6 +34,7 @@
|
||||
<span class="text">Create deployment</span>
|
||||
</slot>
|
||||
</Button>
|
||||
{/if}
|
||||
<svelte:fragment slot="list">
|
||||
<DropListItem
|
||||
on:click={() => {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { Id, Tab, Tabs } from '$lib/components';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
import { Cover, CoverTitle } from '$lib/layout';
|
||||
import { canWriteFunctions } from '$lib/stores/roles';
|
||||
import { func } from './store';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
@@ -32,11 +33,11 @@
|
||||
event: 'sage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
...$canWriteFunctions ? [{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
}] : []
|
||||
];
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user