Skip to content

Commit

Permalink
Merge pull request #765 from Senyoret1/simple-fixes
Browse files Browse the repository at this point in the history
Fixes for the UI code
  • Loading branch information
jdknives committed May 15, 2021
2 parents 08f03ce + 62e75a3 commit ec8388d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
2 changes: 0 additions & 2 deletions static/skywire-manager-src/src/app/app.datatypes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export class Node {
label: string;
localPk: string;
tcpAddr: string;
ip: string;
port: string;
version: string;
apps: Application[];
transports: Transport[];
Expand Down
27 changes: 10 additions & 17 deletions static/skywire-manager-src/src/app/services/node.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ export class NodeService {
node.localPk = response.overview.local_pk;

// Ip.
if (response.overview.local_ip && (response.overview.local_ip as string).trim()) {
if (response.overview && response.overview.local_ip && (response.overview.local_ip as string).trim()) {
node.ip = response.overview.local_ip;
} else {
node.ip = null;
Expand All @@ -508,6 +508,15 @@ export class NodeService {
const labelInfo = this.storageService.getLabelInfo(node.localPk);
node.label = labelInfo && labelInfo.label ? labelInfo.label : this.storageService.getDefaultLabel(node);

// If the node is offline, there if no need for getting the rest of the data.
if (!node.online) {
node.dmsgServerPk = '';
node.roundTripPing = '';
nodes.push(node);

return;
}

// Health data.
node.health = {
status: 200,
Expand Down Expand Up @@ -731,22 +740,6 @@ export class NodeService {
);
}

/**
* Gets a part of the node address: the ip or the port.
* @param tcpAddr Complete address.
* @param part 0 for the ip or 1 for the port.
*/
private getAddressPart(tcpAddr: string, part: number): string {
const addressParts = tcpAddr.split(':');
let port = tcpAddr;

if (addressParts && addressParts.length === 2) {
port = addressParts[part];
}

return port;
}

/**
* Restarts a node.
*/
Expand Down
1 change: 0 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"title": "Visor Info",
"label": "Bezeichnung:",
"public-key": "Öffentlicher Schlüssel:",
"port": "Port:",
"dmsg-server": "DMSG Server:",
"ping": "Ping:",
"node-version": "Visor Version:",
Expand Down
1 change: 0 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/de_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"title": "Visor Info",
"label": "Label:",
"public-key": "Public key:",
"port": "Port:",
"dmsg-server": "DMSG server:",
"ping": "Ping:",
"node-version": "Visor version:",
Expand Down
1 change: 0 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"label": "Label:",
"public-key": "Public key:",
"ip": "IP:",
"port": "Port:",
"dmsg-server": "DMSG server:",
"ping": "Ping:",
"node-version": "Visor version:",
Expand Down
1 change: 0 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"label": "Etiqueta:",
"public-key": "Llave pública:",
"ip": "IP:",
"port": "Puerto:",
"dmsg-server": "Servidor DMSG:",
"ping": "Ping:",
"node-version": "Versión del visor:",
Expand Down
1 change: 0 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/es_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"label": "Label:",
"public-key": "Public key:",
"ip": "IP:",
"port": "Port:",
"dmsg-server": "DMSG server:",
"ping": "Ping:",
"node-version": "Visor version:",
Expand Down

0 comments on commit ec8388d

Please sign in to comment.