From fdbe7a398b0b49217304a81dc130cd2b6e38d2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 18 Jun 2021 12:57:39 -0300 Subject: [PATCH] html: Remove restAddress variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fix problems when using manager with http servers Signed-off-by: Patrick José Pereira --- src/html/index.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/html/index.html b/src/html/index.html index a03bb8e1..6cf197c3 100644 --- a/src/html/index.html +++ b/src/html/index.html @@ -90,10 +90,10 @@

Name: {{ stream.video_and_stream.name }}

}, methods: { requestData: async function() { - const response_content = await fetch(`${this.restAddress}/v4l`) + const response_content = await fetch('v4l') this.content = await response_content.json() - const response_streams = await fetch(`${this.restAddress}/streams`) + const response_streams = await fetch('streams') this.streams = await response_streams.json() }, setControl: async function(source, id, value) { @@ -106,13 +106,13 @@

Name: {{ stream.video_and_stream.name }}

'Content-Type': 'application/json', } } - const response = await fetch(`${this.restAddress}/v4l`, settings) + const response = await fetch('v4l', settings) this.checkResponse(response) }, deleteStream: async function(stream_name) { console.log(`Deleting stream: ${stream_name}`) - const url = new URL(`${this.restAddress}/delete_stream`) + const url = new URL('delete_stream') url.searchParams.set("name", stream_name) const response = await fetch(url, {method: "DELETE"}) this.checkResponse(response).then(() => this.requestData()) @@ -154,13 +154,12 @@

Name: {{ stream.video_and_stream.name }}

'Content-Type': 'application/json', } } - const response = await fetch(`${this.restAddress}/streams`, settings) + const response = await fetch('streams', settings) this.checkResponse(response).then(() => this.requestData()) }, }, data: function() { return { - "restAddress": `${location.protocol}//${location.hostname}${(location.port ? ':'+location.port: '')}`, "content": [], "streams": [] }