2017-06-29 12:54:02 -06:00
|
|
|
import * as React from "react";
|
|
|
|
import { DangerZoneProps } from "../interfaces";
|
|
|
|
import { Row, Col } from "../../../ui/index";
|
|
|
|
import { Header } from "./header";
|
|
|
|
import { Collapse } from "@blueprintjs/core";
|
2017-08-30 23:12:11 -06:00
|
|
|
import { Content } from "../../../constants";
|
2019-04-02 13:59:37 -06:00
|
|
|
import { t } from "../../../i18next_wrapper";
|
2017-06-29 12:54:02 -06:00
|
|
|
|
|
|
|
export function DangerZone(props: DangerZoneProps) {
|
|
|
|
|
2018-03-09 02:34:24 -07:00
|
|
|
const { dispatch, onReset, botDisconnected } = props;
|
|
|
|
const { danger_zone } = props.controlPanelState;
|
2017-06-29 12:54:02 -06:00
|
|
|
|
|
|
|
return <section>
|
|
|
|
<Header
|
2018-06-18 15:12:00 -06:00
|
|
|
expanded={danger_zone}
|
2018-02-26 06:50:41 -07:00
|
|
|
title={t("Danger Zone")}
|
2017-06-29 12:54:02 -06:00
|
|
|
name={"danger_zone"}
|
2017-08-23 16:26:09 -06:00
|
|
|
dispatch={dispatch} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<Collapse isOpen={!!danger_zone}>
|
|
|
|
<Row>
|
|
|
|
<Col xs={4}>
|
|
|
|
<label>
|
|
|
|
{t("Reset hardware parameter defaults")}
|
|
|
|
</label>
|
|
|
|
</Col>
|
|
|
|
<Col xs={6}>
|
|
|
|
<p>
|
2017-08-30 23:12:11 -06:00
|
|
|
{t(Content.RESTORE_DEFAULT_HARDWARE_SETTINGS)}
|
2017-06-29 12:54:02 -06:00
|
|
|
</p>
|
|
|
|
</Col>
|
2018-01-29 11:32:32 -07:00
|
|
|
<Col xs={2} className={"centered-button-div"}>
|
2017-06-29 12:54:02 -06:00
|
|
|
<button
|
|
|
|
className="fb-button red"
|
2018-03-09 02:34:24 -07:00
|
|
|
disabled={botDisconnected}
|
2017-08-23 16:26:09 -06:00
|
|
|
onClick={onReset}>
|
2017-06-29 12:54:02 -06:00
|
|
|
{t("RESET")}
|
|
|
|
</button>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Collapse>
|
|
|
|
</section>;
|
|
|
|
}
|