-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flow): add search button to get a flow tree
- Loading branch information
1 parent
eb93a60
commit 59b0423
Showing
4 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
async function handler(req, res) { | ||
const {connectionName, flowHost} = req.params; | ||
const {depth, jobId, maxChildren, queueName} = req.query; | ||
const {Flows} = req.app.locals; | ||
const flow = await Flows.get(connectionName, flowHost); | ||
if (!flow) return res.status(404).json({error: 'flow not found'}); | ||
try { | ||
const flowTree = await flow.getFlow({ | ||
id: jobId, | ||
queueName, | ||
depth: Number(depth), | ||
maxChildren: Number(maxChildren), | ||
}); | ||
return res.status(200).json(flowTree); | ||
} catch (err) { | ||
return res.status(500).json({error: err.message}); | ||
} | ||
} | ||
module.exports = handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters