<commit_before>import * as React from "react";
import { BotState } from "../interfaces";
import { Diagnosis, DiagnosisProps } from "./diagnosis";
import { ConnectivityRow, StatusRowProps } from "./connectivity_row";
import { Row, Col } from "../../ui";
import { ConnectivityDiagram } from "./diagram";
import {
  ChipTemperatureDisplay, WiFiStrengthDisplay, VoltageDisplay
} from "../components/fbos_settings/fbos_details";
import { t } from "../../i18next_wrapper";

export interface ConnectivityProps {
  bot: BotState;
  rowData: StatusRowProps[];
  flags: DiagnosisProps;
}

interface ConnectivityState {
  hoveredConnection: string | undefined;
}

export class Connectivity
  extends React.Component<ConnectivityProps, ConnectivityState> {
  state: ConnectivityState = { hoveredConnection: undefined };

  hover = (name: string) =>
    () => this.setState({ hoveredConnection: name });

  render() {
    const { informational_settings } = this.props.bot.hardware;
    const { soc_temp, wifi_level, throttled } = informational_settings;
    return <div className="connectivity">
      <Row>
        <Col md={12} lg={4}>
          <ConnectivityDiagram
            rowData={this.props.rowData}
            hover={this.hover}
            hoveredConnection={this.state.hoveredConnection} />
          <div className="fbos-info">
            <label>{t("Raspberry Pi Info")}</label>
            <ChipTemperatureDisplay temperature={soc_temp} />
            <WiFiStrengthDisplay wifiStrength={wifi_level} />
            <VoltageDisplay throttled={throttled} />
          </div>
        </Col>
        <Col md={12} lg={8}>
          <ConnectivityRow from={t("from")} to={t("to")} header={true} />
          {this.props.rowData
            .map((x, y) => <ConnectivityRow {...x} key={y}
              hover={this.hover}
              hoveredConnection={this.state.hoveredConnection} />)}
          <hr style={{ marginLeft: "3rem" }} />
          <Diagnosis {...this.props.flags} />
        </Col>
      </Row>
    </div>;
  }<commit_msg>Provide link to docs in connectivity panel<commit_after>import * as React from "react";
import { BotState } from "../interfaces";
import { Diagnosis, DiagnosisProps } from "./diagnosis";
import { ConnectivityRow, StatusRowProps } from "./connectivity_row";
import { Row, Col } from "../../ui";
import { ConnectivityDiagram } from "./diagram";
import {
  ChipTemperatureDisplay, WiFiStrengthDisplay, VoltageDisplay
} from "../components/fbos_settings/fbos_details";
import { t } from "../../i18next_wrapper";

export interface ConnectivityProps {
  bot: BotState;
  rowData: StatusRowProps[];
  flags: DiagnosisProps;
}

interface ConnectivityState {
  hoveredConnection: string | undefined;
}

export class Connectivity
  extends React.Component<ConnectivityProps, ConnectivityState> {
  state: ConnectivityState = { hoveredConnection: undefined };

  hover = (name: string) =>
    () => this.setState({ hoveredConnection: name });

  render() {
    const { informational_settings } = this.props.bot.hardware;
    const { soc_temp, wifi_level, throttled } = informational_settings;
    return <div className="connectivity">
      <Row>
        <Col md={12} lg={4}>
          <ConnectivityDiagram
            rowData={this.props.rowData}
            hover={this.hover}
            hoveredConnection={this.state.hoveredConnection} />
          <div className="fbos-info">
            <label>{t("Raspberry Pi Info")}</label>
            <ChipTemperatureDisplay temperature={soc_temp} />
            <WiFiStrengthDisplay wifiStrength={wifi_level} />
            <VoltageDisplay throttled={throttled} />
          </div>
          <div>
            <i className="fa fa-question-circle" />
            {" "}
            <a href="https://software.farm.bot/docs/connecting-farmbot-to-the-internet">
              Click here to learn more about error codes.
              </a>
          </div>
        </Col>
        <Col md={12} lg={8}>
          <ConnectivityRow from={t("from")} to={t("to")} header={true} />
          {this.props.rowData
            .map((x, y) => <ConnectivityRow {...x} key={y}
              hover={this.hover}
              hoveredConnection={this.state.hoveredConnection} />)}
          <hr style={{ marginLeft: "3rem" }} />
          <Diagnosis {...this.props.flags} />
        </Col>
      </Row>
    </div>;
  }
{'fraction_non_alphanumeric': 0.14465841357175607, 'fraction_numerical': 0.0041265474552957355, 'mean_word_length': 2.7482817869415808, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 56, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6262926', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1254, 'n_words': 272}