|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
import { useEffect, createRef } from 'react';
|
|
|
|
|
import { KVM } from '@open-amt-cloud-toolkit/ui-toolkit-react/reactjs/src/kvm.bundle';
|
|
|
|
|
|
|
|
|
|
import { react2angular } from '@/react-tools/react2angular';
|
|
|
|
@ -12,29 +11,17 @@ export interface KVMControlProps {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function KVMControl({ deviceId, server, token }: KVMControlProps) {
|
|
|
|
|
const divRef = createRef<HTMLInputElement>();
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (divRef.current) {
|
|
|
|
|
const connectButton = divRef.current.querySelector('button');
|
|
|
|
|
if (connectButton) {
|
|
|
|
|
connectButton.click();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!deviceId || !server || !token) return <div>Loading...</div>;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div ref={divRef}>
|
|
|
|
|
<KVM
|
|
|
|
|
deviceId={deviceId}
|
|
|
|
|
mpsServer={`https://${server}/mps/ws/relay`}
|
|
|
|
|
authToken={token}
|
|
|
|
|
mouseDebounceTime="200"
|
|
|
|
|
canvasHeight="100%"
|
|
|
|
|
canvasWidth="100%"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<KVM
|
|
|
|
|
deviceId={deviceId}
|
|
|
|
|
mpsServer={`https://${server}/mps/ws/relay`}
|
|
|
|
|
authToken={token}
|
|
|
|
|
mouseDebounceTime="200"
|
|
|
|
|
canvasHeight="100%"
|
|
|
|
|
canvasWidth="100%"
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|