mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
refactor: rename fn
This commit is contained in:
1 parent
7badf3a28b
commit
318d72db14
10 files changed
+19
-19
No files matched your search
@@ -34,7 +34,7 @@ const commandsEnabled = derived(commandCenter, ($commandCenter) => {
|
||||
return Array.from($commandCenter.disabledMap.values()).every((disabled) => !disabled);
|
||||
});
|
||||
|
||||
export const registerCommand = {
|
||||
export const registerCommands = {
|
||||
subscribe(runner: (cb: (newCommands: Command[]) => void) => void) {
|
||||
const uuid = crypto.randomUUID();
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
import Create from './createOrganization.svelte';
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { registerCommand, commandCenterKeyDownHandler } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands, commandCenterKeyDownHandler } from '$lib/helpers/commandCenter';
|
||||
import CommandCenter from './commandCenter.svelte';
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Go to Account',
|
||||
callback: () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import Dialog from '$lib/components/dialog.svelte';
|
||||
import { commands, disableCommands, registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { commands, disableCommands, registerCommands } from '$lib/helpers/commandCenter';
|
||||
import { isMac } from '$lib/helpers/platform';
|
||||
import { quadOut } from 'svelte/easing';
|
||||
import { crossfade } from 'svelte/transition';
|
||||
@@ -10,7 +10,7 @@
|
||||
let search = '';
|
||||
let selected = 0;
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
callback: () => {
|
||||
open = !open;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { CardContainer, Empty, GridItem1, Heading, PaginationWithLimit } from '$lib/components';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
import { Container } from '$lib/layout';
|
||||
import CreateOrganization from '../createOrganization.svelte';
|
||||
import type { PageData } from './$types';
|
||||
@@ -46,7 +46,7 @@
|
||||
);
|
||||
}
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
...data.projects.projects.map((project, i) => ({
|
||||
label: `Project ${project.name}`,
|
||||
callback: () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { project, stats } from './store';
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
onMount(async () => {
|
||||
@@ -16,7 +16,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Go to Overview',
|
||||
keys: ['g', 'o'],
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
import { project } from '../store';
|
||||
import type { PageData } from './$types';
|
||||
import Create from './createUser.svelte';
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
await goto(`${base}/console/project-${projectId}/auth/user-${event.detail.$id}`);
|
||||
}
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create user',
|
||||
callback: () => {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import Grid from './grid.svelte';
|
||||
import { columns } from './store';
|
||||
import Table from './table.svelte';
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
await goto(`${base}/console/project-${project}/databases/database-${event.detail.$id}`);
|
||||
}
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create database',
|
||||
callback: () => {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import type { PageData } from './$types';
|
||||
import Create from './createFunction.svelte';
|
||||
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
wizard.hide();
|
||||
});
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create function',
|
||||
callback: openWizard,
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { app } from '$lib/stores/app';
|
||||
import type { PageData } from './$types';
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create Web App',
|
||||
callback: () => addPlatform(Platform.Web),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Container } from '$lib/layout';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { registerCommand } from '$lib/helpers/commandCenter';
|
||||
import { registerCommands } from '$lib/helpers/commandCenter';
|
||||
import type { PageData } from './$types';
|
||||
import Create from './create.svelte';
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
await goto(`${base}/console/project-${project}/storage/bucket-${event.detail.$id}`);
|
||||
}
|
||||
|
||||
$: $registerCommand([
|
||||
$: $registerCommands([
|
||||
{
|
||||
label: 'Create bucket',
|
||||
callback: () => {
|
||||
|
||||
Reference in new issue
Block a user