diff --git a/spug_web/src/pages/deploy/request/Ext1Console.js b/spug_web/src/pages/deploy/request/Ext1Console.js index 94007a4..b8473d1 100644 --- a/spug_web/src/pages/deploy/request/Ext1Console.js +++ b/spug_web/src/pages/deploy/request/Ext1Console.js @@ -6,7 +6,7 @@ import React, { useEffect, useState } from 'react'; import { observer, useLocalStore } from 'mobx-react'; import { Card, Progress, Modal, Collapse, Steps, Skeleton } from 'antd'; -import { ShrinkOutlined, CaretRightOutlined, LoadingOutlined, CloseOutlined, CodeOutlined } from '@ant-design/icons'; +import { ShrinkOutlined, LoadingOutlined, CloseOutlined, CodeOutlined } from '@ant-design/icons'; import OutView from './OutView'; import { http, X_TOKEN } from 'libs'; import styles from './index.module.less'; @@ -161,10 +161,7 @@ function Ext1Console(props) { )} - }> + {Object.entries(hosts).map(([key, item], index) => ( 0 ? 24 : 0}} - expandIcon={({isActive}) => }> + style={{marginTop: sActions.length > 0 ? 24 : 0}}> {hostOutputs.map((item, index) => ( { - if (status === -2) { - return ; - } else if (status === 0) { - return ( -
-
{this.lastOutputs[key]}
- -
- ) - } else { - return ( -
-
{this.lastOutputs[key]}
- - - -
- ) - } - }; + StatusExtra = (props) => ( +
+ {props.status === -2 ? ( + + ) : ( + <> +
{this.lastOutputs[props.id]}
+ {props.status === 0 ? ( + + ) : ( + + + + )} + + )} + this.openTerminal(e, props.id)}/> +
+ ) handleUpdate = (data) => { this.setState(data, () => { @@ -111,6 +110,11 @@ class ExecConsole extends React.Component { }) } + openTerminal = (e, key) => { + e.stopPropagation() + window.open(`/ssh?id=${key}`) + } + render() { const {isFullscreen, activeKey} = this.state; return ( @@ -131,13 +135,12 @@ class ExecConsole extends React.Component { accordion className={styles.collapse} activeKey={activeKey} - onChange={key => this.handleUpdate({activeKey: key})} - expandIcon={({isActive}) => }> + onChange={key => this.handleUpdate({activeKey: key})}> {Object.entries(store.outputs).map(([key, item], index) => ( {item['title']}} - extra={this.genExtra(item.status, key)}> + header={
{item.title}
} + extra={}> this.outputs[key]}