fix: bot deployments
This commit is contained in:
parent
9b51936131
commit
bac55cd90d
@ -70,7 +70,10 @@ export const features = readable({
|
||||
});
|
||||
|
||||
export const location: Writable<null | string> = writable(null)
|
||||
export const setLocation = (resource: any) => {
|
||||
export const setLocation = (resource: any, settings?: any) => {
|
||||
if (resource.settings.isBot) {
|
||||
return location.set(`http://${settings.ipv4}:${resource.exposePort}`)
|
||||
}
|
||||
if (GITPOD_WORKSPACE_URL && resource.exposePort) {
|
||||
const { href } = new URL(GITPOD_WORKSPACE_URL);
|
||||
const newURL = href
|
||||
|
@ -127,18 +127,14 @@
|
||||
$status.application.loading = false;
|
||||
$status.application.initialLoading = false;
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
$status.application.initialLoading = true;
|
||||
$location = null;
|
||||
clearInterval(statusInterval);
|
||||
});
|
||||
onMount(async () => {
|
||||
setLocation(application);
|
||||
console.log(settings)
|
||||
if (application.settings.isBot) {
|
||||
$location = `${settings.ipv4}:${application.exposePort}`;
|
||||
console.log($location)
|
||||
}
|
||||
setLocation(application, settings);
|
||||
$status.application.isRunning = false;
|
||||
$status.application.isExited = false;
|
||||
$status.application.loading = false;
|
||||
|
@ -5,7 +5,8 @@
|
||||
if (stuff?.application?.id) {
|
||||
return {
|
||||
props: {
|
||||
application: stuff.application
|
||||
application: stuff.application,
|
||||
settings: stuff.settings
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -26,6 +27,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
export let application: any;
|
||||
export let settings: any;
|
||||
import { page } from '$app/stores';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import Select from 'svelte-select';
|
||||
@ -132,6 +134,7 @@
|
||||
}
|
||||
if (name === 'isBot') {
|
||||
isBot = !isBot;
|
||||
setLocation(application, settings);
|
||||
}
|
||||
try {
|
||||
await post(`/applications/${id}/settings`, {
|
||||
@ -181,7 +184,7 @@
|
||||
exposePort: application.exposePort
|
||||
}));
|
||||
await post(`/applications/${id}`, { ...application });
|
||||
setLocation(application);
|
||||
setLocation(application, settings);
|
||||
$disabledButton = false;
|
||||
forceSave = false;
|
||||
addToast({
|
||||
|
Loading…
x
Reference in New Issue
Block a user