mirror of https://github.com/portainer/portainer
fix(edge): show KVM connect button, remove automatic useEffect [EE-2520] (#6540)
parent
3165d354b5
commit
d48ff2921b
|
@ -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,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%"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue