mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-09 19:11:01 +00:00
Remove network state from frontend (#345)
This commit is contained in:
@@ -39,13 +39,6 @@ server {
|
||||
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/ {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
@@ -55,7 +55,6 @@ export default class App extends React.Component<{}, {}> {
|
||||
blockpropagation: true,
|
||||
blocklasttime: false,
|
||||
uptime: false,
|
||||
networkstate: false,
|
||||
},
|
||||
(settings) => {
|
||||
const selectedColumns = this.selectedColumns(settings);
|
||||
|
||||
@@ -25,7 +25,6 @@ export type CPUUse = Opaque<number, 'CPUUse'>;
|
||||
export type Bytes = Opaque<number, 'Bytes'>;
|
||||
export type BytesPerSecond = Opaque<number, 'BytesPerSecond'>;
|
||||
export type NetworkId = Opaque<string, 'NetworkId'>;
|
||||
export type NetworkState = Opaque<string | object, 'NetworkState'>;
|
||||
|
||||
export type BlockDetails = [
|
||||
BlockNumber,
|
||||
|
||||
@@ -23,7 +23,6 @@ import {
|
||||
BlockPropagationColumn,
|
||||
LastBlockColumn,
|
||||
UptimeColumn,
|
||||
NetworkStateColumn,
|
||||
} from './';
|
||||
|
||||
export type Column =
|
||||
@@ -44,8 +43,7 @@ export type Column =
|
||||
| typeof BlockTimeColumn
|
||||
| typeof BlockPropagationColumn
|
||||
| typeof LastBlockColumn
|
||||
| typeof UptimeColumn
|
||||
| typeof NetworkStateColumn;
|
||||
| typeof UptimeColumn;
|
||||
|
||||
export namespace Column {
|
||||
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 './LastBlockColumn';
|
||||
export * from './UptimeColumn';
|
||||
export * from './NetworkStateColumn';
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
BlockPropagationColumn,
|
||||
LastBlockColumn,
|
||||
UptimeColumn,
|
||||
NetworkStateColumn,
|
||||
} from './';
|
||||
|
||||
import './Row.css';
|
||||
@@ -64,7 +63,6 @@ export class Row extends React.Component<Row.Props, Row.State> {
|
||||
BlockPropagationColumn,
|
||||
LastBlockColumn,
|
||||
UptimeColumn,
|
||||
NetworkStateColumn,
|
||||
];
|
||||
|
||||
private renderedChangeRef = 0;
|
||||
|
||||
@@ -238,7 +238,6 @@ export namespace State {
|
||||
blockpropagation: boolean;
|
||||
blocklasttime: boolean;
|
||||
uptime: boolean;
|
||||
networkstate: boolean;
|
||||
}
|
||||
|
||||
export interface SortBy {
|
||||
|
||||
Reference in New Issue
Block a user