fix(ui): don't display "Timed Out" when executing action (#34541)
This commit is contained in:
parent
ba650161a8
commit
f15171bcf0
|
@ -40,18 +40,12 @@ export const CallTab: React.FunctionComponent<{
|
||||||
const startTimeMillis = action.startTime - startTimeOffset;
|
const startTimeMillis = action.startTime - startTimeOffset;
|
||||||
const startTime = msToString(startTimeMillis);
|
const startTime = msToString(startTimeMillis);
|
||||||
|
|
||||||
const duration = action.endTime ? msToString(action.endTime - action.startTime) : 'Timed Out';
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='call-tab'>
|
<div className='call-tab'>
|
||||||
<div className='call-line'>{action.apiName}</div>
|
<div className='call-line'>{action.apiName}</div>
|
||||||
{
|
<div className='call-section'>Time</div>
|
||||||
<>
|
<DateTimeCallLine name='start:' value={startTime} />
|
||||||
<div className='call-section'>Time</div>
|
<DateTimeCallLine name='duration:' value={renderDuration(action)} />
|
||||||
<DateTimeCallLine name='start:' value={startTime} />
|
|
||||||
<DateTimeCallLine name='duration:' value={duration} />
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
!!paramKeys.length && <>
|
!!paramKeys.length && <>
|
||||||
<div className='call-section'>Parameters</div>
|
<div className='call-section'>Parameters</div>
|
||||||
|
@ -78,6 +72,15 @@ type Property = {
|
||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function renderDuration(action: ActionTraceEventInContext): string {
|
||||||
|
if (action.endTime)
|
||||||
|
return msToString(action.endTime - action.startTime);
|
||||||
|
else if (!!action.error)
|
||||||
|
return 'Timed Out';
|
||||||
|
else
|
||||||
|
return 'Running';
|
||||||
|
}
|
||||||
|
|
||||||
function renderProperty(property: Property) {
|
function renderProperty(property: Property) {
|
||||||
let text = property.text.replace(/\n/g, '↵');
|
let text = property.text.replace(/\n/g, '↵');
|
||||||
if (property.type === 'string')
|
if (property.type === 'string')
|
||||||
|
|
Loading…
Reference in New Issue