|
|
|
@ -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,20 +11,9 @@ 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`}
|
|
|
|
@ -34,7 +22,6 @@ export function KVMControl({ deviceId, server, token }: KVMControlProps) {
|
|
|
|
|
canvasHeight="100%"
|
|
|
|
|
canvasWidth="100%"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|