diff --git a/www/src/components/validated-text-input.jsx b/www/src/components/validated-text-input.jsx
index c92e67d..d163b3c 100644
--- a/www/src/components/validated-text-input.jsx
+++ b/www/src/components/validated-text-input.jsx
@@ -2,7 +2,13 @@ import { createSignal, mergeProps } from "solid-js";
function ValidatedTextInput(props) {
props = mergeProps(
- { type: "text", valid: true, onInput: () => {}, errorText: "" },
+ {
+ type: "text",
+ valid: true,
+ onInput: () => {},
+ errorText: "",
+ placeholder: "",
+ },
props
);
let [isActive, setActive] = createSignal(false);
@@ -15,6 +21,7 @@ function ValidatedTextInput(props) {
}
id={props.id}
value={props.value}
+ placeholder={props.placeholder}
onInput={props.onInput}
onFocusOut={() => setActive(true)}
/>
diff --git a/www/src/modals/create-command-modal.jsx b/www/src/modals/create-command-modal.jsx
index 288ee49..dd15e0a 100644
--- a/www/src/modals/create-command-modal.jsx
+++ b/www/src/modals/create-command-modal.jsx
@@ -26,14 +26,6 @@ function CreateCommandModal(props) {
const isCommandTypeValid = createMemo(() => commandType() !== "");
const isTitleValid = createMemo(() => title().length >= MIN_TITLE_LENGTH);
- createEffect(() => {
- let commandString = commandType()
- ? Command.CommandTypes[commandType()]
- : "";
- let protocolString = protocol() ? Command.Protocols[protocol()] : "";
- setTitle(commandString + " " + protocolString);
- });
-
const isFormValid = createMemo(
() =>
isProtocolValid() &&
@@ -46,13 +38,15 @@ function CreateCommandModal(props) {
async function handleCreateCommand() {
let command;
try {
- command = await RemotesService.createCommand({
- protocol: protocol(),
- commandNumber: commandNumber(),
- device: device(),
- commandType: commandType(),
- title: title(),
- });
+ command = await RemotesService.createCommand(
+ new Command({
+ protocol: protocol(),
+ commandNumber: commandNumber(),
+ device: device(),
+ commandType: commandType(),
+ title: title(),
+ })
+ );
} catch (e) {
setError(e.message);
return;
@@ -93,7 +87,9 @@ function CreateCommandModal(props) {
class="form-select"
onChange={(e) => setProtocol(e.target.value)}
>
-
+
{Object.keys(Command.Protocols).map((protocol) => (
))}
@@ -138,7 +134,9 @@ function CreateCommandModal(props) {
class="form-select"
onChange={(e) => setCommandType(e.target.value)}
>
-
+
{Object.keys(Command.CommandTypes).map((commandType) => (