fix(edge): show KVM connect button, remove automatic useEffect [EE-2520] (#6540)

pull/6519/head^2
Marcelo Rydel 3 years ago committed by GitHub
parent 3165d354b5
commit d48ff2921b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,3 @@
.canvas-container .header {
display: none;
}
.canvas-container {
display: contents;
}

@ -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>
);
}

Loading…
Cancel
Save