diff --git a/ui/src/components/Header.tsx b/ui/src/components/Header.tsx index 39be3897..8c21bb97 100644 --- a/ui/src/components/Header.tsx +++ b/ui/src/components/Header.tsx @@ -72,13 +72,13 @@ class Header extends Component { if (!oidc.getEnabled() || oidc.getLogoutUrl() === "") { SessionStore.logout(true, () => { this.props.history.push("/login"); - }); + }); } else { SessionStore.logout(false, () => { window.location.assign(oidc.getLogoutUrl()); }); } - } + }; render() { if (this.state.settings === undefined) { @@ -94,9 +94,7 @@ class Header extends Component { Change password )} - - Logout - + Logout ); diff --git a/ui/src/components/Menu.tsx b/ui/src/components/Menu.tsx index ff03a962..f0114d41 100644 --- a/ui/src/components/Menu.tsx +++ b/ui/src/components/Menu.tsx @@ -186,9 +186,7 @@ class SideMenu extends Component { key: "ns", label: "Network Server", icon: , - children: [ - { key: "ns-regions", icon: , label: Regions }, - ], + children: [{ key: "ns-regions", icon: , label: Regions }], }); } diff --git a/ui/src/stores/InternalStore.ts b/ui/src/stores/InternalStore.ts index 70dcb844..4363ff77 100644 --- a/ui/src/stores/InternalStore.ts +++ b/ui/src/stores/InternalStore.ts @@ -211,7 +211,7 @@ class InternalStore extends EventEmitter { callbackFunc(resp); }); - } + }; getRegion = (req: GetRegionRequest, callbackFunc: (resp: GetRegionResponse) => void) => { this.client.getRegion(req, SessionStore.getMetadata(), (err, resp) => { @@ -222,7 +222,7 @@ class InternalStore extends EventEmitter { callbackFunc(resp); }); - } + }; } const internalStore = new InternalStore(); diff --git a/ui/src/views/regions/ListRegions.tsx b/ui/src/views/regions/ListRegions.tsx index c61235a2..31d3f13c 100644 --- a/ui/src/views/regions/ListRegions.tsx +++ b/ui/src/views/regions/ListRegions.tsx @@ -4,10 +4,7 @@ import { Link } from "react-router-dom"; import { Space, Breadcrumb, PageHeader, Table } from "antd"; import { Region } from "@chirpstack/chirpstack-api-grpc-web/common/common_pb"; -import { - ListRegionsResponse, - RegionListItem, -} from "@chirpstack/chirpstack-api-grpc-web/api/internal_pb"; +import { ListRegionsResponse, RegionListItem } from "@chirpstack/chirpstack-api-grpc-web/api/internal_pb"; import { getEnumName } from "../helpers"; import InternalStore from "../../stores/InternalStore"; @@ -18,7 +15,6 @@ interface IState { regions?: ListRegionsResponse; } - class ListRegions extends Component { constructor(props: IProps) { super(props); @@ -65,9 +61,7 @@ class ListRegions extends Component { title: "Name", dataIndex: "name", key: "name", - render: (text, record) => ( - {text} - ), + render: (text, record) => {text}, }, { title: "Region", diff --git a/ui/src/views/regions/RegionDetails.tsx b/ui/src/views/regions/RegionDetails.tsx index 5660c198..a64381b8 100644 --- a/ui/src/views/regions/RegionDetails.tsx +++ b/ui/src/views/regions/RegionDetails.tsx @@ -6,10 +6,7 @@ import { Space, Breadcrumb, PageHeader, Card, Row, Col, List, Typography } from import ReactMarkdown from "react-markdown"; import { Region } from "@chirpstack/chirpstack-api-grpc-web/common/common_pb"; -import { - GetRegionRequest, - GetRegionResponse, -} from "@chirpstack/chirpstack-api-grpc-web/api/internal_pb"; +import { GetRegionRequest, GetRegionResponse } from "@chirpstack/chirpstack-api-grpc-web/api/internal_pb"; import { getEnumName } from "../helpers"; import InternalStore from "../../stores/InternalStore"; @@ -19,7 +16,7 @@ interface MatchParams { } interface IState { - region?: GetRegionResponse, + region?: GetRegionResponse; } interface IProps extends RouteComponentProps {} @@ -56,7 +53,9 @@ class RegionDetails extends Component { Network Server - Regions + + Regions + {this.props.match.params.name} @@ -66,14 +65,14 @@ class RegionDetails extends Component { title={this.props.match.params.name} subTitle={`common-name: ${getEnumName(Region, this.state.region.getRegion())}`} /> - {this.state.region.getUserInfo() !== "" && - - {this.state.region.getUserInfo()} - - } + {this.state.region.getUserInfo() !== "" && ( + + {this.state.region.getUserInfo()} + + )} - + { - + { ["RX2 DR", this.state.region.getRx2Dr()], ["RX2 frequency", `${this.state.region.getRx2Frequency()} Hz`], ]} - renderItem={item => {item[0]}: {item[1]}} + renderItem={item => ( + + + {item[0]}: + {" "} + {item[1]} + + )} /> {item[0]}: {item[1]}} + renderItem={item => ( + + + {item[0]}: + {" "} + {item[1]} + + )} />