fixed ui issues

pull/5370/head
lianahus 9 months ago
parent e0d3d63183
commit 828f86064e
  1. 2
      libs/remix-ui/panel/src/lib/plugins/panel.css
  2. 3
      libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu-buttons.css
  3. 6
      libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu-buttons.tsx
  4. 5
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
  5. 2
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterm.tsx
  6. 18
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx
  7. 2
      libs/remix-ui/xterm/src/lib/components/xterm-wrap.tsx
  8. 3
      libs/remix-ui/xterm/src/lib/css/index.css

@ -104,7 +104,5 @@ iframe {
height: 2rem !important; height: 2rem !important;
} }
.terminal-wrap.minimized.desktop { .terminal-wrap.minimized.desktop {
height: 4.5rem !important;
} }

@ -1,6 +1,8 @@
import React, { useContext, useEffect } from 'react' // eslint-disable-line import React, { useContext, useEffect } from 'react' // eslint-disable-line
import { TerminalContext } from '../context' import { TerminalContext } from '../context'
import { RemixUiTerminalProps, SET_OPEN } from '../types/terminalTypes' import { RemixUiTerminalProps, SET_OPEN } from '../types/terminalTypes'
import './remix-ui-terminal-menu-buttons.css'
export const RemixUITerminalMenuButtons = (props: RemixUiTerminalProps) => { export const RemixUITerminalMenuButtons = (props: RemixUiTerminalProps) => {
const { xtermState, dispatchXterm, terminalState, dispatch } = useContext(TerminalContext) const { xtermState, dispatchXterm, terminalState, dispatch } = useContext(TerminalContext)
@ -18,10 +20,10 @@ export const RemixUITerminalMenuButtons = (props: RemixUiTerminalProps) => {
return ( return (
<div className='d-flex flex-row align-items-center'> <div className='d-flex flex-row align-items-center'>
<button id="tabOutput" className={`btn btn-sm border-secondary mr-2 border ${!xtermState.showOutput ? 'd-none' : ' btn-secondary'}`} onClick={selectOutput}> <button id="tabOutput" className={`xtermButton btn btn-sm border-secondary mr-2 border ${!xtermState.showOutput ? '' : 'd-flex btn-secondary'}`} onClick={selectOutput}>
Output Output
</button> </button>
<button id="tabXTerm" className={`btn btn-sm border-secondary ${xtermState.terminalsEnabled ? 'btn-secondary' : 'd-none'}`} onClick={showTerminal}> <button id="tabXTerm" className={`xtermButton btn btn-sm border-secondary ${xtermState.terminalsEnabled ? 'd-block' : 'd-none'} ${xtermState.showOutput ? 'd-none' : 'btn-secondary'}`} onClick={showTerminal}>
<span className="far fa-terminal border-0 ml-1"></span> <span className="far fa-terminal border-0 ml-1"></span>
</button> </button>
</div> </div>

@ -556,11 +556,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
})) }))
} }
const handleToggleTerminal = () => {
setIsOpen(!isOpen)
props.plugin.call('layout', 'minimize', props.plugin.profile.name, isOpen)
}
useEffect(() => { useEffect(() => {
;(async () => { ;(async () => {
const storage = await props.plugin.call('storage', 'formatString', await props.plugin.call('storage', 'getStorage')) const storage = await props.plugin.call('storage', 'formatString', await props.plugin.call('storage', 'getStorage'))

@ -54,8 +54,6 @@ const RemixUiXterm = (props: RemixUiXtermProps) => {
resize(event, pid) resize(event, pid)
} }
return ( return (
<Xterm <Xterm
addons={[fitAddon]} addons={[fitAddon]}

@ -141,13 +141,21 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
}, [xtermState.showOutput]) }, [xtermState.showOutput])
return (<> return (<>
<div style={{ flexGrow: 1 }} className='d-flex flex-row h-100'> { !xtermState.showOutput && <div style={{ flexGrow: 1 }} className='d-flex flex-row h-100'>
<> <>
{ xtermState.showOutput && <div className={`flex-row w-100 h-100 d-flex`}> { !xtermState.showOutput && <div className={`flex-row w-100 h-100 d-flex`}>
{terminals.map((xtermState) => { {terminals.map((xtermState) => {
return ( return (
<div className={`h-100 w-100 ${xtermState.hidden ? 'd-none' : 'd-block'}`} key={xtermState.pid} data-id={`remixUIXT${xtermState.pid}`}> <div className={`h-100 w-100 ${xtermState.hidden ? 'd-none' : 'd-block'}`} key={xtermState.pid} data-id={`remixUIXT${xtermState.pid}`}>
<RemixUiXterm theme={theme} setTerminalRef={setTerminalRef} timeStamp={xtermState.timeStamp} send={send} resize={resize} pid={xtermState.pid} plugin={plugin}></RemixUiXterm> <RemixUiXterm
theme={theme}
setTerminalRef={setTerminalRef}
timeStamp={xtermState.timeStamp}
send={send}
resize={resize}
pid={xtermState.pid}
plugin={plugin}
></RemixUiXterm>
</div> </div>
) )
})} })}
@ -156,7 +164,7 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
return (<button return (<button
key={index} key={index}
onClick={async () => selectTerminal(xtermState)} onClick={async () => selectTerminal(xtermState)}
className={`btn btn-sm mt-2 ${xtermState.hidden ? 'border border-secondary' : 'btn-secondary'}`} className={`btn btn-sm m-1 p-1 px-2 ${xtermState.hidden ? 'border border-secondary' : 'btn-secondary'}`}
> >
<span className="fa fa-terminal border-0 p-0 m-0"></span> <span className="fa fa-terminal border-0 p-0 m-0"></span>
</button>) </button>)
@ -165,7 +173,7 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
</div> </div>
} }
</> </>
</div> </div>}
</>) </>)
} }

@ -232,6 +232,6 @@ export class Xterm extends React.Component<IProps> {
} }
render() { render() {
return <div className={this.props.className} ref={this.terminalRef} /> return <div className={`${this.props.className} mt-2 ml-2`} ref={this.terminalRef} />
} }
} }

@ -1,3 +1,4 @@
.xterm-panel-left { .xterm-panel-left {
overflow: scroll; overflow-y: scroll;
margin-bottom: 2.1rem;
} }

Loading…
Cancel
Save