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 {
|
.canvas-container {
|
||||||
display: contents;
|
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 { KVM } from '@open-amt-cloud-toolkit/ui-toolkit-react/reactjs/src/kvm.bundle';
|
||||||
|
|
||||||
import { react2angular } from '@/react-tools/react2angular';
|
import { react2angular } from '@/react-tools/react2angular';
|
||||||
|
@ -12,29 +11,17 @@ export interface KVMControlProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function KVMControl({ deviceId, server, token }: 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>;
|
if (!deviceId || !server || !token) return <div>Loading...</div>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={divRef}>
|
<KVM
|
||||||
<KVM
|
deviceId={deviceId}
|
||||||
deviceId={deviceId}
|
mpsServer={`https://${server}/mps/ws/relay`}
|
||||||
mpsServer={`https://${server}/mps/ws/relay`}
|
authToken={token}
|
||||||
authToken={token}
|
mouseDebounceTime="200"
|
||||||
mouseDebounceTime="200"
|
canvasHeight="100%"
|
||||||
canvasHeight="100%"
|
canvasWidth="100%"
|
||||||
canvasWidth="100%"
|
/>
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue