Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for the UI code #765

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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