mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(terminal): display os specific copy/paste tooltip EE-1976 (#10835)
This commit is contained in:
parent
fc7d9ca2cd
commit
fe47318e26
7 changed files with 81 additions and 18 deletions
|
@ -5,6 +5,7 @@ import { Terminal } from 'xterm';
|
|||
|
||||
import { baseHref } from '@/portainer/helpers/pathHelper';
|
||||
import { notifyError } from '@/portainer/services/notifications';
|
||||
import { TerminalTooltip } from '@/react/components/TerminalTooltip';
|
||||
|
||||
import { PageHeader } from '@@/PageHeader';
|
||||
import { Widget, WidgetBody } from '@@/Widget';
|
||||
|
@ -74,6 +75,9 @@ export function ConsoleView() {
|
|||
terminal?.setOption('cursorBlink', true);
|
||||
terminal?.focus();
|
||||
setConnectionStatus('open');
|
||||
socket.send('export LANG=C.UTF-8\n');
|
||||
socket.send('export LC_ALL=C.UTF-8\n');
|
||||
socket.send('clear\n');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -93,7 +97,7 @@ export function ConsoleView() {
|
|||
}, [disconnectConsole, setConnectionStatus, socket, terminal]);
|
||||
|
||||
useEffect(() => {
|
||||
terminal?.on('data', (data) => {
|
||||
terminal?.onData((data) => {
|
||||
socket?.send(data);
|
||||
});
|
||||
}, [terminal, socket]);
|
||||
|
@ -118,6 +122,7 @@ export function ConsoleView() {
|
|||
className="col-sm-3 col-lg-2 control-label m-0 p-0 text-left"
|
||||
>
|
||||
Command
|
||||
<TerminalTooltip />
|
||||
</label>
|
||||
<div className="col-sm-8 input-group p-0">
|
||||
<span className="input-group-addon">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue