fix
This commit is contained in:
parent
4e9084a632
commit
d7265def88
@ -106,7 +106,10 @@
|
|||||||
<th>
|
<th>
|
||||||
Обновлено:
|
Обновлено:
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th *ngIf="terminal?.socket_data?.last_ping === null">
|
||||||
|
Нет Данных
|
||||||
|
</th>
|
||||||
|
<th *ngIf="!(terminal?.socket_data?.last_ping === null)">
|
||||||
{{terminal?.socket_data?.last_ping | date:'dd.MM.yy, HH:mm:ss'}}
|
{{terminal?.socket_data?.last_ping | date:'dd.MM.yy, HH:mm:ss'}}
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -114,7 +117,10 @@
|
|||||||
<th>
|
<th>
|
||||||
Закрыто:
|
Закрыто:
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th *ngIf="terminal?.socket_data?.closed === null">
|
||||||
|
Нет Данных
|
||||||
|
</th>
|
||||||
|
<th *ngIf="!(terminal?.socket_data?.closed === null)">
|
||||||
{{terminal?.socket_data?.closed ? 'Да' : 'Нет'}}
|
{{terminal?.socket_data?.closed ? 'Да' : 'Нет'}}
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -99,8 +99,8 @@ export class TerminalsComponent implements OnInit {
|
|||||||
async getTerminal(id: string) {
|
async getTerminal(id: string) {
|
||||||
await this.jsonRpcService.rpc({
|
await this.jsonRpcService.rpc({
|
||||||
method: 'getTerminal',
|
method: 'getTerminal',
|
||||||
params: [ this.choose, id]
|
params: [this.choose, id]
|
||||||
}, RpcService.authService, false)
|
}, RpcService.authService, true)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (result) => {
|
next: (result) => {
|
||||||
let data = result.result;
|
let data = result.result;
|
||||||
|
|||||||
@ -40,11 +40,12 @@ export class JsonrpcService {
|
|||||||
private cookiesService: CookiesService
|
private cookiesService: CookiesService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
rpc(data: {method: string, params: any},service: RpcService, auth = false): Observable<any> {
|
rpc(data: {method: string, params: any}, service: RpcService, auth?: boolean): Observable<any> {
|
||||||
let headers = new HttpHeaders();
|
let headers = new HttpHeaders();
|
||||||
const token = decodeURI(this.cookiesService.getItem('token') ?? '');
|
const token = decodeURI(this.cookiesService.getItem('token') ?? '');
|
||||||
|
console.log(token);
|
||||||
headers = headers.set('Content-Type', 'application/json');
|
headers = headers.set('Content-Type', 'application/json');
|
||||||
auth ? headers.set('Authorization', token) : null;
|
auth ? headers = headers.append('Authorization', token) : null;
|
||||||
const options = {
|
const options = {
|
||||||
headers: headers,
|
headers: headers,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user