Fix console rendering on Safari; closes #4189
This commit is contained in:
parent
003afb271b
commit
3120e1d4a0
6 changed files with 33 additions and 42 deletions
|
@ -46,12 +46,11 @@
|
||||||
"tailwindcss": "^3.0.24",
|
"tailwindcss": "^3.0.24",
|
||||||
"use-fit-text": "^2.4.0",
|
"use-fit-text": "^2.4.0",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"xterm": "^4.15.0",
|
"xterm": "^4.19.0",
|
||||||
"xterm-addon-attach": "^0.6.0",
|
"xterm-addon-fit": "^0.5.0",
|
||||||
"xterm-addon-fit": "^0.4.0",
|
"xterm-addon-search": "^0.9.0",
|
||||||
"xterm-addon-search": "^0.7.0",
|
|
||||||
"xterm-addon-search-bar": "^0.2.0",
|
"xterm-addon-search-bar": "^0.2.0",
|
||||||
"xterm-addon-web-links": "^0.4.0",
|
"xterm-addon-web-links": "^0.6.0",
|
||||||
"yup": "^0.29.1"
|
"yup": "^0.29.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -60,12 +60,6 @@ export default createGlobalStyle`
|
||||||
-webkit-border-radius: 4px 9px;
|
-webkit-border-radius: 4px 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
-webkit-box-shadow:
|
|
||||||
inset 0 0 0 1px hsl(212, 92%, 43%),
|
|
||||||
inset 0 0 0 4px hsl(212, 92%, 43%);
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-corner {
|
::-webkit-scrollbar-corner {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,15 +9,16 @@ import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
||||||
import { ServerContext } from '@/state/server';
|
import { ServerContext } from '@/state/server';
|
||||||
import { usePermissions } from '@/plugins/usePermissions';
|
import { usePermissions } from '@/plugins/usePermissions';
|
||||||
import { theme as th } from 'twin.macro';
|
import { theme as th } from 'twin.macro';
|
||||||
import 'xterm/css/xterm.css';
|
|
||||||
import useEventListener from '@/plugins/useEventListener';
|
import useEventListener from '@/plugins/useEventListener';
|
||||||
import { debounce } from 'debounce';
|
import { debounce } from 'debounce';
|
||||||
import { usePersistedState } from '@/plugins/usePersistedState';
|
import { usePersistedState } from '@/plugins/usePersistedState';
|
||||||
import { SocketEvent, SocketRequest } from '@/components/server/events';
|
import { SocketEvent, SocketRequest } from '@/components/server/events';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import styles from './style.module.css';
|
|
||||||
import { ChevronDoubleRightIcon } from '@heroicons/react/solid';
|
import { ChevronDoubleRightIcon } from '@heroicons/react/solid';
|
||||||
|
|
||||||
|
import 'xterm/css/xterm.css';
|
||||||
|
import styles from './style.module.css';
|
||||||
|
|
||||||
const theme = {
|
const theme = {
|
||||||
background: th`colors.black`.toString(),
|
background: th`colors.black`.toString(),
|
||||||
cursor: 'transparent',
|
cursor: 'transparent',
|
||||||
|
@ -45,7 +46,7 @@ const terminalProps: ITerminalOptions = {
|
||||||
cursorStyle: 'underline',
|
cursorStyle: 'underline',
|
||||||
allowTransparency: true,
|
allowTransparency: true,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontFamily: 'Menlo, Monaco, Consolas, monospace',
|
fontFamily: th('fontFamily.mono'),
|
||||||
rows: 30,
|
rows: 30,
|
||||||
theme: theme,
|
theme: theme,
|
||||||
};
|
};
|
||||||
|
@ -197,8 +198,10 @@ export default () => {
|
||||||
<div
|
<div
|
||||||
className={classNames(styles.container, styles.overflows_container, { 'rounded-b': !canSendCommands })}
|
className={classNames(styles.container, styles.overflows_container, { 'rounded-b': !canSendCommands })}
|
||||||
>
|
>
|
||||||
|
<div className={'h-full'}>
|
||||||
<div id={styles.terminal} ref={ref} />
|
<div id={styles.terminal} ref={ref} />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{canSendCommands && (
|
{canSendCommands && (
|
||||||
<div className={classNames('relative', styles.overflows_container)}>
|
<div className={classNames('relative', styles.overflows_container)}>
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -21,15 +21,15 @@ const ServerConsoleContainer = () => {
|
||||||
const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual);
|
const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ServerContentBlock title={'Console'} className={'flex flex-col gap-2 sm:gap-4'}>
|
<ServerContentBlock title={'Console'}>
|
||||||
{(isInstalling || isTransferring) && (
|
{(isInstalling || isTransferring) && (
|
||||||
<Alert type={'warning'}>
|
<Alert type={'warning'} className={'mb-4'}>
|
||||||
{isInstalling
|
{isInstalling
|
||||||
? 'This server is currently running its installation process and most actions are unavailable.'
|
? 'This server is currently running its installation process and most actions are unavailable.'
|
||||||
: 'This server is currently being transferred to another node and all actions are unavailable.'}
|
: 'This server is currently being transferred to another node and all actions are unavailable.'}
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
<div className={'grid grid-cols-4 gap-4'}>
|
<div className={'grid grid-cols-4 gap-4 mb-4'}>
|
||||||
<div className={'hidden sm:block sm:col-span-2 lg:col-span-3 pr-4'}>
|
<div className={'hidden sm:block sm:col-span-2 lg:col-span-3 pr-4'}>
|
||||||
<h1 className={'font-header text-2xl text-gray-50 leading-relaxed line-clamp-1'}>{name}</h1>
|
<h1 className={'font-header text-2xl text-gray-50 leading-relaxed line-clamp-1'}>{name}</h1>
|
||||||
<p className={'text-sm line-clamp-2'}>{description}</p>
|
<p className={'text-sm line-clamp-2'}>{description}</p>
|
||||||
|
@ -40,8 +40,8 @@ const ServerConsoleContainer = () => {
|
||||||
</Can>
|
</Can>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={'grid grid-cols-4 gap-2 sm:gap-4'}>
|
<div className={'grid grid-cols-4 gap-2 sm:gap-4 mb-4'}>
|
||||||
<div className={'col-span-4 lg:col-span-3'}>
|
<div className={'flex col-span-4 lg:col-span-3'}>
|
||||||
<Spinner.Suspense>
|
<Spinner.Suspense>
|
||||||
<Console />
|
<Console />
|
||||||
</Spinner.Suspense>
|
</Spinner.Suspense>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.terminal {
|
.terminal {
|
||||||
@apply relative h-full flex flex-col;
|
@apply flex flex-col w-full;
|
||||||
|
|
||||||
& .overflows_container {
|
& .overflows_container {
|
||||||
@apply -ml-4 sm:ml-0;
|
@apply -ml-4 sm:ml-0;
|
||||||
|
|
37
yarn.lock
37
yarn.lock
|
@ -9437,15 +9437,10 @@ xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.1:
|
||||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
|
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
|
||||||
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
|
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
|
||||||
|
|
||||||
xterm-addon-attach@^0.6.0:
|
xterm-addon-fit@^0.5.0:
|
||||||
version "0.6.0"
|
version "0.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-attach/-/xterm-addon-attach-0.6.0.tgz#220c23addd62ab88c9914e2d4c06f7407e44680e"
|
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.5.0.tgz#2d51b983b786a97dcd6cde805e700c7f913bc596"
|
||||||
integrity sha512-Mo8r3HTjI/EZfczVCwRU6jh438B4WLXxdFO86OB7bx0jGhwh2GdF4ifx/rP+OB+Cb2vmLhhVIZ00/7x3YSP3dg==
|
integrity sha512-DsS9fqhXHacEmsPxBJZvfj2la30Iz9xk+UKjhQgnYNkrUIN5CYLbw7WEfz117c7+S86S/tpHPfvNxJsF5/G8wQ==
|
||||||
|
|
||||||
xterm-addon-fit@^0.4.0:
|
|
||||||
version "0.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.4.0.tgz#06e0c5d0a6aaacfb009ef565efa1c81e93d90193"
|
|
||||||
integrity sha512-p4BESuV/g2L6pZzFHpeNLLnep9mp/DkF3qrPglMiucSFtD8iJxtMufEoEJbN8LZwB4i+8PFpFvVuFrGOSpW05w==
|
|
||||||
|
|
||||||
xterm-addon-search-bar@^0.2.0:
|
xterm-addon-search-bar@^0.2.0:
|
||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
|
@ -9455,20 +9450,20 @@ xterm-addon-search-bar@^0.2.0:
|
||||||
babel-runtime "^6.26.0"
|
babel-runtime "^6.26.0"
|
||||||
rxjs-compat "^6.5.4"
|
rxjs-compat "^6.5.4"
|
||||||
|
|
||||||
xterm-addon-search@^0.7.0:
|
xterm-addon-search@^0.9.0:
|
||||||
version "0.7.0"
|
version "0.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.7.0.tgz#c929d3e5cbb335e82bff72f158ea82936d9cd4ef"
|
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0.tgz#95278ebb818cfcf882209ae75be96e0bea5d52a5"
|
||||||
integrity sha512-6060evmJJ+tZcjnx33FXaeEHLpuXEa7l9UzUsYfMlCKbu88AbE+5LJocTKCHYd71cwCwb9pjmv/G1o9Rf9Zbcg==
|
integrity sha512-aoolI8YuHvdGw+Qjg8g2M4kst0v86GtB7WeBm4F0jNXA005/6QbWWy9eCsvnIDLJOFI5JSSrZnD6CaOkvBQYPA==
|
||||||
|
|
||||||
xterm-addon-web-links@^0.4.0:
|
xterm-addon-web-links@^0.6.0:
|
||||||
version "0.4.0"
|
version "0.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.4.0.tgz#265cbf8221b9b315d0a748e1323bee331cd5da03"
|
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.6.0.tgz#0296cb6c99588847894670d998c9ea6a6aeb26ee"
|
||||||
integrity sha512-xv8GeiINmx0zENO9hf5k+5bnkaE8mRzF+OBAr9WeFq2eLaQSudioQSiT34M1ofKbzcdjSsKiZm19Rw3i4eXamg==
|
integrity sha512-H6XzjWWZu8FBo+fnYpxdPk9w5M6drbsvwPEJZGRS38MihiQaVFpKlCMKdfRgDbKGE530tw1yH54rhpZfHgt2/A==
|
||||||
|
|
||||||
xterm@^4.15.0:
|
xterm@^4.19.0:
|
||||||
version "4.15.0"
|
version "4.19.0"
|
||||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.15.0.tgz#e52038507eba7e0d36d47f81e29fe548c82b9561"
|
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.19.0.tgz#c0f9d09cd61de1d658f43ca75f992197add9ef6d"
|
||||||
integrity sha512-Ik1GoSq1yqKZQ2LF37RPS01kX9t4TP8gpamUYblD09yvWX5mEYuMK4CcqH6+plgiNEZduhTz/UrcaWs97gOlOw==
|
integrity sha512-c3Cp4eOVsYY5Q839dR5IejghRPpxciGmLWWaP9g+ppfMeBChMeLa1DCA+pmX/jyDZ+zxFOmlJL/82qVdayVoGQ==
|
||||||
|
|
||||||
y18n@^4.0.0:
|
y18n@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
|
|
Loading…
Reference in a new issue