mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge branch 'feat-pink-v2' of https://github.com/appwrite/console into feat-pink-v2
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@
|
||||
"e2e:ui": "playwright test tests/e2e --ui"
|
||||
},
|
||||
"dependencies": {
|
||||
"@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@d13e864",
|
||||
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@53cae2d",
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@011c2131",
|
||||
"@appwrite.io/pink-legacy": "^1.0.1",
|
||||
|
||||
Generated
+6
-6
@@ -9,8 +9,8 @@ importers:
|
||||
.:
|
||||
dependencies:
|
||||
'@appwrite.io/console':
|
||||
specifier: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@d13e864
|
||||
version: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@d13e864
|
||||
specifier: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@53cae2d
|
||||
version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@53cae2d
|
||||
'@appwrite.io/pink-icons':
|
||||
specifier: 0.25.0
|
||||
version: 0.25.0
|
||||
@@ -211,9 +211,9 @@ packages:
|
||||
'@analytics/type-utils@0.6.2':
|
||||
resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==}
|
||||
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@d13e864':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@d13e864}
|
||||
version: 1.2.1
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@53cae2d':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@53cae2d}
|
||||
version: 1.4.1
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@011c2131':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@011c2131}
|
||||
@@ -4097,7 +4097,7 @@ snapshots:
|
||||
|
||||
'@analytics/type-utils@0.6.2': {}
|
||||
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@d13e864': {}
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@53cae2d': {}
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@011c2131(svelte@4.2.19)':
|
||||
dependencies:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte';
|
||||
|
||||
export let description: string;
|
||||
export let value: string = null;
|
||||
export let value: string | number = null;
|
||||
</script>
|
||||
|
||||
<Card radius="s" padding="xs" isTile>
|
||||
|
||||
@@ -20,7 +20,8 @@ import {
|
||||
Teams,
|
||||
Users,
|
||||
Vcs,
|
||||
Sites
|
||||
Sites,
|
||||
Domains
|
||||
} from '@appwrite.io/console';
|
||||
import { Billing } from '../sdk/billing';
|
||||
import { Backups } from '../sdk/backups';
|
||||
@@ -57,7 +58,8 @@ const sdkForProject = {
|
||||
vcs: new Vcs(clientProject),
|
||||
proxy: new Proxy(clientProject),
|
||||
migrations: new Migrations(clientProject),
|
||||
sites: new Sites(clientProject)
|
||||
sites: new Sites(clientProject),
|
||||
domains: new Domains(clientProject)
|
||||
};
|
||||
|
||||
export const getSdkForProject = (projectId: string) => {
|
||||
@@ -83,7 +85,8 @@ export const sdk = {
|
||||
console: new Console(clientConsole),
|
||||
assistant: new Assistant(clientConsole),
|
||||
billing: new Billing(clientConsole),
|
||||
sources: new Sources(clientConsole)
|
||||
sources: new Sources(clientConsole),
|
||||
domains: new Domains(clientConsole)
|
||||
},
|
||||
get forProject() {
|
||||
const projectId = getProjectId();
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
IconApple,
|
||||
IconCode,
|
||||
IconFlutter,
|
||||
IconGlobe,
|
||||
IconPlus,
|
||||
IconReact,
|
||||
IconUnity
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
let showDelete = false;
|
||||
let showRetry = false;
|
||||
let selectedDomain: Models.ProxyRule = null;
|
||||
let selectedDomain: Models.Domain = null;
|
||||
|
||||
$: console.log(data.domains);
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<Table.Header.Cell>Auto renewal</Table.Header.Cell>
|
||||
<Table.Header.Cell />
|
||||
</svelte:fragment>
|
||||
{#each data.domains.rules as domain}
|
||||
{#each data.domains.domains as domain}
|
||||
<Table.Link
|
||||
href={`${base}/organization-${$page.params.organization}/domains/domain-${domain.$id}`}>
|
||||
<Table.Cell>
|
||||
@@ -81,24 +81,26 @@
|
||||
<Icon icon={IconExternalLink} size="s" />
|
||||
</Layout.Stack>
|
||||
</Link>
|
||||
{#if domain.status === 'created'}
|
||||
{#if !domain.verified}
|
||||
<Badge
|
||||
size="s"
|
||||
variant="secondary"
|
||||
content="Verification failed"
|
||||
type="error" />
|
||||
{:else if domain.status === 'veryfing'}
|
||||
<Badge
|
||||
size="s"
|
||||
variant="secondary"
|
||||
content="Pending verification"
|
||||
type="warning" />
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
</Table.Cell>
|
||||
<Table.Cell>{domain?.registrar ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{domain?.nameservers ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{domain?.expiry ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{domain?.registrar || '-'}</Table.Cell>
|
||||
<Table.Cell>{domain?.nameservers || '-'}</Table.Cell>
|
||||
<Table.Cell>{domain?.expiry || '-'}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{domain.renewAt ? toLocaleDateTime(domain.renewAt) : '-'}
|
||||
{domain.renewal ? toLocaleDateTime(domain.renewal) : '-'}
|
||||
</Table.Cell>
|
||||
<Table.Cell>{domain.autoRenewal ? 'On' : 'Off'}</Table.Cell>
|
||||
<Table.Cell>
|
||||
@@ -116,7 +118,7 @@
|
||||
|
||||
<svelte:fragment slot="tooltip" let:toggle>
|
||||
<ActionMenu.Root>
|
||||
{#if domain.status !== 'verified'}
|
||||
<!-- {#if domain.status !== 'verified'}
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconRefresh}
|
||||
on:click={(e) => {
|
||||
@@ -127,7 +129,7 @@
|
||||
}}>
|
||||
Retry
|
||||
</ActionMenu.Item.Button>
|
||||
{/if}
|
||||
{/if} -->
|
||||
<ActionMenu.Item.Button
|
||||
status="danger"
|
||||
leadingIcon={IconTrash}
|
||||
|
||||
@@ -20,14 +20,11 @@ export const load = async ({ depends, url, route }) => {
|
||||
limit,
|
||||
query,
|
||||
search,
|
||||
domains: await sdk.forProject.proxy.listRules(
|
||||
[
|
||||
Query.limit(limit),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc(''),
|
||||
...parsedQueries.values()
|
||||
],
|
||||
search || undefined
|
||||
)
|
||||
domains: await sdk.forConsole.domains.list([
|
||||
Query.limit(limit),
|
||||
Query.offset(offset),
|
||||
Query.orderDesc(''),
|
||||
...parsedQueries.values()
|
||||
])
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,15 +23,11 @@
|
||||
const backPage = `${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains`;
|
||||
|
||||
let domain = '';
|
||||
let domainData: Models.ProxyRule;
|
||||
let domainData: Models.Domain;
|
||||
|
||||
async function addDomain() {
|
||||
try {
|
||||
domainData = await sdk.forProject.proxy.createRule(
|
||||
domain,
|
||||
ResourceType.Site,
|
||||
$page.params.site
|
||||
);
|
||||
domainData = await sdk.forConsole.domains.create($page.params.organization, domain);
|
||||
console.log(domainData);
|
||||
invalidate(Dependencies.SITES_DOMAINS);
|
||||
} catch (error) {
|
||||
@@ -44,7 +40,7 @@
|
||||
|
||||
async function verifyStatus() {
|
||||
try {
|
||||
domainData = await sdk.forProject.proxy.updateRuleVerification(domainData.$id);
|
||||
// domainData = await sdk.forConsole.domains.verification(domainData.$id);
|
||||
console.log(domainData);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -8,25 +8,13 @@
|
||||
import { Confirm } from '$lib/components';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Models.ProxyRule;
|
||||
export let selectedDomain: Models.Domain;
|
||||
|
||||
let error = '';
|
||||
|
||||
function getCorrectMessage(): string {
|
||||
const resourceType = selectedDomain.resourceType;
|
||||
switch (resourceType) {
|
||||
case 'api':
|
||||
return `access ${resourceType}`;
|
||||
case 'function':
|
||||
return `execute your ${resourceType}`;
|
||||
case 'site':
|
||||
return `view your ${resourceType} `;
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk.forProject.proxy.deleteRule(selectedDomain.$id);
|
||||
await sdk.forConsole.domains.delete(selectedDomain.$id);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
@@ -41,7 +29,10 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- TODO: fix copy -->
|
||||
<Confirm onSubmit={deleteDomain} title="Delete domain" bind:open={show} bind:error>
|
||||
<p data-private>Are you sure you want to delete <b>{selectedDomain?.domain}</b>?</p>
|
||||
<p>You will no longer be able to {getCorrectMessage()} by visiting this domain.</p>
|
||||
<p>
|
||||
You will no longer be able to access any projects or services associated with this domain.
|
||||
</p>
|
||||
</Confirm>
|
||||
|
||||
@@ -7,7 +7,7 @@ export const load = async ({ depends, params }) => {
|
||||
depends(Dependencies.SITE);
|
||||
|
||||
return {
|
||||
domain: await sdk.forProject.proxy.getRule(params.domain),
|
||||
domain: await sdk.forConsole.domains.get(params.domain),
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs
|
||||
};
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
<DomainMetrics domain={data.domain} />
|
||||
|
||||
<Layout.Stack gap="l">
|
||||
{#if data.records.total}
|
||||
{#if data.recordList.total}
|
||||
<Layout.Stack direction="row" justifyContent="space-between">
|
||||
<Layout.Stack direction="row" gap="s" inline>
|
||||
<Button secondary>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Dependencies } from '$lib/constants';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { getLimit } from '$lib/helpers/load';
|
||||
import { getPage } from '$lib/helpers/load';
|
||||
import { sdk } from '$lib/stores/sdk.js';
|
||||
|
||||
export const load = async ({ parent, depends, url, route }) => {
|
||||
depends(Dependencies.DOMAIN);
|
||||
@@ -14,47 +15,8 @@ export const load = async ({ parent, depends, url, route }) => {
|
||||
|
||||
return {
|
||||
domain,
|
||||
records: mockDNSRecords,
|
||||
recordList: await sdk.forConsole.domains.listRecords(domain.$id),
|
||||
offset,
|
||||
limit
|
||||
};
|
||||
};
|
||||
|
||||
const mockDNSRecords = {
|
||||
total: 4,
|
||||
records: [
|
||||
{
|
||||
type: 'A',
|
||||
name: '@',
|
||||
value: '192.0.2.1',
|
||||
ttl: 3600,
|
||||
proxied: true,
|
||||
$createdAt: '2023-01-15T10:30:00Z'
|
||||
},
|
||||
{
|
||||
type: 'CNAME',
|
||||
name: 'www',
|
||||
value: 'example.com',
|
||||
ttl: 3600,
|
||||
proxied: true,
|
||||
$createdAt: '2023-01-15T10:30:00Z'
|
||||
},
|
||||
{
|
||||
type: 'MX',
|
||||
name: '@',
|
||||
value: 'mail.example.com',
|
||||
priority: 10,
|
||||
ttl: 3600,
|
||||
proxied: false,
|
||||
$createdAt: '2023-01-15T10:30:00Z'
|
||||
},
|
||||
{
|
||||
type: 'TXT',
|
||||
name: '@',
|
||||
value: 'v=spf1 include:_spf.example.com ~all',
|
||||
ttl: 3600,
|
||||
proxied: false,
|
||||
$createdAt: '2023-01-15T10:30:00Z'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { PAGE_LIMIT, Dependencies } from '$lib/constants';
|
||||
import { getSearch, pageToOffset, getLimit, getPage } from '$lib/helpers/load';
|
||||
|
||||
export const load = async ({ parent, depends, url, route }) => {
|
||||
depends(Dependencies.DOMAINS);
|
||||
depends(Dependencies.DOMAIN);
|
||||
const page = getPage(url);
|
||||
const limit = getLimit(url, route, PAGE_LIMIT);
|
||||
const offset = pageToOffset(page, limit);
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
|
||||
export let domain: Models.ProxyRule;
|
||||
export let domain: Models.Domain;
|
||||
let metrics = [
|
||||
{
|
||||
value: domain.domain,
|
||||
@@ -19,11 +19,11 @@
|
||||
description: 'Nameservers'
|
||||
},
|
||||
{
|
||||
value: domain?.expiresAt ? toLocaleDate(domain?.expiresAt) : '-',
|
||||
value: domain?.expiry ? toLocaleDate(domain?.expiry) : '-',
|
||||
description: 'Exipiry date'
|
||||
},
|
||||
{
|
||||
value: domain?.autoRenewals ? 'On' : 'off',
|
||||
value: domain?.autoRenewal ? 'On' : 'off',
|
||||
description: 'Auto renewal'
|
||||
},
|
||||
{
|
||||
|
||||
+6
-2
@@ -3,14 +3,17 @@
|
||||
import { CardGrid } from '$lib/components';
|
||||
import { Button, InputSelect } from '$lib/elements/forms';
|
||||
import type { OrganizationList } from '$lib/stores/organization';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let domain: Models.ProxyRule;
|
||||
export let domain: Models.Domain;
|
||||
export let organizations: OrganizationList;
|
||||
let selectedOrg: string = null;
|
||||
|
||||
async function moveDomain() {
|
||||
console.log(selectedOrg);
|
||||
try {
|
||||
await sdk.forConsole.domains.updateTeam(domain.$id, selectedOrg);
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
$: options = organizations.total
|
||||
@@ -27,6 +30,7 @@
|
||||
<InputSelect
|
||||
id="orgs"
|
||||
label="Move to"
|
||||
required
|
||||
placeholder="Select destination"
|
||||
disabled={options?.length === 0}
|
||||
{options}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import Delete from '../../deleteDomainModal.svelte';
|
||||
|
||||
export let domain: Models.ProxyRule;
|
||||
export let domain: Models.Domain;
|
||||
let show = false;
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ import type { Column } from '$lib/helpers/types';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { derived, writable } from 'svelte/store';
|
||||
|
||||
export const domain = derived(page, ($page) => $page.data.domain as Models.ProxyRule);
|
||||
// columns: namem type, value, ttl, priority, comment, created
|
||||
export const domain = derived(page, ($page) => $page.data.domain as Models.Domain);
|
||||
export const columns = writable<Column[]>([
|
||||
{ id: 'name', title: 'Name', type: 'string', show: true },
|
||||
{ id: 'type', title: 'Type', type: 'string', show: true },
|
||||
|
||||
+9
-7
@@ -3,6 +3,7 @@
|
||||
|
||||
import {
|
||||
ActionMenu,
|
||||
Button,
|
||||
HiddenText,
|
||||
Icon,
|
||||
Layout,
|
||||
@@ -13,13 +14,13 @@
|
||||
import { IconDotsHorizontal, IconPencil, IconTrash } from '@appwrite.io/pink-icons-svelte';
|
||||
import { columns } from './store';
|
||||
import { timeFromNow } from '$lib/helpers/date';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let data;
|
||||
|
||||
let showEdit = false;
|
||||
let showDelete = false;
|
||||
let selectedRecord; //TODO: add type
|
||||
let selectedRecord: Models.DnsRecord = null;
|
||||
</script>
|
||||
|
||||
<Layout.Stack>
|
||||
@@ -35,7 +36,7 @@
|
||||
<Table.Header.Cell width="40" />
|
||||
</svelte:fragment>
|
||||
|
||||
{#each data.records.records as record}
|
||||
{#each data.recordList.dnsRecords as record}
|
||||
<Table.Row>
|
||||
{#each $columns as column}
|
||||
{#if column.show}
|
||||
@@ -87,15 +88,16 @@
|
||||
<Table.Cell>
|
||||
<Layout.Stack direction="row" justifyContent="flex-end">
|
||||
<Popover let:toggle placement="bottom-start" padding="none">
|
||||
<Button
|
||||
text
|
||||
<Button.Button
|
||||
variant="text"
|
||||
icon
|
||||
size="s"
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
toggle(e);
|
||||
}}>
|
||||
<Icon icon={IconDotsHorizontal} size="s" />
|
||||
</Button>
|
||||
</Button.Button>
|
||||
|
||||
<svelte:fragment slot="tooltip" let:toggle>
|
||||
<ActionMenu.Root>
|
||||
@@ -133,5 +135,5 @@
|
||||
name="Domains"
|
||||
limit={data.limit}
|
||||
offset={data.offset}
|
||||
total={data.records.total} />
|
||||
total={data.recordList.total} />
|
||||
</Layout.Stack>
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
{
|
||||
href: `${path}/domains`,
|
||||
event: 'domains',
|
||||
title: 'Domains'
|
||||
title: 'Domains',
|
||||
disabled: !isCloud
|
||||
// disabled: !(isCloud && $canSeeDomains) //TODO: enable this before release
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user