diff --git a/src/routes/console/project-[project]/functions/+layout.svelte b/src/routes/console/project-[project]/functions/+layout.svelte index 50819a036..5796af77b 100644 --- a/src/routes/console/project-[project]/functions/+layout.svelte +++ b/src/routes/console/project-[project]/functions/+layout.svelte @@ -1,37 +1,3 @@ - - Functions - Appwrite diff --git a/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte b/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte index e8b8dae48..417a11972 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte @@ -1,6 +1,37 @@ diff --git a/src/routes/console/project-[project]/functions/header.svelte b/src/routes/console/project-[project]/functions/header.svelte index 6ea24a4d9..8674ef158 100644 --- a/src/routes/console/project-[project]/functions/header.svelte +++ b/src/routes/console/project-[project]/functions/header.svelte @@ -1,9 +1,39 @@ Functions + + + {#each tabs as tab} + + {tab.title} + + {/each} + diff --git a/src/routes/console/project-[project]/functions/templates/+page.svelte b/src/routes/console/project-[project]/functions/templates/+page.svelte new file mode 100644 index 000000000..a3ee41915 --- /dev/null +++ b/src/routes/console/project-[project]/functions/templates/+page.svelte @@ -0,0 +1,168 @@ + + + +
+
+

Filter templates

+
+ + + + + Use case + {#each [...useCases] as useCase} + + {/each} + + + Runtime + {#each [...runtimes] as runtime} + + {/each} + + + +
+

Contribute

+

+ Have an idea for a function template? View our contribution guidelines. +

+
+
+
+
    + {#each templates as template} +
  • +
    +
    +

    + {template.name} +

    + +
      + {#each template.runtimes as runtime} +
    • +
      +
      +
    • + {/each} +
    +
    + +

    + {template.tagline} +

    + +
    + + +
    +
    +
  • + {/each} +
+
+
+
+

Total results: {templates.length}

+ +
+
diff --git a/src/routes/console/project-[project]/functions/templates/data.json b/src/routes/console/project-[project]/functions/templates/data.json new file mode 100644 index 000000000..32baa778f --- /dev/null +++ b/src/routes/console/project-[project]/functions/templates/data.json @@ -0,0 +1,226 @@ +[ + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-18", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + }, + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI", "Web3"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-16", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + }, + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-18", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + }, + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-18", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + }, + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-18", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + }, + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-18", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + }, + { + "icon": "algolia", + "id": "sync-with-algolia", + "name": "Sync with Algolia", + "tagline": "Search your Appwrite Database with Algolia.", + "permissions": ["any"], + "events": ["users.*.create"], + "useCases": ["AI"], + "cron": "0 * * * *", + "timeout": 15, + "runtimes": [ + { + "name": "node-18", + "entrypoint": "src/main.js", + "commands": "npm install" + } + ], + "instructions": "# Some markdown stuff", + "vcsProvider": "github", + "vcsRepositoryName": "templates-for-node", + "vcsOwnerName": "loks0n", + "vcsRootDirectory": "sync-with-algolia", + "variables": [ + { + "name": "ALGOLIA_API_KEY", + "description": "Algolia read-write API key.", + "value": "", + "placeholder": "sk_1df...h9jef", + "required": true + } + ] + } +]