-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning if there is a configuration error
- Loading branch information
Showing
10 changed files
with
197 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; | ||
import { faWarning } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import React from "react"; | ||
import { ReactNode } from "react"; | ||
import { Alert, Col, Row } from "react-bootstrap"; | ||
|
||
type AlertMessageProps = { | ||
children: ReactNode; | ||
}; | ||
const AlertMessage = ({ children }: AlertMessageProps) => { | ||
return ( | ||
<Alert variant="danger"> | ||
<Row> | ||
<Col | ||
xs={1} | ||
style={{ | ||
marginTop: "auto", | ||
marginBottom: "auto" | ||
}} | ||
> | ||
<FontAwesomeIcon | ||
icon={faWarning as IconDefinition} | ||
size="2x" | ||
/> | ||
</Col> | ||
<Col style={{ textAlign: "left" }}>{children}</Col> | ||
</Row> | ||
</Alert> | ||
); | ||
}; | ||
|
||
export default AlertMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import Card from "../card"; | ||
import Button from "../../button"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faSliders } from "@fortawesome/free-solid-svg-icons"; | ||
import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; | ||
|
||
type CalibrateCardProps = { | ||
disabled?: boolean; | ||
onClick: () => void; | ||
}; | ||
|
||
export const CalibrateCard = ({ | ||
onClick, | ||
disabled = false | ||
}: CalibrateCardProps) => { | ||
return ( | ||
<Card | ||
className="select-card" | ||
footer={ | ||
<Button onClick={onClick} disabled={disabled}> | ||
<>Calibrate</> | ||
</Button> | ||
} | ||
> | ||
<div className="select-icon"> | ||
<FontAwesomeIcon icon={faSliders as IconDefinition} size="4x" /> | ||
</div> | ||
<>Calibrate settings on your controller</> | ||
</Card> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from "react"; | ||
import { Button } from "../../components"; | ||
import { Modal } from "react-bootstrap"; | ||
import { faClose } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; | ||
import Log from "../log/Log"; | ||
import { createLogLine } from "../../utils/logutils"; | ||
|
||
type RestartModalProps = { | ||
show?: boolean; | ||
setShow: (show: boolean) => void; | ||
rows?: string[]; | ||
}; | ||
|
||
const LogModal = ({ show, setShow, rows }: RestartModalProps) => { | ||
return ( | ||
<Modal show={show} size="lg" centered> | ||
<Modal.Body> | ||
<Log onShow={() => {}} show={true} showExpand={false}> | ||
{rows?.map(createLogLine)} | ||
</Log> | ||
</Modal.Body> | ||
|
||
<Modal.Footer> | ||
<Button onClick={() => setShow(false)}> | ||
<> | ||
<FontAwesomeIcon icon={faClose as IconDefinition} />{" "} | ||
Close | ||
</> | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default LogModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/services/controllerservice/commands/GetStartupShowCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Command } from "./Command"; | ||
|
||
export class GetStartupShowCommand extends Command { | ||
constructor() { | ||
super("$Startup/Show"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
|
||
export const createLogLine = (line: string) => { | ||
line.replace("<", "<"); | ||
line = line.replace(/MSG:ERR/g, "<span class='red'>$&</span>"); | ||
line = line.replace(/MSG:INFO/g, "<span class='green'>$&</span>"); | ||
line = line.replace(/MSG:WARN/g, "<span class='yellow'>$&</span>"); | ||
line = line.replace(/MSG:DBG/g, "<span class='yellow'>$&</span>"); | ||
line = line.replace(/<Alarm/g, "<<span class='red'>Alarm</span>"); | ||
line = line.replace(/<Run/g, "<<span class='green'>Run</span>"); | ||
line = line.replace(/<Idle/g, "<<span class='green'>Idle</span>"); | ||
line = line.replace(/error:/g, "<span class='red'>error:</span>"); | ||
return <div dangerouslySetInnerHTML={{ __html: line }} />; | ||
}; |