mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-07-25 09:25:56 +00:00
Remove network state from frontend (#345)
This commit is contained in:
@@ -39,13 +39,6 @@ server {
|
|||||||
limit_req zone=zone burst=5;
|
limit_req zone=zone burst=5;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /network_state/ {
|
|
||||||
proxy_pass http://127.0.0.1:8000;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
limit_req zone=zone burst=5;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /health/ {
|
location /health/ {
|
||||||
proxy_pass http://127.0.0.1:8000;
|
proxy_pass http://127.0.0.1:8000;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ export default class App extends React.Component<{}, {}> {
|
|||||||
blockpropagation: true,
|
blockpropagation: true,
|
||||||
blocklasttime: false,
|
blocklasttime: false,
|
||||||
uptime: false,
|
uptime: false,
|
||||||
networkstate: false,
|
|
||||||
},
|
},
|
||||||
(settings) => {
|
(settings) => {
|
||||||
const selectedColumns = this.selectedColumns(settings);
|
const selectedColumns = this.selectedColumns(settings);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export type CPUUse = Opaque<number, 'CPUUse'>;
|
|||||||
export type Bytes = Opaque<number, 'Bytes'>;
|
export type Bytes = Opaque<number, 'Bytes'>;
|
||||||
export type BytesPerSecond = Opaque<number, 'BytesPerSecond'>;
|
export type BytesPerSecond = Opaque<number, 'BytesPerSecond'>;
|
||||||
export type NetworkId = Opaque<string, 'NetworkId'>;
|
export type NetworkId = Opaque<string, 'NetworkId'>;
|
||||||
export type NetworkState = Opaque<string | object, 'NetworkState'>;
|
|
||||||
|
|
||||||
export type BlockDetails = [
|
export type BlockDetails = [
|
||||||
BlockNumber,
|
BlockNumber,
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import {
|
|||||||
BlockPropagationColumn,
|
BlockPropagationColumn,
|
||||||
LastBlockColumn,
|
LastBlockColumn,
|
||||||
UptimeColumn,
|
UptimeColumn,
|
||||||
NetworkStateColumn,
|
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
export type Column =
|
export type Column =
|
||||||
@@ -44,8 +43,7 @@ export type Column =
|
|||||||
| typeof BlockTimeColumn
|
| typeof BlockTimeColumn
|
||||||
| typeof BlockPropagationColumn
|
| typeof BlockPropagationColumn
|
||||||
| typeof LastBlockColumn
|
| typeof LastBlockColumn
|
||||||
| typeof UptimeColumn
|
| typeof UptimeColumn;
|
||||||
| typeof NetworkStateColumn;
|
|
||||||
|
|
||||||
export namespace Column {
|
export namespace Column {
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
import * as React from 'react';
|
|
||||||
import { Column } from './';
|
|
||||||
import { Node } from '../../../state';
|
|
||||||
import { Icon } from '../../';
|
|
||||||
import icon from '../../../icons/network.svg';
|
|
||||||
import externalLinkIcon from '../../../icons/link-external.svg';
|
|
||||||
import { getHashData } from '../../../utils';
|
|
||||||
|
|
||||||
const URI_BASE =
|
|
||||||
window.location.protocol === 'https:'
|
|
||||||
? `/network_state/`
|
|
||||||
: `http://${window.location.hostname}:8000/network_state/`;
|
|
||||||
|
|
||||||
export class NetworkStateColumn extends React.Component<Column.Props, {}> {
|
|
||||||
public static readonly label = 'Network State';
|
|
||||||
public static readonly icon = icon;
|
|
||||||
public static readonly width = 16;
|
|
||||||
public static readonly setting = 'networkstate';
|
|
||||||
public static readonly sortBy = null;
|
|
||||||
|
|
||||||
public shouldComponentUpdate(nextProps: Column.Props) {
|
|
||||||
// Network state link changes when the node does
|
|
||||||
return this.props.node !== nextProps.node;
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { id } = this.props.node;
|
|
||||||
const chainLabel = getHashData().chain;
|
|
||||||
|
|
||||||
if (!chainLabel) {
|
|
||||||
return <td className="Column">-</td>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const uri = `${URI_BASE}${encodeURIComponent(chainLabel)}/${id}/`;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<td className="Column">
|
|
||||||
<a className="Column--a" href={uri} target="_blank">
|
|
||||||
<Icon src={externalLinkIcon} />
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,4 +17,3 @@ export * from './BlockTimeColumn';
|
|||||||
export * from './BlockPropagationColumn';
|
export * from './BlockPropagationColumn';
|
||||||
export * from './LastBlockColumn';
|
export * from './LastBlockColumn';
|
||||||
export * from './UptimeColumn';
|
export * from './UptimeColumn';
|
||||||
export * from './NetworkStateColumn';
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import {
|
|||||||
BlockPropagationColumn,
|
BlockPropagationColumn,
|
||||||
LastBlockColumn,
|
LastBlockColumn,
|
||||||
UptimeColumn,
|
UptimeColumn,
|
||||||
NetworkStateColumn,
|
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
import './Row.css';
|
import './Row.css';
|
||||||
@@ -64,7 +63,6 @@ export class Row extends React.Component<Row.Props, Row.State> {
|
|||||||
BlockPropagationColumn,
|
BlockPropagationColumn,
|
||||||
LastBlockColumn,
|
LastBlockColumn,
|
||||||
UptimeColumn,
|
UptimeColumn,
|
||||||
NetworkStateColumn,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
private renderedChangeRef = 0;
|
private renderedChangeRef = 0;
|
||||||
|
|||||||
@@ -238,7 +238,6 @@ export namespace State {
|
|||||||
blockpropagation: boolean;
|
blockpropagation: boolean;
|
||||||
blocklasttime: boolean;
|
blocklasttime: boolean;
|
||||||
uptime: boolean;
|
uptime: boolean;
|
||||||
networkstate: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SortBy {
|
export interface SortBy {
|
||||||
|
|||||||
Reference in New Issue
Block a user