An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
Merge branch 'main' into scshiv29-dev/main
Andras Bacsai41a928d41b05
diff --cc src/routes/applications/[id]/index.svelteindex e1fa777d0f,a00f08d2fc..5cee3d3034--- a/src/routes/applications/[id]/index.svelte+++ b/src/routes/applications/[id]/index.svelte@@@ -34,11 -35,11 +33,10 @@@baseImages: Array<{ value: string; label: string }>;baseBuildImages: Array<{ value: string; label: string }>;};- export let isRunning;import { page, session } from '$app/stores';import { errorNotification } from '$lib/form';- import { onMount } from 'svelte';+ import { onDestroy, onMount } from 'svelte';import Select from 'svelte-select';-import Explainer from '$lib/components/Explainer.svelte';import Setting from '$lib/components/Setting.svelte';import type Prisma from '@prisma/client';@@@ -47,11 -48,22 +45,20 @@@import { get, post } from '$lib/api';import cuid from 'cuid';import { browser } from '$app/env';- import { disabledButton } from '$lib/store';+ import { disabledButton, status } from '$lib/store';import { t } from '$lib/translations';const { id } = $page.params;-let domainEl: HTMLInputElement;-let loading = false;++ let usageLoading = false;+ let usage = {+ MemUsage: 0,+ CPUPerc: 0,+ NetIO: 0+ };+ let usageInterval;+let forceSave = false;let debug = application.settings.debug;let previews = application.settings.previews;@@@ -75,16 -86,31 +84,30 @@@}];function containerClass() {- if (!$session.isAdmin || isRunning) {- return 'text-white border border-dashed border-coolgray-300 bg-transparent font-thin px-0';- }+ return 'text-white border border-dashed border-coolgray-300 bg-transparent font-thin px-0';}- if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) {- application.fqdn = `http://${cuid()}.demo.coolify.io`;++ async function getUsage() {+ if (usageLoading) return;+ usageLoading = true;+ const data = await get(`/applications/${id}/usage.json`);+ usage = data.usage;+ usageLoading = false;}- onMount(() => {+ onDestroy(() => {+ clearInterval(usageInterval);+ });+ onMount(async () => {+ if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) {+ application.fqdn = `http://${cuid()}.demo.coolify.io`;+ await handleSubmit();+ }domainEl.focus();+ await getUsage();+ usageInterval = setInterval(async () => {+ await getUsage();+ }, 1000);});-async function changeSettings(name) {if (name === 'debug') {debug = !debug;@@@ -376,12 -433,13 +428,12 @@@<label for="baseBuildImage" class="text-base font-bold text-stone-100">{$t('application.base_build_image')}</label>-<div class="custom-select-wrapper"><Select- isDisabled={!$session.isAdmin || isRunning}- containerClasses={containerClass()}+ {isDisabled}+ containerClasses={isDisabled && containerClass()}id="baseBuildImages"- showIndicator={!isRunning}+ showIndicator={!$status.application.isRunning}items={application.baseBuildImages}on:select={selectBaseBuildImage}value={application.baseBuildImage}diff --cc src/routes/applications/[id]/previews/index.svelteindex 152aa00d2a,f343c17df5..bde24d1346--- a/src/routes/applications/[id]/previews/index.svelte+++ b/src/routes/applications/[id]/previews/index.svelte@@@ -180,7 -188,7 +188,7 @@@{/each}{:else}<div class="flex-col">-- <div class="text-center font-bold text-xl">++ <div class="text-center text-xl font-bold">{$t('application.preview.no_previews_available')}</div></div>