diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 2689265..70c7341 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -199,11 +199,14 @@ export default { case "ingest": data["outputNeighbours"] = []; break; - case "restreamer": - data["inputNeighbour"] = null; - data["outputURLs"] = new_node.data.url ? [new_node.data.url] : []; + case "restreamer": { + let fixed_thing = new_node.data.url.slice(-1) !== '/' ? new_node.data.url + '/' : new_node.data.url; + let full_url = new_node.data.url ? new URL("./" + new_node.data.streamkey, fixed_thing).href : null; + data["inputNeighbour"] = new_node ? new_node.apiId : null; + data["outputURLs"] = full_url ? [full_url] : full_url; translated_type = "restream"; break; + } case "encoder": data["inputNeighbour"] = null; data["outputNeighbours"] = [] @@ -279,11 +282,14 @@ export default { case "ingest": data["outputNeighbours"] = map(output_neighbors, 'apiId'); break; - case "restreamer": + case "restreamer": { + let fixed_thing = changed_node.data.url.slice(-1) !== '/' ? changed_node.data.url + '/' : changed_node.data.url; + let full_url = changed_node.data.url ? new URL("./" + changed_node.data.streamkey, fixed_thing).href : null; data["inputNeighbour"] = input_neighbor ? input_neighbor.apiId : null; - data["outputURLs"] = changed_node.data.url ? [changed_node.data.url] : []; + data["outputURLs"] = full_url ? [full_url] : full_url; translated_type = "restream"; break; + } case "encoder": data["inputNeighbour"] = input_neighbor ? input_neighbor.apiId : null; data["outputNeighbours"] = map(output_neighbors, 'apiId'); @@ -357,12 +363,20 @@ export default { height: apiNode.height } break; - case "restreamer": + case "restreamer": { + let full_url = apiNode.output_urls[0] || ''; + let url = ''; + let key = ''; + if (full_url) { + url = full_url.substring(0, full_url.lastIndexOf("/") + 1); + key = full_url.substring(full_url.lastIndexOf("/") + 1, full_url.length); + } newNode.data = { - url: apiNode.output_urls[0] || '', - streamkey: apiNode.stream_key + url: url, + streamkey: key } break; + } } newNode.id = this.idGenerator;