Skip to content

Commit 26a54df

Browse files
committed
manabge recursive flow
1 parent 5799fed commit 26a54df

13 files changed

Lines changed: 275 additions & 69 deletions

File tree

otoroshi/javascript/src/components/ReportView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
22
import { firstLetterUppercase } from '../util';
33
import { NgCodeRenderer, NgSelectRenderer } from './nginputs';
44

5-
const roundNsTo = (ns) => Number.parseFloat(round(ns) / 1000000).toFixed(3);
5+
const roundNsTo = (ns) => Number.parseFloat(round(ns) / 1000000).toFixed(0);
66
const round = (num) => Math.round((num + Number.EPSILON) * 100000) / 100000;
77

88
export const ReportView = ({

otoroshi/javascript/src/components/inputs/CodeInput.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class JsonObjectAsCodeInput extends Component {
3131
onChange={(e) => {
3232
try {
3333
this.props.onChange(JSON.parse(e));
34-
} catch (ex) {}
34+
} catch (ex) { }
3535
}}
3636
/>
3737
);
@@ -63,7 +63,7 @@ export class JsonObjectAsCodeInputUpdatable extends Component {
6363
this.setState({ value }, () => {
6464
this.props.onChange(value);
6565
});
66-
} catch (ex) {}
66+
} catch (ex) { }
6767
}}
6868
/>
6969
);
@@ -172,6 +172,14 @@ export default class CodeInput extends Component {
172172
code = JSON.stringify(code, null, 2);
173173
}
174174

175+
// avoid to send json to Ace
176+
if (typeof code === 'object' && !Array.isArray(code) && code !== null) {
177+
code = JSON.stringify(code, null, 2);
178+
}
179+
180+
if (!isNaN(code))
181+
code = code + ""
182+
175183
const mode = this.getMode(this.props.mode);
176184

177185
const editor = (

otoroshi/javascript/src/extensions/workflows/DesignerActions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export function DesignerActions({ run }) {
77
<Button type="primaryColor" className='p-2 px-4' onClick={run}>
88
<i className='fas fa-flask me-1' />Test Workflow
99
</Button>
10-
<Button type="primaryColor">
10+
{/* <Button type="primaryColor">
1111
<i className='fas fa-trash' />
12-
</Button>
12+
</Button> */}
1313
</div>
1414
}

otoroshi/javascript/src/extensions/workflows/ReportExplorer.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export default function ReportExplorer({ report, handleClose, isOpen }) {
1717

1818
const stop = report.run.log.find(l => re.test(l.message))?.timestamp
1919
return [...acc, {
20-
task: log.node?.kind || log.message,
20+
task: id, //log.node?.kind || log.message,
2121
start: log.timestamp,
2222
stop,
23-
duration_ns: stop ? stop - log.timestamp : 0,
23+
duration_ns: (stop ? stop - log.timestamp : 0) * 1_000_000,
2424
ctx: {
2525
error: log.error,
2626
node: log.node,
@@ -33,20 +33,20 @@ export default function ReportExplorer({ report, handleClose, isOpen }) {
3333
const existingStep = acc[step.task]
3434

3535
if (existingStep) {
36-
return acc
37-
// return {
38-
// ...acc,
39-
// [step.task]: {
40-
// ...existingStep,
41-
// ctx: {
42-
// ...step.ctx,
43-
// plugins: [...existingStep.ctx.plugins, {
44-
// ...step,
45-
// name: `[${existingStep.ctx.plugins.length}]`
46-
// }]
47-
// }
48-
// }
49-
// }
36+
// return acc
37+
return {
38+
...acc,
39+
[step.task]: {
40+
...existingStep,
41+
ctx: {
42+
...step.ctx,
43+
plugins: [...existingStep.ctx.plugins, {
44+
...step,
45+
name: `[${existingStep.ctx.plugins.length}]`
46+
}]
47+
}
48+
}
49+
}
5050
} else {
5151
return {
5252
...acc,
@@ -60,7 +60,7 @@ export default function ReportExplorer({ report, handleClose, isOpen }) {
6060
}
6161
}
6262
}, {})
63-
const [unit, setUnit] = useState('ns');
63+
const [unit, setUnit] = useState('ms');
6464

6565
const start = report.run.log[0]?.timestamp
6666
const end = report.run.log[report.run.log.length - 1]?.timestamp
@@ -72,7 +72,8 @@ export default function ReportExplorer({ report, handleClose, isOpen }) {
7272
<ReportView
7373
report={{
7474
steps: Object.values(stepsByCategory),
75-
duration_ns: end - start
75+
duration_ns: (end - start) * 1_000_000,
76+
returned: report.returned
7677
}}
7778
isWorkflowView
7879
unit={unit}

0 commit comments

Comments
 (0)