From 5d722183d333f88d0c46343ca25f038b46908331 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 2 Mar 2022 11:57:03 +0100 Subject: [PATCH] feat: Languagetool service --- package.json | 2 +- .../svg/services/LanguageTool.svelte | 27 +++++++++ src/lib/database/common.ts | 9 +++ src/lib/database/services.ts | 10 ++++ src/routes/services/[id]/__layout.svelte | 17 ------ .../services/[id]/configuration/type.svelte | 3 + src/routes/services/[id]/index.svelte | 6 +- .../services/[id]/languagetool/index.json.ts | 21 +++++++ .../services/[id]/languagetool/start.json.ts | 58 +++++++++++++++++++ .../services/[id]/languagetool/stop.json.ts | 35 +++++++++++ src/routes/services/index.svelte | 3 + 11 files changed, 172 insertions(+), 19 deletions(-) create mode 100644 src/lib/components/svg/services/LanguageTool.svelte create mode 100644 src/routes/services/[id]/languagetool/index.json.ts create mode 100644 src/routes/services/[id]/languagetool/start.json.ts create mode 100644 src/routes/services/[id]/languagetool/stop.json.ts diff --git a/package.json b/package.json index dd531e946..d9b5225e0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "2.0.24", + "version": "2.0.25", "license": "AGPL-3.0", "scripts": { "dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0", diff --git a/src/lib/components/svg/services/LanguageTool.svelte b/src/lib/components/svg/services/LanguageTool.svelte new file mode 100644 index 000000000..65a8f0a03 --- /dev/null +++ b/src/lib/components/svg/services/LanguageTool.svelte @@ -0,0 +1,27 @@ + + + diff --git a/src/lib/database/common.ts b/src/lib/database/common.ts index 04bf54d6b..4638e483e 100644 --- a/src/lib/database/common.ts +++ b/src/lib/database/common.ts @@ -156,6 +156,15 @@ export const supportedServiceTypesAndVersions = [ ports: { main: 80 } + }, + { + name: 'languagetool', + fancyName: 'LanguageTool', + baseImage: 'silviof/docker-languagetool', + versions: ['latest'], + ports: { + main: 8010 + } } ]; diff --git a/src/lib/database/services.ts b/src/lib/database/services.ts index 5cbf2cbfb..56606109b 100644 --- a/src/lib/database/services.ts +++ b/src/lib/database/services.ts @@ -105,6 +105,13 @@ export async function configureServiceType({ id, type }) { type } }); + } else if (type === 'languagetool') { + await prisma.service.update({ + where: { id }, + data: { + type + } + }); } } export async function setServiceVersion({ id, version }) { @@ -128,6 +135,9 @@ export async function updatePlausibleAnalyticsService({ id, fqdn, email, usernam export async function updateNocoDbOrMinioService({ id, fqdn, name }) { return await prisma.service.update({ where: { id }, data: { fqdn, name } }); } +export async function updateLanguageToolService({ id, fqdn, name }) { + return await prisma.service.update({ where: { id }, data: { fqdn, name } }); +} export async function updateVaultWardenService({ id, fqdn, name }) { return await prisma.service.update({ where: { id }, data: { fqdn, name } }); } diff --git a/src/routes/services/[id]/__layout.svelte b/src/routes/services/[id]/__layout.svelte index e1f5b21a6..a096c14cd 100644 --- a/src/routes/services/[id]/__layout.svelte +++ b/src/routes/services/[id]/__layout.svelte @@ -110,23 +110,6 @@ loading = false; } } - // onMount(async () => { - // if ( - // service.type && - // service.destinationDockerId && - // service.version && - // service.fqdn && - // !isRunning - // ) { - // try { - // await post(`/services/${service.id}/${service.type}/stop.json`, {}); - // } catch ({ error }) { - // return errorNotification(error); - // } finally { - // loading = false; - // } - // } - // });