diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9554a42c..6b1d789a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -56,6 +56,9 @@ jobs: - name: install-cpprest run: sudo apt install libcpprest-dev + - name: install-cpprest + run: sudo apt install libcpprest-dev + - name: install-boost uses: MarkusJx/install-boost@v2.4.4 id: install-boost diff --git a/client/templates/main.html b/client/templates/main.html index 86db4342..646c9adc 100644 --- a/client/templates/main.html +++ b/client/templates/main.html @@ -329,6 +329,7 @@
deleteLayer(layer_to_delete).then(response => { if (response.ok) { super.removeNodeId(id) + updateConnectionsInLayers(id.split("-")[1]) } else { errorNotification("Failed to delete layer.\n Server is not responding now.") } @@ -569,7 +570,7 @@ if (response.ok) { editor.updateNodeDataFromId(connection.input_id, { DBID: data2.DBID, - Connections: [].concat(`${data1.DBID};${connection.output_id}`, data2.Connections), // "db_id;drawflow_id" + Connections: data2.Connections.concat(`${data1.DBID};${connection.output_id}`), // "db_id;drawflow_id" Parameters: data2.Parameters, }) } else { @@ -1369,6 +1370,7 @@ // Input selection writeIdOnConnections(input_selection_layer_id) + let sortable_list = getSortableInputList(node) let child = sortable_list.lastElementChild @@ -1397,8 +1399,9 @@ new_input_order = [] for (let i in sortable_list.childNodes) { try { - if (sortable_list.childNodes[i].textContent.includes("input")) { - new_input_order.push(Number(sortable_list.childNodes[i].textContent.split(" ")[3])) + if (sortable_list.childNodes[i].textContent.length > 0) { + console.log(sortable_list.childNodes[i].textContent) + new_input_order.push(Number(sortable_list.childNodes[i].textContent)) } } catch (e) { continue @@ -1608,6 +1611,25 @@ } } } + + function updateConnectionsInLayers(deleted_id) { + let nodes = document.getElementsByClassName("drawflow-node") + for (let i of nodes) { + const data1 = editor.getNodeFromId(i.id.split("-")[1]).data + let updatedConnections = [] + for (let connection of data1.Connections) { + if (connection.split(";")[1] == deleted_id) { + continue + } + updatedConnections.unshift(connection) + } + editor.updateNodeDataFromId(i.id.split("-")[1], { + DBID: data1.DBID, + Connections: updatedConnections, + Parameters: data1.Parameters, + }) + } + } diff --git a/py_server/mlcraft/server.py b/py_server/mlcraft/server.py index 2271bc1c..ed9dc61a 100644 --- a/py_server/mlcraft/server.py +++ b/py_server/mlcraft/server.py @@ -51,7 +51,7 @@ def add_model(user_id: int): return {"model_id": inserted_id}, HTTPStatus.CREATED -@app.route("/