feat(workflow): support resizing comment nodes, add theme and author display toggle
This commit is contained in:
@@ -764,6 +764,10 @@ class DifyConverter(BaseConverter):
|
|||||||
node_data = node["data"]
|
node_data = node["data"]
|
||||||
result = NoteNodeConfig.model_construct(
|
result = NoteNodeConfig.model_construct(
|
||||||
author=node_data.get("author", ""),
|
author=node_data.get("author", ""),
|
||||||
text=node_data.get("text", "")
|
text=node_data.get("text", ""),
|
||||||
|
width=node_data.get("width", 80),
|
||||||
|
height=node_data.get("height", 80),
|
||||||
|
theme=node_data.get("theme", "blue"),
|
||||||
|
show_author=node_data.get("showAuthor", True)
|
||||||
).model_dump()
|
).model_dump()
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class DifyAdapter(BasePlatformAdapter, DifyConverter):
|
|||||||
support_node_types=list(self.NODE_TYPE_MAPPING.keys())
|
support_node_types=list(self.NODE_TYPE_MAPPING.keys())
|
||||||
)
|
)
|
||||||
|
|
||||||
def map_node_type(self, platform_node_type) -> str:
|
def map_node_type(self, platform_node_type) -> NodeType:
|
||||||
return self.NODE_TYPE_MAPPING.get(platform_node_type, NodeType.UNKNOWN)
|
return self.NODE_TYPE_MAPPING.get(platform_node_type, NodeType.UNKNOWN)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -184,7 +184,7 @@ class DifyAdapter(BasePlatformAdapter, DifyConverter):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(f"convert node error - {e}", exc_info=True)
|
logger.debug(f"convert node error - {e}", exc_info=True)
|
||||||
|
|
||||||
def _convert_node_config(self, node_type: str, node: dict):
|
def _convert_node_config(self, node_type: NodeType, node: dict):
|
||||||
try:
|
try:
|
||||||
node_data = node["data"]
|
node_data = node["data"]
|
||||||
converter = self.get_node_convert(node_type)
|
converter = self.get_node_convert(node_type)
|
||||||
|
|||||||
@@ -4,5 +4,9 @@ from app.core.workflow.nodes.base_config import BaseNodeConfig
|
|||||||
|
|
||||||
|
|
||||||
class NoteNodeConfig(BaseNodeConfig):
|
class NoteNodeConfig(BaseNodeConfig):
|
||||||
author: str = Field(..., description="author")
|
author: str = Field(default="", description="author")
|
||||||
text: str = Field(..., description="note context")
|
text: str = Field(default="", description="note content")
|
||||||
|
width: int = Field(default=80)
|
||||||
|
height: int = Field(default=80)
|
||||||
|
theme: str = Field(default="blue")
|
||||||
|
show_author: bool = Field(default=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user