Merge pull request #339 from coollabsio/v2.4.5

v2.4.5
This commit is contained in:
Andras Bacsai
2022-04-12 19:08:46 +02:00
committed by GitHub
4 changed files with 48 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "coolify", "name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.", "description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "2.4.4", "version": "2.4.5",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"scripts": { "scripts": {
"dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev", "dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev",

View File

@@ -1,11 +1,9 @@
// TODO: Make this functions generic
async function send({ async function send({
method, method,
path, path,
data = {}, data = {},
headers, headers,
timeout = 30000 timeout = 120000
}): Promise<Record<string, unknown>> { }): Promise<Record<string, unknown>> {
const controller = new AbortController(); const controller = new AbortController();
const id = setTimeout(() => controller.abort(), timeout); const id = setTimeout(() => controller.abort(), timeout);
@@ -53,7 +51,7 @@ async function send({
export function get( export function get(
path: string, path: string,
headers: Record<string, unknown> headers?: Record<string, unknown>
): Promise<Record<string, unknown>> { ): Promise<Record<string, unknown>> {
return send({ method: 'GET', path, headers }); return send({ method: 'GET', path, headers });
} }
@@ -61,7 +59,7 @@ export function get(
export function del( export function del(
path: string, path: string,
data: Record<string, unknown>, data: Record<string, unknown>,
headers: Record<string, unknown> headers?: Record<string, unknown>
): Promise<Record<string, unknown>> { ): Promise<Record<string, unknown>> {
return send({ method: 'DELETE', path, data, headers }); return send({ method: 'DELETE', path, data, headers });
} }
@@ -77,7 +75,7 @@ export function post(
export function put( export function put(
path: string, path: string,
data: Record<string, unknown>, data: Record<string, unknown>,
headers: Record<string, unknown> headers?: Record<string, unknown>
): Promise<Record<string, unknown>> { ): Promise<Record<string, unknown>> {
return send({ method: 'PUT', path, data, headers }); return send({ method: 'PUT', path, data, headers });
} }

View File

@@ -20,10 +20,10 @@ global
defaults defaults
mode http mode http
log global log global
timeout http-request 60s timeout http-request 120s
timeout connect 10s timeout connect 10s
timeout client 60s timeout client 120s
timeout server 60s timeout server 120s
userlist haproxy-dataplaneapi userlist haproxy-dataplaneapi
user admin insecure-password "\${HAPROXY_PASSWORD}" user admin insecure-password "\${HAPROXY_PASSWORD}"

View File

@@ -32,6 +32,7 @@
export let account; export let account;
export let accounts; export let accounts;
export let invitations;
if (accounts.length === 0) { if (accounts.length === 0) {
accounts.push(account); accounts.push(account);
} }
@@ -74,12 +75,51 @@
return errorNotification(error); 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> </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">Identity and Access Management</div> <div class="mr-4 text-2xl tracking-tight">Identity and Access Management</div>
</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"> <div class="mx-auto max-w-4xl px-6 py-4">
{#if $session.teamId === '0' && accounts.length > 0} {#if $session.teamId === '0' && accounts.length > 0}
<div class="title font-bold">Accounts</div> <div class="title font-bold">Accounts</div>