Rename interfaces and variables
This commit is contained in:
@@ -5,7 +5,7 @@ import { ChangeDetectorRef, Component, EventEmitter, OnInit, Output } from '@ang
|
||||
|
||||
import { WebSocketService } from '../services/websocket.service';
|
||||
import { WebSocketMessage } from '../message-types/websocket-message';
|
||||
import { IDECommand } from '../message-types/ide-command';
|
||||
import { IDEMessage } from '../message-types/ide-message';
|
||||
import { ProcessManagerService } from '../services/processmanager.service';
|
||||
import { DeploymentNotificationService } from '../services/deployment-notification.service';
|
||||
import { config } from '../config';
|
||||
@@ -73,14 +73,14 @@ export class IdeComponent implements OnInit {
|
||||
}
|
||||
|
||||
subscribeWS() {
|
||||
this.webSocketService.observeKey<WebSocketMessage>('ide').subscribe((event) => {
|
||||
this.command_handlers[event.key](event);
|
||||
this.webSocketService.observeKey<WebSocketMessage>('ide').subscribe((message) => {
|
||||
this.command_handlers[message.key](message);
|
||||
this.changeDetectorRef.detectChanges();
|
||||
});
|
||||
}
|
||||
|
||||
subscribeFirstLanguageDetection() {
|
||||
this.webSocketService.observeKey<IDECommand>('ide.read').pipe(first()).subscribe(
|
||||
this.webSocketService.observeKey<IDEMessage>('ide.read').pipe(first()).subscribe(
|
||||
() => this.autoDetectEditorLanguageIfEnabled(this.filename)
|
||||
);
|
||||
}
|
||||
@@ -89,18 +89,18 @@ export class IdeComponent implements OnInit {
|
||||
this.processManagerService.init();
|
||||
this.processManagerService.subscribeCallback(
|
||||
config.ide.deployProcessName,
|
||||
(event) => {
|
||||
(message) => {
|
||||
this.deploymentNotificationService.deploying.next(false);
|
||||
this.newLogs.emit({
|
||||
stdout: event.stdout,
|
||||
stderr: event.stderr
|
||||
stdout: message.stdout,
|
||||
stderr: message.stderr
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
this.processManagerService.subscribeSuccessCallback(
|
||||
config.ide.deployProcessName,
|
||||
(event) => this.setDeployButtonState(DeployButtonState.DEPLOYED)
|
||||
(message) => this.setDeployButtonState(DeployButtonState.DEPLOYED)
|
||||
);
|
||||
|
||||
this.processManagerService.subscribeErrorCallback(
|
||||
@@ -109,28 +109,24 @@ export class IdeComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
reloadHandler(data: WebSocketMessage) {
|
||||
reloadHandler(message: WebSocketMessage) {
|
||||
this.requestCode();
|
||||
}
|
||||
|
||||
readHandler(data: IDECommand) {
|
||||
readHandler(message: IDEMessage) {
|
||||
if (this.codeState === CodeState.SAVED) {
|
||||
this.updateFileData(data);
|
||||
if (this.filename != message.filename) {
|
||||
this.filename = message.filename;
|
||||
}
|
||||
this.code = (message.content != null) ? message.content : this.code;
|
||||
this.files = message.files;
|
||||
}
|
||||
}
|
||||
|
||||
writeHandler(data: IDECommand) {
|
||||
writeHandler(message: IDEMessage) {
|
||||
this.setCodeState(CodeState.SAVED);
|
||||
}
|
||||
|
||||
updateFileData(data: IDECommand) {
|
||||
if (this.filename != data.filename) {
|
||||
this.filename = data.filename;
|
||||
}
|
||||
this.code = (data.content != null) ? data.content : this.code;
|
||||
this.files = data.files;
|
||||
}
|
||||
|
||||
autoDetectEditorLanguageIfEnabled(filename: string) {
|
||||
if (!config.ide.autoDetectFileLanguage) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user