diff --git a/src/components/Cars/LogFilter/index.jsx b/src/components/Cars/LogFilter/index.jsx
new file mode 100644
index 0000000..2d2a205
--- /dev/null
+++ b/src/components/Cars/LogFilter/index.jsx
@@ -0,0 +1,123 @@
+import React, { useState } from "react";
+import PropTypes from "prop-types";
+import {
+ FormControlLabel,
+ Grid,
+ IconButton,
+ TextField,
+ Switch,
+} from "@material-ui/core";
+import SendIcon from "@material-ui/icons/Send";
+
+import { useVehicleContext } from "../../Contexts/VehicleContext";
+import { useUserContext } from "../../Contexts/UserContext";
+import { useStatusContext } from "../../Contexts/StatusContext";
+
+const LogFilter = ({ vin }) => {
+ const { sendLogFilter, busy } = useVehicleContext();
+ const {
+ token: {
+ idToken: { jwtToken: token },
+ },
+ } = useUserContext();
+ const { setMessage } = useStatusContext();
+ const [filter, setFilter] = useState("");
+ const [enableLog, setEnableLog] = useState(true);
+ const [freq, setFreq] = useState(0);
+
+ const changeFilterHandler = (e) => {
+ setFilter(e.target.value);
+ };
+
+ const changeStartHandler = (e) => {
+ setEnableLog(e.target.checked);
+ };
+
+ const changeFreqHandler = (e) => {
+ setFreq(e.target.value);
+ };
+
+ const clickHandler = async (e) => {
+ try {
+ const data = {
+ enable: enableLog,
+ frequency: freq,
+ filter,
+ };
+ await sendLogFilter(vin, data, token);
+ setMessage(`Sent log command to ${vin}`);
+ } catch (e) {
+ setMessage(e.message);
+ }
+ };
+
+ return (
+
+
+
+ }
+ labelPlacement="top"
+ label="Logging"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+LogFilter.propTypes = {
+ vin: PropTypes.string.isRequired,
+};
+
+export default LogFilter;
diff --git a/src/components/Cars/SendCommand/index.jsx b/src/components/Cars/SendCommand/index.jsx
new file mode 100644
index 0000000..5a4add2
--- /dev/null
+++ b/src/components/Cars/SendCommand/index.jsx
@@ -0,0 +1,81 @@
+import React, { useEffect, useState } from "react";
+import PropTypes from "prop-types";
+import { FormControl, IconButton, InputLabel, Select } from "@material-ui/core";
+import SendIcon from "@material-ui/icons/Send";
+
+import { useVehicleContext } from "../../Contexts/VehicleContext";
+import commands from "../../../services/commands";
+import useStyles from "../../useStyles";
+import { useUserContext } from "../../Contexts/UserContext";
+import { useStatusContext } from "../../Contexts/StatusContext";
+
+const SendCommand = ({ vin }) => {
+ const classes = useStyles();
+ const { sendCommand, busy } = useVehicleContext();
+ const {
+ token: {
+ idToken: { jwtToken: token },
+ },
+ } = useUserContext();
+ const { setMessage } = useStatusContext();
+ const [command, setCommand] = useState("");
+
+ const changeHandler = (e) => {
+ setCommand(e.target.value);
+ };
+
+ const clickHandler = async (e) => {
+ try {
+ await sendCommand(vin, command, token);
+ setMessage(`Sent command to ${vin}`);
+ } catch (e) {
+ setMessage(e.message);
+ }
+ };
+
+ useEffect(() => {
+ if (!commands || commands.length === 0) return;
+ setCommand(commands[0].value);
+ }, []);
+
+ return (
+
+
+
+ Command
+
+
+
+
+
+
+
+ );
+};
+
+SendCommand.propTypes = {
+ vin: PropTypes.string.isRequired,
+};
+
+export default SendCommand;
diff --git a/src/components/Cars/Status/index.jsx b/src/components/Cars/Status/index.jsx
index 37facd6..333bf62 100644
--- a/src/components/Cars/Status/index.jsx
+++ b/src/components/Cars/Status/index.jsx
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import { useParams } from "react-router";
import {
+ Grid,
Table,
TableBody,
TableCell,
@@ -16,10 +17,14 @@ import {
UpdatesProvider,
useUpdatesContext,
} from "../../Contexts/UpdatesContext";
+import { VehicleProvider } from "../../Contexts/VehicleContext";
+
import { useUserContext } from "../../Contexts/UserContext";
import { useStatusContext } from "../../Contexts/StatusContext";
import useStyles from "../../useStyles";
import { LocalDateTimeString } from "../../../utils/dates";
+import SendCommand from "../SendCommand";
+import LogFilter from "../LogFilter";
const MainForm = () => {
const { vin } = useParams();
@@ -109,14 +114,24 @@ const MainForm = () => {
+
+
+
+
+
+
+
+