Skip to content

Commit

Permalink
web/em-debug: Add reflash and reboot button for Bricklet
Browse files Browse the repository at this point in the history
  • Loading branch information
photron committed Apr 16, 2024
1 parent 6e5d34f commit da69c4e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions software/web/src/modules/em_debug/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { IndicatorGroup } from "../../ts/components/indicator_group";
import { InputText } from "../../ts/components/input_text";
import { OutputFloat } from "../../ts/components/output_float";
import { PageHeader } from "../../ts/components/page_header";
import { Button } from "react-bootstrap";
import { SubPage } from "../../ts/components/sub_page";
import { NavbarItem } from "../../ts/components/navbar_item";
import { Terminal } from "react-feather";
Expand Down Expand Up @@ -56,6 +57,12 @@ export class EMDebug extends Component {
return (
<SubPage name="em_debug">
<PageHeader title={__("em_debug.content.em_debug")}/>
<FormRow label={__("em_debug.content.reset_description")} label_muted={__("em_debug.content.reset_description_muted")}>
<div class="input-group pb-2">
<Button variant="primary" className="form-control rounded-right mr-2" onClick={() => API.call('energy_manager/reset', {}, "")}>{__("em_debug.content.reset_em")}</Button>
<Button variant="primary" className="form-control rounded-left" onClick={() => API.call('energy_manager/reflash', {}, "")}>{__("em_debug.content.reflash_em")}</Button>
</div>
</FormRow>

<FormSeparator heading={__("em_debug.content.protocol")} first={true} />
<DebugLogger translationPrefix="em_debug" />
Expand Down
7 changes: 6 additions & 1 deletion software/web/src/modules/em_debug/translation_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
"state_input_voltage": "Eingangsspannung",

"low": "Low",
"high": "High"
"high": "High",

"reset_description": "Aktionen",
"reset_description_muted": "",
"reset_em": "Neu starten",
"reflash_em": "Neu flashen"
},
"script": {
"loading_debug_report": "Lade Debug-Report",
Expand Down
7 changes: 6 additions & 1 deletion software/web/src/modules/em_debug/translation_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
"state_input_voltage": "Input voltage",

"low": "Low",
"high": "High"
"high": "High",

"reset_description": "Actions",
"reset_description_muted": "",
"reset_em": "Restart",
"reflash_em": "Reflash"
},
"script": {
"loading_debug_report": "Loading debug protocol",
Expand Down
6 changes: 6 additions & 0 deletions software/web/src/modules/energy_manager/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ export interface history_energy_manager_daily_changed {
energy_import: number[];
energy_export: number[];
}

export interface reflash {
}

export interface reset {
}

0 comments on commit da69c4e

Please sign in to comment.