diff --git a/src/appmixer/utils/controls/Lock/Lock.js b/src/appmixer/utils/controls/Lock/Lock.js new file mode 100644 index 000000000..b4d899859 --- /dev/null +++ b/src/appmixer/utils/controls/Lock/Lock.js @@ -0,0 +1,8 @@ +module.exports = { + + async receive(context) { + + const lock = await context.lock(context.componentId); + return context.sendJson({ lock: { resource: lock.resource, value: lock.value } }, 'out') + } +} diff --git a/src/appmixer/utils/controls/Lock/component.json b/src/appmixer/utils/controls/Lock/component.json new file mode 100644 index 000000000..a2c8cf452 --- /dev/null +++ b/src/appmixer/utils/controls/Lock/component.json @@ -0,0 +1,14 @@ +{ + "name": "appmixer.utils.controls.Lock", + "description": "", + "version": "1.4.5", + "private": false, + "inPorts": [ + "in" + ], + "outPorts": [ + "out" + ] +} + + diff --git a/src/appmixer/utils/controls/Unlock/Unlock.js b/src/appmixer/utils/controls/Unlock/Unlock.js new file mode 100644 index 000000000..c81a8927e --- /dev/null +++ b/src/appmixer/utils/controls/Unlock/Unlock.js @@ -0,0 +1,7 @@ +module.exports = { + + async receive(context) { + + return context.unlock(context.messages.in.content.lock.resource, context.messages.in.content.lock.value); + } +} diff --git a/src/appmixer/utils/controls/Unlock/component.json b/src/appmixer/utils/controls/Unlock/component.json new file mode 100644 index 000000000..5e70e1998 --- /dev/null +++ b/src/appmixer/utils/controls/Unlock/component.json @@ -0,0 +1,25 @@ +{ + "name": "appmixer.utils.controls.Unlock", + "description": "", + "version": "1.4.5", + "private": false, + "inPorts": [ + { + "name": "in", + "inspector": { + "inputs": { + "lock": { + "type": "text", + "index": 1, + "label": "Lock", + "tooltip": "Lock" + } + } + } + } + ], + "outPorts": [ + "out" + ] +} +