Small Cleaning and autorun bug fix

This commit is contained in:
Myx
2022-01-02 05:45:05 +01:00
parent bcdab6b162
commit 01bf3770fc
49 changed files with 208 additions and 16420 deletions

View File

@@ -8,18 +8,18 @@ import { HttpErrorResponse } from '@angular/common/http';
providedIn: 'root'
})
export class NetworkRequestsService {
constructor(private readonly _httpClient: HTTP, public toastController: ToastController) { }
constructor(private readonly httpClient: HTTP, public toastController: ToastController) { }
public sendCommand(command: string, address: string, port: number, connectionProtocol?: string,) {
const request: NetRequest = {
command: command,
}
command,
};
this._httpClient.setDataSerializer('json');
this._httpClient.setServerTrustMode('nocheck');
this.httpClient.setDataSerializer('json');
this.httpClient.setServerTrustMode('nocheck');
this._httpClient.post(encodeURI(`${connectionProtocol ?? 'http'}://${address + ":" + port}/commandbridge`), request, {
ContentType: 'text/html;'
this.httpClient.post(encodeURI(`${connectionProtocol ?? 'http'}://${address + ':' + port}/commandbridge`), request, {
contentType: 'text/html;'
}).catch(response => {
this.showErrorMessage(response);
});
@@ -34,4 +34,4 @@ export class NetworkRequestsService {
});
toast.present();
}
}
}