|
|
@ -2,7 +2,7 @@ import {Component, OnInit} from "@angular/core"; |
|
|
import {HttpClient} from "@angular/common/http"; |
|
|
import {HttpClient} from "@angular/common/http"; |
|
|
import {PacketGroup} from "../../entities/PacketGroup"; |
|
|
import {PacketGroup} from "../../entities/PacketGroup"; |
|
|
import {Chart} from "chart.js/auto"; |
|
|
import {Chart} from "chart.js/auto"; |
|
|
import {numToColor} from "../../utils/Utils"; |
|
|
import {devicesToRequest, numToColor} from "../../utils/Utils"; |
|
|
import {KeyValueMap} from "../../entities/KeyValueMap"; |
|
|
import {KeyValueMap} from "../../entities/KeyValueMap"; |
|
|
import {NodeDTO} from "../../entities/NodeDTO"; |
|
|
import {NodeDTO} from "../../entities/NodeDTO"; |
|
|
import {ActivatedRoute} from "@angular/router"; |
|
|
import {ActivatedRoute} from "@angular/router"; |
|
|
@ -192,7 +192,7 @@ export class NetworkStatusComponent implements OnInit { |
|
|
switch (num) { |
|
|
switch (num) { |
|
|
case 0: { |
|
|
case 0: { |
|
|
this.MODE = "ALL"; |
|
|
this.MODE = "ALL"; |
|
|
this.http.get(`api/nodes/list`).subscribe( |
|
|
this.http.get(`api/nodes/list?q=${devicesToRequest()}`).subscribe( |
|
|
(obj) => { |
|
|
(obj) => { |
|
|
(obj as NodeDTO[]).forEach( |
|
|
(obj as NodeDTO[]).forEach( |
|
|
(node) => { |
|
|
(node) => { |
|
|
@ -211,7 +211,7 @@ export class NetworkStatusComponent implements OnInit { |
|
|
default: { |
|
|
default: { |
|
|
this.MODE = "NODE"; |
|
|
this.MODE = "NODE"; |
|
|
this.NUM = num; |
|
|
this.NUM = num; |
|
|
this.http.get(`api/nodes/${num}`).subscribe( |
|
|
this.http.get(`api/nodes/${num}?q=${devicesToRequest()}`).subscribe( |
|
|
(obj) => { |
|
|
(obj) => { |
|
|
const node: NodeDTO = obj as NodeDTO |
|
|
const node: NodeDTO = obj as NodeDTO |
|
|
if (node) |
|
|
if (node) |
|
|
@ -247,7 +247,7 @@ export class NetworkStatusComponent implements OnInit { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.http.get(`api/packet/signal?before=${before}&after=${after}&nums=${this.NUM}`).subscribe( |
|
|
this.http.get(`api/packet/signal?before=${before}&after=${after}&nums=${this.NUM}${devicesToRequest()}`).subscribe( |
|
|
(obj) => { |
|
|
(obj) => { |
|
|
this.signalChart.config.data = {labels: [], datasets:[{label: "snr",data:[]},{label: "rssi",data:[]}]}; |
|
|
this.signalChart.config.data = {labels: [], datasets:[{label: "snr",data:[]},{label: "rssi",data:[]}]}; |
|
|
(obj as PacketSignalDTO[]).forEach( |
|
|
(obj as PacketSignalDTO[]).forEach( |
|
|
@ -271,7 +271,7 @@ export class NetworkStatusComponent implements OnInit { |
|
|
(graph) => { |
|
|
(graph) => { |
|
|
graph.cards.forEach((settings:any) => { |
|
|
graph.cards.forEach((settings:any) => { |
|
|
if (this.MODE != graph.requestMode) return; |
|
|
if (this.MODE != graph.requestMode) return; |
|
|
this.http.get(`${graph.endpoint}${settings.params}&before=${settings.before}&after=${settings.after}&${this.NUM == 0?'':('&nums='+this.NUM)}`) |
|
|
this.http.get(`${graph.endpoint}${settings.params}&before=${settings.before}&after=${settings.after}&${this.NUM == 0?'':('&nums='+this.NUM)}${devicesToRequest()}`) |
|
|
.subscribe((data) => { |
|
|
.subscribe((data) => { |
|
|
settings.config.data = { |
|
|
settings.config.data = { |
|
|
labels: [], |
|
|
labels: [], |
|
|
|