Skip to content

Commit

Permalink
html: Remove restAddress variable
Browse files Browse the repository at this point in the history
This fix problems when using manager with http servers

Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Jun 18, 2021
1 parent b8ee312 commit fdbe7a3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ <h3>Name: {{ stream.video_and_stream.name }}</h3>
},
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) {
Expand All @@ -106,13 +106,13 @@ <h3>Name: {{ stream.video_and_stream.name }}</h3>
'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())
Expand Down Expand Up @@ -154,13 +154,12 @@ <h3>Name: {{ stream.video_and_stream.name }}</h3>
'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": []
}
Expand Down

0 comments on commit fdbe7a3

Please sign in to comment.