Fixed unreachable url

This commit is contained in:
Pünkösd Marcell 2020-12-06 19:42:57 +01:00
parent 73a30e5478
commit ae1754ca1f
2 changed files with 20 additions and 11 deletions

View File

@ -88,7 +88,7 @@
<div class="node-content node-content-long" v-if="type === 'ingest'">
<span v-if="this.apiId === null">Apply first!</span>
<span v-else><b>URL:</b> {{this.url}}</span>
<span v-else><b>URL:</b> {{this.data.url}}</span>
</div>
<div class="node-content" v-else-if="type === 'encoder'">

View File

@ -211,6 +211,12 @@ export default {
this.$api.post(`objects/streamerobjects/${translated_type}`, data).then((resp) => {
new_node.apiId = resp.data.id;
const original_node = this.model.nodes.find((n) => n.id === id);
if (original_node) {
original_node.apiId = resp.data.id;
}
return resolve();
}).catch(reject);
@ -236,18 +242,21 @@ export default {
}
// Find neighbors
// Input first
let input_neighbor = null;
const input_link = modelSnapshot.links.find((link) => link.to === changed_node.id);
if (input_link) {
input_neighbor = modelSnapshot.nodes.find((node) => node.id === input_link.from);
}
// Then output
let input_neighbor = null;
let output_neighbors = [];
const output_links = modelSnapshot.links.filter((link) => link.from === changed_node.id);
if (output_links) {
output_neighbors = modelSnapshot.nodes.filter((node) => node.id === input_link.to);
if (modelSnapshot.links.length > 0) {
// Input first
const input_link = modelSnapshot.links.find((link) => link.to === changed_node.id);
if (input_link) {
input_neighbor = modelSnapshot.nodes.find((node) => node.id === input_link.from);
}
// Then output
const output_links = modelSnapshot.links.filter((link) => link.from === changed_node.id);
if (output_links.length > 0) {
output_neighbors = modelSnapshot.nodes.filter((node) => map(output_links,'to').includes(node.id));
}
}
// Compile type specific attributes