mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 16:14:22 +02:00
fix: new destinations
This commit is contained in:
parent
331e13b7cb
commit
52b712d90b
@ -43,7 +43,7 @@ export async function getDestination(request: FastifyRequest) {
|
|||||||
const destination = await prisma.destinationDocker.findFirst({
|
const destination = await prisma.destinationDocker.findFirst({
|
||||||
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } }
|
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } }
|
||||||
});
|
});
|
||||||
if (!destination) {
|
if (!destination && id !== 'new') {
|
||||||
throw { status: 404, message: `Destination not found.` };
|
throw { status: 404, message: `Destination not found.` };
|
||||||
}
|
}
|
||||||
const settings = await listSettings();
|
const settings = await listSettings();
|
||||||
@ -62,10 +62,7 @@ export async function getDestination(request: FastifyRequest) {
|
|||||||
// // await saveSshKey(destination);
|
// // await saveSshKey(destination);
|
||||||
// payload.state = await checkContainer(engine, 'coolify-haproxy');
|
// payload.state = await checkContainer(engine, 'coolify-haproxy');
|
||||||
} else {
|
} else {
|
||||||
let containerName = 'coolify-proxy';
|
const containerName = 'coolify-proxy';
|
||||||
if (!settings.isTraefikUsed) {
|
|
||||||
containerName = 'coolify-haproxy';
|
|
||||||
}
|
|
||||||
payload.state =
|
payload.state =
|
||||||
destination?.engine && (await checkContainer(destination.engine, containerName));
|
destination?.engine && (await checkContainer(destination.engine, containerName));
|
||||||
}
|
}
|
||||||
|
@ -34,18 +34,12 @@
|
|||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
async function newDestination() {
|
|
||||||
const { id } = await post('/destinations/new', {});
|
|
||||||
return await goto(`/destinations/${id}`, { replaceState: true });
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex space-x-1 p-6 font-bold">
|
<div class="flex space-x-1 p-6 font-bold">
|
||||||
<div class="mr-4 text-2xl tracking-tight">{$t('index.destinations')}</div>
|
<div class="mr-4 text-2xl tracking-tight">{$t('index.destinations')}</div>
|
||||||
{#if $appSession.isAdmin}
|
{#if $appSession.isAdmin}
|
||||||
<button
|
<a href="/destinations/new" class="add-icon bg-sky-600 hover:bg-sky-500">
|
||||||
on:click={newDestination}
|
|
||||||
class="add-icon bg-sky-600 hover:bg-sky-500">
|
|
||||||
<svg
|
<svg
|
||||||
class="w-6"
|
class="w-6"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@ -59,7 +53,7 @@
|
|||||||
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
||||||
/></svg
|
/></svg
|
||||||
>
|
>
|
||||||
</button>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-col justify-center">
|
<div class="flex-col justify-center">
|
||||||
|
Loading…
Reference in New Issue
Block a user