mirror of https://github.com/jetkvm/kvm.git
chore(ui): Clean up warnings (#536)
This commit is contained in:
parent
718b343713
commit
8d77d75294
|
@ -61,9 +61,9 @@ function Terminal({
|
||||||
dataChannel,
|
dataChannel,
|
||||||
type,
|
type,
|
||||||
}: {
|
}: {
|
||||||
title: string;
|
readonly title: string;
|
||||||
dataChannel: RTCDataChannel;
|
readonly dataChannel: RTCDataChannel;
|
||||||
type: AvailableTerminalTypes;
|
readonly type: AvailableTerminalTypes;
|
||||||
}) {
|
}) {
|
||||||
const enableTerminal = useUiStore(state => state.terminalType == type);
|
const enableTerminal = useUiStore(state => state.terminalType == type);
|
||||||
const setTerminalType = useUiStore(state => state.setTerminalType);
|
const setTerminalType = useUiStore(state => state.setTerminalType);
|
||||||
|
|
|
@ -131,7 +131,7 @@ export default function PasteModal() {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div className="w-full" onKeyUp={e => e.stopPropagation()}>
|
<div className="w-full" onKeyUp={e => e.stopPropagation()} onKeyDown={e => e.stopPropagation()}>
|
||||||
<TextAreaWithLabel
|
<TextAreaWithLabel
|
||||||
ref={TextAreaRef}
|
ref={TextAreaRef}
|
||||||
label="Paste from host"
|
label="Paste from host"
|
||||||
|
|
|
@ -269,22 +269,17 @@ export default function SettingsRoute() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SettingsItem({
|
interface SettingsItemProps {
|
||||||
title,
|
readonly title: string;
|
||||||
description,
|
readonly description: string | React.ReactNode;
|
||||||
children,
|
readonly badge?: string;
|
||||||
className,
|
readonly className?: string;
|
||||||
loading,
|
readonly loading?: boolean;
|
||||||
badge,
|
readonly children?: React.ReactNode;
|
||||||
}: {
|
}
|
||||||
title: string;
|
export function SettingsItem(props: SettingsItemProps) {
|
||||||
description: string | React.ReactNode;
|
const { title, description, badge, children, className, loading } = props;
|
||||||
children?: React.ReactNode;
|
|
||||||
className?: string;
|
|
||||||
name?: string;
|
|
||||||
loading?: boolean;
|
|
||||||
badge?: string;
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<label
|
<label
|
||||||
className={cx(
|
className={cx(
|
||||||
|
|
|
@ -715,12 +715,10 @@ export default function KvmIdRoute() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!peerConnection) return;
|
if (!peerConnection) return;
|
||||||
if (!kvmTerminal) {
|
if (!kvmTerminal) {
|
||||||
// console.log('Creating data channel "terminal"');
|
|
||||||
setKvmTerminal(peerConnection.createDataChannel("terminal"));
|
setKvmTerminal(peerConnection.createDataChannel("terminal"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!serialConsole) {
|
if (!serialConsole) {
|
||||||
// console.log('Creating data channel "serial"');
|
|
||||||
setSerialConsole(peerConnection.createDataChannel("serial"));
|
setSerialConsole(peerConnection.createDataChannel("serial"));
|
||||||
}
|
}
|
||||||
}, [kvmTerminal, peerConnection, serialConsole]);
|
}, [kvmTerminal, peerConnection, serialConsole]);
|
||||||
|
@ -755,10 +753,10 @@ export default function KvmIdRoute() {
|
||||||
|
|
||||||
const ConnectionStatusElement = useMemo(() => {
|
const ConnectionStatusElement = useMemo(() => {
|
||||||
const hasConnectionFailed =
|
const hasConnectionFailed =
|
||||||
connectionFailed || ["failed", "closed"].includes(peerConnectionState || "");
|
connectionFailed || ["failed", "closed"].includes(peerConnectionState ?? "");
|
||||||
|
|
||||||
const isPeerConnectionLoading =
|
const isPeerConnectionLoading =
|
||||||
["connecting", "new"].includes(peerConnectionState || "") ||
|
["connecting", "new"].includes(peerConnectionState ?? "") ||
|
||||||
peerConnection === null;
|
peerConnection === null;
|
||||||
|
|
||||||
const isDisconnected = peerConnectionState === "disconnected";
|
const isDisconnected = peerConnectionState === "disconnected";
|
||||||
|
@ -826,7 +824,7 @@ export default function KvmIdRoute() {
|
||||||
isLoggedIn={authMode === "password" || !!user}
|
isLoggedIn={authMode === "password" || !!user}
|
||||||
userEmail={user?.email}
|
userEmail={user?.email}
|
||||||
picture={user?.picture}
|
picture={user?.picture}
|
||||||
kvmName={deviceName || "JetKVM Device"}
|
kvmName={deviceName ?? "JetKVM Device"}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="relative flex h-full w-full overflow-hidden">
|
<div className="relative flex h-full w-full overflow-hidden">
|
||||||
|
@ -846,6 +844,9 @@ export default function KvmIdRoute() {
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="z-50"
|
className="z-50"
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
|
onMouseUp={e => e.stopPropagation()}
|
||||||
|
onMouseDown={e => e.stopPropagation()}
|
||||||
onKeyUp={e => e.stopPropagation()}
|
onKeyUp={e => e.stopPropagation()}
|
||||||
onKeyDown={e => {
|
onKeyDown={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -869,7 +870,12 @@ export default function KvmIdRoute() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SidebarContainer({ sidebarView }: { sidebarView: string | null }) {
|
interface SidebarContainerProps {
|
||||||
|
readonly sidebarView: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarContainer(props: SidebarContainerProps) {
|
||||||
|
const { sidebarView }= props;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
"lib": ["ES2021", "DOM", "DOM.Iterable"],
|
"lib": ["ES2021", "DOM", "DOM.Iterable"],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
Loading…
Reference in New Issue