commit
23e8833208
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "coolify",
|
||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||
"version": "2.4.4",
|
||||
"version": "2.4.5",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
"dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev",
|
||||
|
@ -1,11 +1,9 @@
|
||||
// TODO: Make this functions generic
|
||||
|
||||
async function send({
|
||||
method,
|
||||
path,
|
||||
data = {},
|
||||
headers,
|
||||
timeout = 30000
|
||||
timeout = 120000
|
||||
}): Promise<Record<string, unknown>> {
|
||||
const controller = new AbortController();
|
||||
const id = setTimeout(() => controller.abort(), timeout);
|
||||
@ -53,7 +51,7 @@ async function send({
|
||||
|
||||
export function get(
|
||||
path: string,
|
||||
headers: Record<string, unknown>
|
||||
headers?: Record<string, unknown>
|
||||
): Promise<Record<string, unknown>> {
|
||||
return send({ method: 'GET', path, headers });
|
||||
}
|
||||
@ -61,7 +59,7 @@ export function get(
|
||||
export function del(
|
||||
path: string,
|
||||
data: Record<string, unknown>,
|
||||
headers: Record<string, unknown>
|
||||
headers?: Record<string, unknown>
|
||||
): Promise<Record<string, unknown>> {
|
||||
return send({ method: 'DELETE', path, data, headers });
|
||||
}
|
||||
@ -77,7 +75,7 @@ export function post(
|
||||
export function put(
|
||||
path: string,
|
||||
data: Record<string, unknown>,
|
||||
headers: Record<string, unknown>
|
||||
headers?: Record<string, unknown>
|
||||
): Promise<Record<string, unknown>> {
|
||||
return send({ method: 'PUT', path, data, headers });
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ global
|
||||
defaults
|
||||
mode http
|
||||
log global
|
||||
timeout http-request 60s
|
||||
timeout http-request 120s
|
||||
timeout connect 10s
|
||||
timeout client 60s
|
||||
timeout server 60s
|
||||
timeout client 120s
|
||||
timeout server 120s
|
||||
|
||||
userlist haproxy-dataplaneapi
|
||||
user admin insecure-password "\${HAPROXY_PASSWORD}"
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
export let account;
|
||||
export let accounts;
|
||||
export let invitations;
|
||||
if (accounts.length === 0) {
|
||||
accounts.push(account);
|
||||
}
|
||||
@ -74,12 +75,51 @@
|
||||
return errorNotification(error);
|
||||
}
|
||||
}
|
||||
async function acceptInvitation(id, teamId) {
|
||||
try {
|
||||
await post(`/iam/team/${teamId}/invitation/accept.json`, { id });
|
||||
return window.location.reload();
|
||||
} catch ({ error }) {
|
||||
return errorNotification(error);
|
||||
}
|
||||
}
|
||||
async function revokeInvitation(id, teamId) {
|
||||
try {
|
||||
await post(`/iam/team/${teamId}/invitation/revoke.json`, { id });
|
||||
return window.location.reload();
|
||||
} catch ({ error }) {
|
||||
return errorNotification(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex space-x-1 p-6 font-bold">
|
||||
<div class="mr-4 text-2xl tracking-tight">Identity and Access Management</div>
|
||||
</div>
|
||||
|
||||
{#if invitations.length > 0}
|
||||
<div class="mx-auto max-w-4xl px-6 py-4">
|
||||
<div class="title font-bold">Pending invitations</div>
|
||||
<div class="pt-10 text-center">
|
||||
{#each invitations as invitation}
|
||||
<div class="flex justify-center space-x-2">
|
||||
<div>
|
||||
Invited to <span class="font-bold text-pink-600">{invitation.teamName}</span> with
|
||||
<span class="font-bold text-rose-600">{invitation.permission}</span> permission.
|
||||
</div>
|
||||
<button
|
||||
class="hover:bg-green-500"
|
||||
on:click={() => acceptInvitation(invitation.id, invitation.teamId)}>Accept</button
|
||||
>
|
||||
<button
|
||||
class="hover:bg-red-600"
|
||||
on:click={() => revokeInvitation(invitation.id, invitation.teamId)}>Delete</button
|
||||
>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="mx-auto max-w-4xl px-6 py-4">
|
||||
{#if $session.teamId === '0' && accounts.length > 0}
|
||||
<div class="title font-bold">Accounts</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user