()
| 61 | } |
| 62 | |
| 63 | render() { |
| 64 | const { runtimeContextManager } = this.props |
| 65 | const ready = runtimeContextManager.ready |
| 66 | const running = runtimeContextManager.running |
| 67 | const runSettings = runtimeContextManager.runSettings |
| 68 | |
| 69 | const iframeClass = runSettings.runType === RunType.STREAMLIT ? 'streamlit-frame' : 'view-python-frame' |
| 70 | |
| 71 | if (runSettings.runType === RunType.STREAMLIT) { |
| 72 | return ( |
| 73 | <div id="python-frame-container"> |
| 74 | <iframe ref={this.frameRef} className={iframeClass} src={this.state.frameSrc} allow="cross-origin-isolated" /> |
| 75 | <Box pl="3" pt="3" height={'100%'} backgroundColor="#040810"> |
| 76 | <Box id="terminal" ref={this.termRef}></Box> |
| 77 | </Box> |
| 78 | </div> |
| 79 | ) |
| 80 | } |
| 81 | |
| 82 | return ( |
| 83 | <div id="python-frame-container"> |
| 84 | <div id="terminal-container"> |
| 85 | <Box className="terminal-menu" px="3"> |
| 86 | <ButtonGroup size="md" my={1} height={8}> |
| 87 | {runSettings.runType === RunType.HTTP_REQUEST ? ( |
| 88 | <Select |
| 89 | size="sm" |
| 90 | variant={'filled'} |
| 91 | backgroundColor="gray.800" |
| 92 | value={runtimeContextManager.selectedHTTPScenarioID || ''} |
| 93 | placeholder="Choose test request" |
| 94 | onChange={(e) => { |
| 95 | this.setState({ responseData: null }) |
| 96 | if (!e.target.value) { |
| 97 | runtimeContextManager.updateSelectedHTTPScenarioID(null) |
| 98 | return |
| 99 | } |
| 100 | |
| 101 | const id = parseInt(e.target.value) |
| 102 | runtimeContextManager.updateSelectedHTTPScenarioID(id) |
| 103 | }} |
| 104 | > |
| 105 | {runSettings.httpScenarios.map((scenario, i) => { |
| 106 | return ( |
| 107 | <option key={i} value={scenario.id}> |
| 108 | {scenario.name} |
| 109 | </option> |
| 110 | ) |
| 111 | })} |
| 112 | </Select> |
| 113 | ) : null} |
| 114 | |
| 115 | <Button |
| 116 | size={'sm'} |
| 117 | isLoading={running} |
| 118 | loadingText="Running" |
| 119 | colorScheme="purple" |
| 120 | onClick={this.run} |
nothing calls this directly
no test coverage detected