mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: code review
This commit is contained in:
1 parent
316b61f8cf
commit
f5c8ad72ef
6 files changed
+48
-40
No files matched your search
@@ -30,13 +30,12 @@
|
||||
* Cancel navigation when wizard is open and triggered by popstate
|
||||
*/
|
||||
beforeNavigate((n) => {
|
||||
if ($wizard.show || $wizard.cover) {
|
||||
if (n.type === 'popstate') {
|
||||
n.cancel();
|
||||
}
|
||||
if (n.type !== 'leave') {
|
||||
wizard.hide();
|
||||
}
|
||||
if (!$wizard.show || !$wizard.cover) return;
|
||||
if (n.type === 'popstate') {
|
||||
n.cancel();
|
||||
}
|
||||
if (n.type !== 'leave') {
|
||||
wizard.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -21,34 +21,43 @@
|
||||
import ExecuteAccess from './steps/executeAccess.svelte';
|
||||
|
||||
async function create() {
|
||||
const response = await sdk.forProject.functions.create(
|
||||
$createFunction.$id || ID.unique(),
|
||||
$createFunction.name,
|
||||
$createFunction.runtime,
|
||||
$createFunction.entrypoint,
|
||||
$createFunction.execute || undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
$createFunction.commands || undefined
|
||||
);
|
||||
await sdk.forProject.functions.createDeployment(
|
||||
response.$id,
|
||||
$createFunctionDeployment[0],
|
||||
true
|
||||
);
|
||||
goto(`${base}/console/project-${$page.params.project}/functions/function-${response.$id}`);
|
||||
addNotification({
|
||||
message: `${$createFunction.name} has been created`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent(Submit.FunctionCreate, {
|
||||
customId: !!$createFunction.$id
|
||||
});
|
||||
resetState();
|
||||
wizard.hide();
|
||||
try {
|
||||
const response = await sdk.forProject.functions.create(
|
||||
$createFunction.$id || ID.unique(),
|
||||
$createFunction.name,
|
||||
$createFunction.runtime,
|
||||
$createFunction.entrypoint,
|
||||
$createFunction.execute || undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
$createFunction.commands || undefined
|
||||
);
|
||||
await sdk.forProject.functions.createDeployment(
|
||||
response.$id,
|
||||
$createFunctionDeployment[0],
|
||||
true
|
||||
);
|
||||
goto(
|
||||
`${base}/console/project-${$page.params.project}/functions/function-${response.$id}`
|
||||
);
|
||||
addNotification({
|
||||
message: `${$createFunction.name} has been created`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent(Submit.FunctionCreate, {
|
||||
customId: !!$createFunction.$id
|
||||
});
|
||||
resetState();
|
||||
wizard.hide();
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function resetState() {
|
||||
|
||||
@@ -11,6 +11,6 @@ export const load: LayoutLoad = async ({ depends }) => {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
installations: await sdk.forProject.vcs.listInstallations([Query.limit(100)])
|
||||
installations: sdk.forProject.vcs.listInstallations([Query.limit(100)])
|
||||
};
|
||||
};
|
||||
@@ -13,8 +13,8 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs,
|
||||
function: await sdk.forProject.functions.get(params.function),
|
||||
domain: await sdk.forProject.proxy.listRules([
|
||||
function: sdk.forProject.functions.get(params.function),
|
||||
domain: sdk.forProject.proxy.listRules([
|
||||
Query.equal('resourceType', 'function'),
|
||||
Query.equal('resourceId', params.function),
|
||||
Query.limit(1)
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
<div class="u-flex u-gap-12 u-cross-center">
|
||||
<a
|
||||
class="u-underline u-cursor-pointer"
|
||||
href={'//' + data.domain.rules[0].domain}
|
||||
href={`https//${data.domain.rules[0].domain}`}
|
||||
target="_blank">
|
||||
{data.domain.rules[0].domain}
|
||||
</a>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$func.name} has been redeployed.`
|
||||
message: `Redeploying ${$func.name}`
|
||||
});
|
||||
trackEvent(Submit.FunctionRedeploy);
|
||||
|
||||
|
||||
Reference in new issue
Block a user