Skip to content

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.

fix: bots

Andras Bacsai1bd08cb2dbc6
diff --git a/apps/ui/src/lib/store.ts b/apps/ui/src/lib/store.ts
index 0656ada548..89e38b6b82 100644
--- a/apps/ui/src/lib/store.ts
+++ b/apps/ui/src/lib/store.ts
@@ -71,7 +71,8 @@ export const features = readable({
export const location: Writable<null | string> = writable(null)
export const setLocation = (resource: any, settings?: any) => {
- if (resource.settings.isBot) {
+ if (resource.settings.isBot && resource.exposePort) {
+ disabledButton.set(false);
return location.set(`http://${settings.ipv4}:${resource.exposePort}`)
}
if (GITPOD_WORKSPACE_URL && resource.exposePort) {
@@ -84,7 +85,12 @@ export const setLocation = (resource: any, settings?: any) => {
const newURL = `https://${CODESANDBOX_HOST.replace(/\$PORT/, resource.exposePort)}`
return location.set(newURL)
}
- return location.set(resource.fqdn)
+ if (resource.fqdn) {
+ return location.set(resource.fqdn)
+ } else {
+ location.set(null);
+ disabledButton.set(true);
+ }
}
export const toasts: any = writable([])
diff --git a/apps/ui/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelte
index fbdeb43f8c..baa74eb94a 100644
--- a/apps/ui/src/routes/applications/[id]/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/index.svelte
@@ -134,6 +134,7 @@
}
if (name === 'isBot') {
isBot = !isBot;
+ application.settings.isBot = isBot;
setLocation(application, settings);
}
try {
@@ -486,7 +487,7 @@
bind:setting={isBot}
on:click={() => changeSettings('isBot')}
title="Is your application a bot?"
- description="You can deploy applications without domains. <br>They will listen on <span class='text-green-500 font-bold'>IP:PORT</span> instead.<br></Setting><br>Useful for <span class='text-green-500 font-bold'>example bots.</span>"
+ description="You can deploy applications without domains. <br>They will listen on <span class='text-green-500 font-bold'>IP:EXPOSEDPORT</span> instead.<br></Setting><br>Useful to host <span class='text-green-500 font-bold'>Twitch bots.</span>"
/>
</div>
{#if !isBot}