@@ -10,13 +10,15 @@ import CommandsLinkTabSelector from 'components/basic/LinkTabSelector/CommandsLi
1010import CommandsList , { getURLByName } from 'components/views/Commands/Commands/CommandsList/CommandsList' ;
1111import InteractiveTerminal , { InteractiveTerminalProps } from 'components/advanced/InteractiveTerminal/InteractiveTerminal' ;
1212import AdvancedCodeLine from 'components/basic/CodeSnippet/AdvancedCodeLine/AdvancedCodeLine' ;
13+ import Button from '../../components/basic/Button/Button' ;
1314
1415interface Props extends DevSpaceConfigContext , PopupContext , WarningContext , RouteComponentProps { }
1516
1617interface State {
1718 podList ?: V1PodList ;
1819 selected ?: string ;
1920 terminals : StateTerminalProps [ ] ;
21+ showInternal : boolean ;
2022}
2123
2224interface StateTerminalProps extends InteractiveTerminalProps {
@@ -26,6 +28,7 @@ interface StateTerminalProps extends InteractiveTerminalProps {
2628class Commands extends React . PureComponent < Props , State > {
2729 state : State = {
2830 terminals : [ ] ,
31+ showInternal : false
2932 } ;
3033
3134 onSelectCommand = ( commandName : string ) => {
@@ -81,11 +84,18 @@ class Commands extends React.PureComponent<Props, State> {
8184 } ;
8285
8386 render ( ) {
87+ let commands = this . props . devSpaceConfig . config . commands ;
88+ if ( this . state . showInternal === false ) {
89+ commands = Object . fromEntries ( Object . entries ( commands ) . filter ( ( [ _key , config ] ) => {
90+ return config . internal !== true
91+ } ) )
92+ }
93+
8494 return (
8595 < PageLayout className = { styles [ 'commands-component' ] } heading = { < CommandsLinkTabSelector /> } >
8696 { ! this . props . devSpaceConfig . config ||
87- ! this . props . devSpaceConfig . config . commands ||
88- Object . entries ( this . props . devSpaceConfig . config . commands ) . length === 0 ? (
97+ ! this . props . devSpaceConfig . config . commands ||
98+ Object . entries ( this . props . devSpaceConfig . config . commands ) . length === 0 ? (
8999 < div className = { styles [ 'no-config' ] } >
90100 < div >
91101 No commands available. Take a look at
@@ -98,13 +108,27 @@ class Commands extends React.PureComponent<Props, State> {
98108 ) : (
99109 < React . Fragment >
100110 { this . renderTerminals ( ) }
101- < div className = { styles [ 'info-part' ] } >
102- < CommandsList
103- commandsList = { this . props . devSpaceConfig . config . commands }
104- running = { this . state . terminals . map ( ( terminal ) => terminal . url ) }
105- selected = { this . state . selected }
106- onSelect = { this . onSelectCommand }
107- />
111+ < div style = { { display : 'flex' , flexDirection : 'column' , gap : '1rem' } } >
112+ < div style = { { height : '3rem' , display : 'flex' , justifyContent : 'right' , marginRight : '10px' , marginBottom : '10px' } } >
113+ < Button
114+ onClick = { ( ) => {
115+ this . setState ( ( state ) => {
116+ return {
117+ showInternal : ! state . showInternal
118+ }
119+ } )
120+ } }
121+ > { this . state . showInternal ? 'Hide internal' : 'Show internal' } </ Button >
122+ </ div >
123+
124+ < div className = { styles [ 'info-part' ] } style = { { overflowY : 'auto' } } >
125+ < CommandsList
126+ commandsList = { commands }
127+ running = { this . state . terminals . map ( ( terminal ) => terminal . url ) }
128+ selected = { this . state . selected }
129+ onSelect = { this . onSelectCommand }
130+ />
131+ </ div >
108132 </ div >
109133 </ React . Fragment >
110134 ) }
0 commit comments