Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -120,7 +120,13 @@
|
||||
<nav class="nav-main">
|
||||
<div class="flex h-screen w-full flex-col items-center transition-all duration-100">
|
||||
{#if !$appSession.whiteLabeled}
|
||||
<div class="my-4 h-10 w-10"><img src="/favicon.png" alt="coolLabs logo" /></div>
|
||||
<div class="mb-2 mt-4 h-10 w-10">
|
||||
<img src="/favicon.png" alt="coolLabs logo" />
|
||||
</div>
|
||||
{:else if $appSession.whiteLabeledDetails.icon}
|
||||
<div class="mb-2 mt-4 h-10 w-10">
|
||||
<img src={$appSession.whiteLabeledDetails.icon} alt="White labeled logo" />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="flex flex-col space-y-2 py-2" class:mt-2={$appSession.whiteLabeled}>
|
||||
<a
|
||||
|
||||
@@ -57,11 +57,12 @@
|
||||
message: 'Secret added.',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
addToast({
|
||||
} else {
|
||||
addToast({
|
||||
message: 'Secret updated.',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
dispatch('refresh');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@@ -114,10 +114,33 @@
|
||||
buildPack: application.buildPack,
|
||||
deploymentType: application.deploymentType
|
||||
});
|
||||
application = {
|
||||
...application,
|
||||
...data
|
||||
};
|
||||
const baseImageCorrect = data.baseImages.filter(
|
||||
(image: any) => image.value === application.baseImage
|
||||
);
|
||||
if (baseImageCorrect.length === 0) {
|
||||
application.baseImage = data.baseImage;
|
||||
}
|
||||
application.baseImages = data.baseImages;
|
||||
|
||||
const baseBuildImageCorrect = data.baseBuildImages.filter(
|
||||
(image: any) => image.value === application.baseBuildImage
|
||||
);
|
||||
if (baseBuildImageCorrect.length === 0) {
|
||||
application.baseBuildImage = data.baseBuildImage;
|
||||
}
|
||||
application.baseBuildImages = data.baseBuildImages;
|
||||
if (application.deploymentType === 'static' && application.port !== '80') {
|
||||
application.port = data.port;
|
||||
}
|
||||
if (application.deploymentType === 'node' && application.port === '80') {
|
||||
application.port = data.port;
|
||||
}
|
||||
if (application.deploymentType === 'static' && !application.publishDirectory) {
|
||||
application.publishDirectory = data.publishDirectory;
|
||||
}
|
||||
if (application.deploymentType === 'node' && application.publishDirectory === 'out') {
|
||||
application.publishDirectory = data.publishDirectory;
|
||||
}
|
||||
}
|
||||
async function changeSettings(name: any) {
|
||||
if (name === 'debug') {
|
||||
@@ -631,9 +654,7 @@
|
||||
bind:value={application.port}
|
||||
placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
|
||||
/>
|
||||
<Explainer
|
||||
text={'The port your application listens on.'}
|
||||
/>
|
||||
<Explainer text={'The port your application listens on.'} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
|
||||
@@ -25,18 +25,38 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export let team: any;
|
||||
export let currentTeam: string;
|
||||
export let teams: any;
|
||||
import { page } from '$app/stores';
|
||||
import { errorNotification, handlerNotFoundLoad } from '$lib/common';
|
||||
import { appSession } from '$lib/store';
|
||||
import { t } from '$lib/translations';
|
||||
import DeleteIcon from '$lib/components/DeleteIcon.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import Cookies from 'js-cookie';
|
||||
const { id } = $page.params;
|
||||
|
||||
async function deleteTeam() {
|
||||
const sure = confirm('Are you sure you want to delete this team?');
|
||||
if (sure) {
|
||||
try {
|
||||
await del(`/iam/team/${id}`, { id });
|
||||
if (currentTeam === id) {
|
||||
const switchTeam = teams.find((team: any) => team.id !== id);
|
||||
const payload = await get(`/user?teamId=${switchTeam.id}`);
|
||||
if (payload.token) {
|
||||
Cookies.set('token', payload.token, {
|
||||
path: '/'
|
||||
});
|
||||
$appSession.teamId = payload.teamId;
|
||||
$appSession.userId = payload.userId;
|
||||
$appSession.permission = payload.permission;
|
||||
$appSession.isAdmin = payload.isAdmin;
|
||||
return window.location.assign('/iam');
|
||||
}
|
||||
}
|
||||
|
||||
return await goto('/iam', { replaceState: true });
|
||||
} catch (error) {
|
||||
return errorNotification(error);
|
||||
@@ -47,16 +67,18 @@
|
||||
|
||||
{#if id !== 'new'}
|
||||
<nav class="nav-side">
|
||||
<button
|
||||
on:click={deleteTeam}
|
||||
type="submit"
|
||||
disabled={!$appSession.isAdmin}
|
||||
class:hover:text-red-500={$appSession.isAdmin}
|
||||
class="icons tooltip tooltip-primary tooltip-left bg-transparent text-sm"
|
||||
data-tip={$appSession.isAdmin
|
||||
? 'Delete'
|
||||
: $t('destination.permission_denied_delete_destination')}><DeleteIcon /></button
|
||||
>
|
||||
{#if team.id !== '0'}
|
||||
<button
|
||||
on:click={deleteTeam}
|
||||
type="submit"
|
||||
disabled={!$appSession.isAdmin}
|
||||
class:hover:text-red-500={$appSession.isAdmin}
|
||||
class="icons tooltip tooltip-primary tooltip-left bg-transparent text-sm"
|
||||
data-tip={$appSession.isAdmin
|
||||
? 'Delete'
|
||||
: $t('destination.permission_denied_delete_destination')}><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</nav>
|
||||
{/if}
|
||||
<slot />
|
||||
|
||||
@@ -76,13 +76,13 @@
|
||||
<div class="flex space-x-1 p-6 font-bold">
|
||||
<div class="mr-4 text-2xl tracking-tight">{$t('index.dashboard')}</div>
|
||||
</div>
|
||||
<div class="container lg:mx-auto lg:p-0 p-5">
|
||||
<div class="container lg:mx-auto lg:p-0 px-8 p-5">
|
||||
{#if $appSession.teamId === '0'}
|
||||
<Usage />
|
||||
{/if}
|
||||
<h1 class="title text-4xl mt-10">Applications</h1>
|
||||
<h1 class="title lg:text-3xl mt-10">Applications</h1>
|
||||
<div class="divider" />
|
||||
<div class="grid grid-col gap-4 auto-cols-max grid-cols-1 lg:grid-cols-3 p-4">
|
||||
<div class="grid grid-col gap-8 auto-cols-max grid-cols-1 lg:grid-cols-3 p-4">
|
||||
{#if applications.length > 0}
|
||||
{#each applications as application}
|
||||
<a class="no-underline mb-5" href={`/applications/${application.id}`}>
|
||||
@@ -97,12 +97,12 @@
|
||||
{/if}
|
||||
{/await}
|
||||
<div class="w-full flex flex-row">
|
||||
<ApplicationsIcons {application} isAbsolute={false} />
|
||||
<div class="w-full flex flex-col ml-5">
|
||||
<h1 class="font-bold text-xl truncate">
|
||||
<ApplicationsIcons {application} isAbsolute={true} />
|
||||
<div class="w-full flex flex-col">
|
||||
<h1 class="font-bold text-lg lg:text-sm truncate">
|
||||
{application.name}
|
||||
{#if application.settings.isBot}
|
||||
<span class="text-xs"> BOT</span>
|
||||
<span class="text-xs">BOT</span>
|
||||
{/if}
|
||||
</h1>
|
||||
<div class="h-10">
|
||||
@@ -165,9 +165,9 @@
|
||||
<h1 class="">Nothing is configured yet.</h1>
|
||||
{/if}
|
||||
</div>
|
||||
<h1 class="title text-4xl mt-10">Services</h1>
|
||||
<h1 class="title lg:text-3xl mt-10">Services</h1>
|
||||
<div class="divider" />
|
||||
<div class="grid grid-col gap-4 auto-cols-max grid-cols-1 lg:grid-cols-3 p-4">
|
||||
<div class="grid grid-col gap-8 auto-cols-max grid-cols-1 lg:grid-cols-3 p-4">
|
||||
{#if services.length > 0}
|
||||
{#each services as service}
|
||||
<a class="no-underline mb-5" href={`/services/${service.id}`}>
|
||||
@@ -182,9 +182,9 @@
|
||||
{/if}
|
||||
{/await}
|
||||
<div class="w-full flex flex-row">
|
||||
<ServiceIcons type={service.type} isAbsolute={false} />
|
||||
<div class="w-full flex flex-col ml-5">
|
||||
<h1 class="font-bold text-xl truncate">{service.name}</h1>
|
||||
<ServiceIcons type={service.type} isAbsolute={true} />
|
||||
<div class="w-full flex flex-col">
|
||||
<h1 class="font-bold text-lg lg:text-sm truncate">{service.name}</h1>
|
||||
<div class="h-10">
|
||||
{#if service?.fqdn}
|
||||
<h2>{service?.fqdn.replace('https://', '').replace('http://', '')}</h2>
|
||||
@@ -223,9 +223,9 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<h1 class="title text-4xl mt-10">Databases</h1>
|
||||
<h1 class="title lg:text-3xl mt-10">Databases</h1>
|
||||
<div class="divider" />
|
||||
<div class="grid grid-col gap-4 auto-cols-max grid-cols-1 lg:grid-cols-3 p-4 mb-32">
|
||||
<div class="grid grid-col gap-8 auto-cols-max grid-cols-1 lg:grid-cols-3 p-4 mb-32">
|
||||
{#if databases.length > 0}
|
||||
{#each databases as database}
|
||||
<a class="no-underline mb-5" href={`/databases/${database.id}`}>
|
||||
@@ -239,14 +239,14 @@
|
||||
<span class="indicator-item badge bg-error badge-xs" />
|
||||
{/if}
|
||||
{/await}
|
||||
<div class="w-full flex flex-row pt-2">
|
||||
<DatabaseIcons type={database.type} isAbsolute={false} />
|
||||
<div class="w-full flex flex-col ml-5">
|
||||
<div class="w-full flex flex-row">
|
||||
<DatabaseIcons type={database.type} isAbsolute={true} />
|
||||
<div class="w-full flex flex-col">
|
||||
<div class="h-10">
|
||||
<h1 class="font-bold text-xl truncate">{database.name}</h1>
|
||||
<h1 class="font-bold text-lg lg:text-sm truncate">{database.name}</h1>
|
||||
<div class="h-10">
|
||||
{#if database?.version}
|
||||
<h2>{database?.version}</h2>
|
||||
<h2 class="text-xs">{database?.version}</h2>
|
||||
{:else}
|
||||
<h2 class="text-red-500">Not configured</h2>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user