Add accumulator preview reordering
This commit is contained in:
+16
@@ -343,6 +343,7 @@ try:
|
||||
LOOP_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
accumulator_delete_entries,
|
||||
accumulator_list_entries,
|
||||
accumulator_move_entry,
|
||||
)
|
||||
from .prompt_builder import (
|
||||
build_camera_config_json,
|
||||
@@ -418,6 +419,7 @@ except ImportError:
|
||||
LOOP_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
accumulator_delete_entries,
|
||||
accumulator_list_entries,
|
||||
accumulator_move_entry,
|
||||
)
|
||||
from prompt_builder import (
|
||||
build_camera_config_json,
|
||||
@@ -524,6 +526,20 @@ if PromptServer is not None and web is not None:
|
||||
except Exception as exc:
|
||||
return web.json_response({"error": str(exc)}, status=400)
|
||||
|
||||
@PromptServer.instance.routes.post("/sxcp/accumulator/move")
|
||||
async def sxcp_accumulator_move(request):
|
||||
try:
|
||||
payload = await request.json()
|
||||
result = accumulator_move_entry(
|
||||
store_key=str(payload.get("store_key") or ""),
|
||||
entry_id=str(payload.get("entry_id") or ""),
|
||||
index=int(payload.get("index") or 0),
|
||||
direction=str(payload.get("direction") or "up"),
|
||||
)
|
||||
return web.json_response(result)
|
||||
except Exception as exc:
|
||||
return web.json_response({"error": str(exc)}, status=400)
|
||||
|
||||
|
||||
class SxCPPromptBuilder:
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user