feat(web): publish bot control transitions
This commit is contained in:
1 parent
ad770a792a
commit
8c8ff11fd7
2 files changed
+37
No files matched your search
@@ -8,6 +8,7 @@ export function createControlRouter(ctx: WebContext): Router {
|
||||
ctx.setBotRunning(true);
|
||||
ctx.activity.push('sent', 'Bot started by user');
|
||||
ctx.logger.info('Bot started via web UI');
|
||||
ctx.broadcaster.dashboardEvents.bot({ running: true, dryRun: ctx.config.browser.dryRun });
|
||||
res.json({ success: true, running: true });
|
||||
});
|
||||
|
||||
@@ -15,6 +16,7 @@ export function createControlRouter(ctx: WebContext): Router {
|
||||
ctx.setBotRunning(false);
|
||||
ctx.activity.push('skipped', 'Bot stopped by user');
|
||||
ctx.logger.info('Bot stopped via web UI');
|
||||
ctx.broadcaster.dashboardEvents.bot({ running: false, dryRun: ctx.config.browser.dryRun });
|
||||
res.json({ success: true, running: false });
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user