mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 12:22:54 +00:00 
			
		
		
		
	Rename WebSocketService sendJSON() -> send()
This commit is contained in:
		@@ -42,7 +42,7 @@ export class ConsoleComponent implements OnInit {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sendContent(content: string) {
 | 
					  sendContent(content: string) {
 | 
				
			||||||
    this.webSocketService.sendJSON({
 | 
					    this.webSocketService.send({
 | 
				
			||||||
      'key': 'console.content',
 | 
					      'key': 'console.content',
 | 
				
			||||||
      'value': content
 | 
					      'value': content
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,7 +72,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  sendReadyIfNeeded() {
 | 
					  sendReadyIfNeeded() {
 | 
				
			||||||
    if (config.dashboard.sendReadyAfterPageReload) {
 | 
					    if (config.dashboard.sendReadyAfterPageReload) {
 | 
				
			||||||
      setTimeout(() => this.webSocketService.sendJSON({'key': 'frontend.ready'}));
 | 
					      setTimeout(() => this.webSocketService.send({'key': 'frontend.ready'}));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -183,7 +183,7 @@ export class IdeComponent implements OnInit {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sendCodeContents() {
 | 
					  sendCodeContents() {
 | 
				
			||||||
    this.webSocketService.sendJSON({
 | 
					    this.webSocketService.send({
 | 
				
			||||||
      'key': 'ide.write',
 | 
					      'key': 'ide.write',
 | 
				
			||||||
      'filename': this.filename,
 | 
					      'filename': this.filename,
 | 
				
			||||||
      'content': this.code
 | 
					      'content': this.code
 | 
				
			||||||
@@ -191,7 +191,7 @@ export class IdeComponent implements OnInit {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  requestCode() {
 | 
					  requestCode() {
 | 
				
			||||||
    this.webSocketService.sendJSON({
 | 
					    this.webSocketService.send({
 | 
				
			||||||
      'key': 'ide.read',
 | 
					      'key': 'ide.read',
 | 
				
			||||||
      'filename': this.filename
 | 
					      'filename': this.filename
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,7 +44,7 @@ export class ProcessManagerService {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sendCommand(command: string, process_name: string) {
 | 
					  sendCommand(command: string, process_name: string) {
 | 
				
			||||||
    this.webSocketService.sendJSON({
 | 
					    this.webSocketService.send({
 | 
				
			||||||
      'key': 'process.' + command,
 | 
					      'key': 'process.' + command,
 | 
				
			||||||
      'name': process_name
 | 
					      'name': process_name
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,7 @@ export class WebSocketService {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public sendJSON(json: any) {
 | 
					  public send(json: any) {
 | 
				
			||||||
    this.ws.next(json);
 | 
					    this.ws.next(json);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,6 @@ export class TestmessengerComponent implements OnInit {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  sendTestMessage() {
 | 
					  sendTestMessage() {
 | 
				
			||||||
    const jsonObject = JSON.parse(this.messageStr);
 | 
					    const jsonObject = JSON.parse(this.messageStr);
 | 
				
			||||||
    this.webSocketService.sendJSON(jsonObject);
 | 
					    this.webSocketService.send(jsonObject);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user