mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 22:08:07 +00:00
enh: 'execute' event type
This commit is contained in:
parent
d2a1f4a93d
commit
9bd5567552
@ -199,6 +199,13 @@
|
|||||||
|
|
||||||
eventConfirmationTitle = data.title;
|
eventConfirmationTitle = data.title;
|
||||||
eventConfirmationMessage = data.message;
|
eventConfirmationMessage = data.message;
|
||||||
|
} else if (type === 'execute') {
|
||||||
|
try {
|
||||||
|
// Use Function constructor to evaluate code in a safer way
|
||||||
|
new Function(data.code)();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error executing code:', error);
|
||||||
|
}
|
||||||
} else if (type === 'input') {
|
} else if (type === 'input') {
|
||||||
eventCallback = cb;
|
eventCallback = cb;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user