Skip to content

Commit d6164e6

Browse files
committed
web: TacComponents: UpdateContainer: add update polling enable toggle
Signed-off-by: Leonard Göhrs <[email protected]>
1 parent b9da8db commit d6164e6

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

web/src/TacComponents.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import SpaceBetween from "@cloudscape-design/components/space-between";
3030
import Spinner from "@cloudscape-design/components/spinner";
3131
import Table from "@cloudscape-design/components/table";
3232

33-
import { MqttButton } from "./MqttComponents";
33+
import { MqttButton, MqttToggle } from "./MqttComponents";
3434
import { useMqttSubscription } from "./mqtt";
3535

3636
type RootfsSlot = {
@@ -221,6 +221,30 @@ export function SlotStatus() {
221221
}
222222
}
223223

224+
export function UpdateConfig() {
225+
return (
226+
<Container
227+
header={
228+
<Header
229+
variant="h3"
230+
description="Decide how updates are handled on this TAC"
231+
>
232+
Update Configuration
233+
</Header>
234+
}
235+
>
236+
<ColumnLayout columns={3} variant="text-grid">
237+
<Box>
238+
<Box variant="awsui-key-label">Update Polling</Box>
239+
<MqttToggle topic="/v1/tac/update/enable_polling">
240+
Periodically check for updates
241+
</MqttToggle>
242+
</Box>
243+
</ColumnLayout>
244+
</Container>
245+
);
246+
}
247+
224248
export function UpdateChannels() {
225249
const channels_topic = useMqttSubscription<Array<Channel>>(
226250
"/v1/tac/update/channels",
@@ -450,6 +474,7 @@ export function UpdateContainer() {
450474
}
451475
>
452476
<SpaceBetween size="m">
477+
<UpdateConfig />
453478
<UpdateChannels />
454479
<SlotStatus />
455480
</SpaceBetween>

0 commit comments

Comments
 (0)