mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 14:12:55 +00:00 
			
		
		
		
	Implement changing between terminal menu items from API
This commit is contained in:
		@@ -24,6 +24,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
 | 
			
		||||
 | 
			
		||||
  command_handlers = {'layout':          this.layoutHandler.bind(this),
 | 
			
		||||
                      'hide_messages':   this.hideMessagesHandler.bind(this),
 | 
			
		||||
                      'terminal_menu':   this.terminalMenuSelectHandler.bind(this),
 | 
			
		||||
                      'reload_frontend': this.reloadFrontendHandlder.bind(this)};
 | 
			
		||||
 | 
			
		||||
  constructor(private deploymentNotificationService: DeploymentNotificationService,
 | 
			
		||||
@@ -65,6 +66,10 @@ export class DashboardComponent implements OnInit, OnDestroy {
 | 
			
		||||
    this.hide_messages = data.hide_messages;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  terminalMenuSelectHandler(data: LayoutCommand) {
 | 
			
		||||
    this.selectTerminalMenuItem(data.terminal_menu_item);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  reloadFrontendHandlder(data: LayoutCommand) {
 | 
			
		||||
    setTimeout(() => window.location.reload(), 2000);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,8 @@
 | 
			
		||||
// All Rights Reserved. See LICENSE file for details.
 | 
			
		||||
 | 
			
		||||
export class LayoutCommand {
 | 
			
		||||
    command: string;
 | 
			
		||||
    layout?: string;
 | 
			
		||||
    hide_messages?: boolean;
 | 
			
		||||
  command: string;
 | 
			
		||||
  layout?: string;
 | 
			
		||||
  hide_messages?: boolean;
 | 
			
		||||
  terminal_menu_item?: string;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user