I can delete a connection
This commit is contained in:
@@ -124,6 +124,16 @@ class WorkflowDesigner(BaseComponent):
|
||||
|
||||
return self.refresh_designer()
|
||||
|
||||
def delete_connection(self, from_id, to_id):
|
||||
for connection in self._state.connections:
|
||||
if connection.from_id == from_id and connection.to_id == to_id:
|
||||
self._state.connections.remove(connection)
|
||||
|
||||
# update db
|
||||
self._db.save_state(self._key, self._state)
|
||||
|
||||
return self.refresh_designer()
|
||||
|
||||
def set_designer_height(self, height):
|
||||
self._state.designer_height = height
|
||||
self._db.save_state(self._key, self._state)
|
||||
@@ -201,10 +211,12 @@ class WorkflowDesigner(BaseComponent):
|
||||
return f"""
|
||||
<svg class="wkf-connection-line" style="left: 0; top: 0; width: 100%; height: 100%;"
|
||||
data-from-id="{conn.from_id}" data-to-id="{conn.to_id}">
|
||||
<path d="{path}" stroke="#3b82f6" stroke-width="2" fill="none" marker-end="url(#arrowhead)"/>
|
||||
<path d="{path}" class="wkf-connection-path-thick"/>
|
||||
<path d="{path}" class="wkf-connection-path" marker-end="url(#arrowhead)"/>
|
||||
|
||||
<defs>
|
||||
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
||||
<polygon points="0 0, 10 3.5, 0 7" fill="#3b82f6"/>
|
||||
<polygon points="0 0, 10 3.5, 0 7" class="wkf-connection-path-arrowhead"/>
|
||||
</marker>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user