|
|
@ -3,8 +3,9 @@ import { observer } from "mobx-react"; |
|
|
|
import * as React from "react"; |
|
|
|
import * as React from "react"; |
|
|
|
import { DropdownItemProps, DropdownProps, Form, Header, Segment } from "semantic-ui-react"; |
|
|
|
import { DropdownItemProps, DropdownProps, Form, Header, Segment } from "semantic-ui-react"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { Duration } from "@common/Duration"; |
|
|
|
import log from "@common/logger"; |
|
|
|
import log from "@common/logger"; |
|
|
|
import { Duration, Section } from "@common/sprinklers"; |
|
|
|
import { Section } from "@common/sprinklers"; |
|
|
|
import DurationInput from "./DurationInput"; |
|
|
|
import DurationInput from "./DurationInput"; |
|
|
|
|
|
|
|
|
|
|
|
@observer |
|
|
|
@observer |
|
|
@ -17,7 +18,7 @@ export default class RunSectionForm extends React.Component<{ |
|
|
|
constructor() { |
|
|
|
constructor() { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
this.state = { |
|
|
|
this.state = { |
|
|
|
duration: new Duration(1, 1), |
|
|
|
duration: new Duration(0, 0), |
|
|
|
section: "", |
|
|
|
section: "", |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
@ -67,7 +68,7 @@ export default class RunSectionForm extends React.Component<{ |
|
|
|
} |
|
|
|
} |
|
|
|
const section: Section = this.props.sections[this.state.section]; |
|
|
|
const section: Section = this.props.sections[this.state.section]; |
|
|
|
const { duration } = this.state; |
|
|
|
const { duration } = this.state; |
|
|
|
section.run(duration) |
|
|
|
section.run(duration.toSeconds()) |
|
|
|
.then((result) => log.debug({ result }, "requested section run")) |
|
|
|
.then((result) => log.debug({ result }, "requested section run")) |
|
|
|
.catch((err) => log.error(err, "error running section")); |
|
|
|
.catch((err) => log.error(err, "error running section")); |
|
|
|
} |
|
|
|
} |
|
|
|