Skip to content

Commit

Permalink
Minor fixes and linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcd00 committed Sep 4, 2024
1 parent 26e7152 commit bf4a042
Show file tree
Hide file tree
Showing 39 changed files with 270 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Configuration = ({ refreshCalendar, openDialog }: ConfigurationProps) => {
coreURL,
reconcile
}: ConfigurationForm, e: BaseSyntheticEvent<object> | undefined) => {
console.log("SUBMITTING")
console.log("SUBMITTING");
if ((e?.nativeEvent as unknown as NativeEvent)
.submitter.name === "auto-mode") {
openDialog();
Expand All @@ -57,7 +57,7 @@ const Configuration = ({ refreshCalendar, openDialog }: ConfigurationProps) => {
<form
method="post"
onSubmit={handleSubmit(onSubmit)}
className={styles.form} style={{overflowY: "scroll"}}>
className={styles.form} style={{ overflowY: "scroll" }}>
<label htmlFor="core-url">Core URL
- {connected ? "connected" : "disconnected"}</label>
<input {...register("coreURL")} type="text" />
Expand All @@ -68,9 +68,11 @@ const Configuration = ({ refreshCalendar, openDialog }: ConfigurationProps) => {
<button id={styles["auto-mode"]} type="submit" name="auto-mode">
Configure Auto Mode
</button>
<div style={{display: "flex", alignItems: "center", marginTop: "2rem"}}>
<label htmlFor="reconcile" style={{height: "100%", marginTop: 0}}>Reconcile</label>
<input {...register("reconcile")} type="checkbox" style={{marginLeft: "auto"}} />
<div style={{ display: "flex", alignItems: "center", marginTop: "2rem" }}>
<label htmlFor="reconcile"
style={{ height: "100%", marginTop: 0 }}>Reconcile</label>
<input {...register("reconcile")} type="checkbox"
style={{ marginLeft: "auto" }} />
</div>
<button name="update" type="submit">Update / Reconnect</button>
</form>
Expand Down
2 changes: 2 additions & 0 deletions apps/ove-bridge/src/app/api/features/hardware/mdc-service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global AbortController */

import {
type Device,
type TBridgeHardwareService,
Expand Down
12 changes: 8 additions & 4 deletions apps/ove-bridge/src/app/api/features/hardware/node-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const createClient = (
]
});

const reboot = async (device: Device, args: TBridgeServiceArgs<"reboot">, ac?: () => AbortController) => {
const reboot = async (device: Device, args: TBridgeServiceArgs<"reboot">,
ac?: () => AbortController) => {
const rebootOptsSchema = z.object({}).strict();
const parsedOpts = rebootOptsSchema.safeParse(args);

Expand Down Expand Up @@ -89,7 +90,8 @@ const shutdown = async (
}
};

const start = async (device: Device, args: TBridgeServiceArgs<"start">, ac?: () => AbortController) => {
const start = async (device: Device, args: TBridgeServiceArgs<"start">,
ac?: () => AbortController) => {
const startOptsSchema = z.object({}).strict();
const parsedOpts = startOptsSchema.safeParse(args);

Expand All @@ -104,7 +106,8 @@ const start = async (device: Device, args: TBridgeServiceArgs<"start">, ac?: ()
}
};

const getInfo = async (device: Device, args: TBridgeServiceArgs<"getInfo">, ac?: () => AbortController) => {
const getInfo = async (device: Device, args: TBridgeServiceArgs<"getInfo">,
ac?: () => AbortController) => {
const infoOptsSchema = z.object({ type: z.string().optional() }).strict();
const parsedOpts = infoOptsSchema.safeParse(args);

Expand Down Expand Up @@ -146,7 +149,8 @@ const getStatus = async (
}
};

const execute = async (device: Device, args: TBridgeServiceArgs<"execute">, ac?: () => AbortController) => {
const execute = async (device: Device, args: TBridgeServiceArgs<"execute">,
ac?: () => AbortController) => {
const executeOptsSchema = z.object({ command: z.string() }).strict();
const parsedOpts = executeOptsSchema.safeParse(args);

Expand Down
14 changes: 9 additions & 5 deletions apps/ove-bridge/src/app/api/features/hardware/pjlink-service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global setTimeout */
/* global AbortController, setTimeout */

import {
type Device,
Expand All @@ -13,7 +13,8 @@ import { raise } from "@ove/ove-utils";
import * as PJLink from "@ove/pjlink-control";
import { statusOptions } from "../../utils/status";

const reboot = async (device: Device, args: TBridgeServiceArgs<"reboot">, ac?: () => AbortController) => {
const reboot = async (device: Device, args: TBridgeServiceArgs<"reboot">,
ac?: () => AbortController) => {
const rebootOptsSchema = z.object({}).strict();
const parsedOpts = rebootOptsSchema.safeParse(args);

Expand Down Expand Up @@ -54,7 +55,8 @@ const shutdown = async (
return true;
};

const start = async (device: Device, args: TBridgeServiceArgs<"start">, ac?: () => AbortController) => {
const start = async (device: Device, args: TBridgeServiceArgs<"start">,
ac?: () => AbortController) => {
const startOptsSchema = z.object({}).strict();
const parsedOpts = startOptsSchema.safeParse(args);

Expand Down Expand Up @@ -232,7 +234,8 @@ const setSource = async (
return true;
};

const mute = async (device: Device, args: TBridgeServiceArgs<"mute">, ac?: () => AbortController) => {
const mute = async (device: Device, args: TBridgeServiceArgs<"mute">,
ac?: () => AbortController) => {
const muteOptsSchema = z.object({}).strict();
const parsedOpts = muteOptsSchema.safeParse(args);

Expand All @@ -249,7 +252,8 @@ const mute = async (device: Device, args: TBridgeServiceArgs<"mute">, ac?: () =>
return true;
};

const unmute = async (device: Device, args: TBridgeServiceArgs<"unmute">, ac?: () => AbortController) => {
const unmute = async (device: Device, args: TBridgeServiceArgs<"unmute">,
ac?: () => AbortController) => {
const unmuteOptsSchema = z.object({}).strict();
const parsedOpts = unmuteOptsSchema.safeParse(args);

Expand Down
Loading

0 comments on commit bf4a042

Please sign in to comment.