diff --git a/frontend/src/components/LogsViewer.vue b/frontend/src/components/LogsViewer.vue index 233083dc9..fa653fc24 100644 --- a/frontend/src/components/LogsViewer.vue +++ b/frontend/src/components/LogsViewer.vue @@ -38,7 +38,7 @@ import { TopBar, MainLayout } from 'pankow'; import LogsModel from '../models/LogsModel.js'; import AppModel from '../models/AppModel.js'; -const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? 'https://' + import.meta.env.VITE_API_ORIGIN : ''; +const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? 'https://' + import.meta.env.VITE_API_ORIGIN : window.location.origin ; export default { name: 'LogsViewer', diff --git a/frontend/src/components/Terminal.vue b/frontend/src/components/Terminal.vue index e6f83eeec..a470b4116 100644 --- a/frontend/src/components/Terminal.vue +++ b/frontend/src/components/Terminal.vue @@ -74,7 +74,7 @@ import { FitAddon } from 'xterm-addon-fit'; import { create } from '../models/AppModel.js'; -const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? 'https://' + import.meta.env.VITE_API_ORIGIN : ''; +const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? 'https://' + import.meta.env.VITE_API_ORIGIN : window.location.origin; export default { name: 'Terminal', @@ -142,7 +142,6 @@ export default { } this.downloadFileDialog.downloadUrl = `${this.apiOrigin}/api/v1/apps/${this.id}/download?file=${encodeURIComponent(this.downloadFileDialog.name)}&access_token=${this.accessToken}`; - console.log(this.downloadFileDialog.downloadUrl) // we have to click the link to make the browser do the download // don't know how to prevent the browsers @@ -241,7 +240,7 @@ export default { }); // websocket cannot use relative urls - var url = `${this.apiOrigin.replace('https', 'wss')}/api/v1/apps/${this.id}/exec/${execId}/startws?tty=true&rows=${this.terminal.rows}&columns=${this.terminal.cols}&access_token=${this.accessToken}`; + const url = `${this.apiOrigin.replace('https', 'wss')}/api/v1/apps/${this.id}/exec/${execId}/startws?tty=true&rows=${this.terminal.rows}&columns=${this.terminal.cols}&access_token=${this.accessToken}`; this.socket = new WebSocket(url); this.terminal.loadAddon(new AttachAddon(this.socket));