File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
resources/scripts/components/server Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ export default () => {
4949 '\u001b[1m\u001b[41m[Internal] ' + line . replace ( / (?: \r \n | \r | \n ) $ / im, '' ) + '\u001b[0m' ,
5050 ) ;
5151
52+ const handlePowerChangeEvent = ( state : string ) => terminal . writeln (
53+ '\u001b[1m\u001b[33m[Status Change] Server marked as ' + state + '...\u001b[0m' ,
54+ ) ;
55+
5256 const handleCommandKeydown = ( e : React . KeyboardEvent < HTMLInputElement > ) => {
5357 if ( e . key !== 'Enter' || ( e . key === 'Enter' && e . currentTarget . value . length < 1 ) ) {
5458 return ;
@@ -72,14 +76,16 @@ export default () => {
7276 if ( connected && instance ) {
7377 terminal . clear ( ) ;
7478
79+ instance . addListener ( 'status' , handlePowerChangeEvent ) ;
7580 instance . addListener ( 'console output' , handleConsoleOutput ) ;
7681 instance . addListener ( 'daemon error' , handleDaemonErrorOutput ) ;
7782 instance . send ( 'send logs' ) ;
7883 }
7984
8085 return ( ) => {
8186 instance && instance . removeListener ( 'console output' , handleConsoleOutput )
82- . removeListener ( 'daemon error' , handleDaemonErrorOutput ) ;
87+ . removeListener ( 'daemon error' , handleDaemonErrorOutput )
88+ . removeListener ( 'status' , handlePowerChangeEvent ) ;
8389 } ;
8490 } , [ connected , instance ] ) ;
8591
You can’t perform that action at this time.
0 commit comments