Fix console rendering on Safari; closes #4189

This commit is contained in:
DaneEveritt 2022-06-30 20:30:01 -04:00
parent 003afb271b
commit 3120e1d4a0
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 33 additions and 42 deletions

View file

@ -46,12 +46,11 @@
"tailwindcss": "^3.0.24",
"use-fit-text": "^2.4.0",
"uuid": "^8.3.2",
"xterm": "^4.15.0",
"xterm-addon-attach": "^0.6.0",
"xterm-addon-fit": "^0.4.0",
"xterm-addon-search": "^0.7.0",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-addon-search": "^0.9.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"
},
"devDependencies": {

View file

@ -60,12 +60,6 @@ export default createGlobalStyle`
-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 {
background: transparent;
}

View file

@ -9,15 +9,16 @@ import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
import { ServerContext } from '@/state/server';
import { usePermissions } from '@/plugins/usePermissions';
import { theme as th } from 'twin.macro';
import 'xterm/css/xterm.css';
import useEventListener from '@/plugins/useEventListener';
import { debounce } from 'debounce';
import { usePersistedState } from '@/plugins/usePersistedState';
import { SocketEvent, SocketRequest } from '@/components/server/events';
import classNames from 'classnames';
import styles from './style.module.css';
import { ChevronDoubleRightIcon } from '@heroicons/react/solid';
import 'xterm/css/xterm.css';
import styles from './style.module.css';
const theme = {
background: th`colors.black`.toString(),
cursor: 'transparent',
@ -45,7 +46,7 @@ const terminalProps: ITerminalOptions = {
cursorStyle: 'underline',
allowTransparency: true,
fontSize: 12,
fontFamily: 'Menlo, Monaco, Consolas, monospace',
fontFamily: th('fontFamily.mono'),
rows: 30,
theme: theme,
};
@ -197,7 +198,9 @@ export default () => {
<div
className={classNames(styles.container, styles.overflows_container, { 'rounded-b': !canSendCommands })}
>
<div id={styles.terminal} ref={ref} />
<div className={'h-full'}>
<div id={styles.terminal} ref={ref} />
</div>
</div>
{canSendCommands && (
<div className={classNames('relative', styles.overflows_container)}>

View file

@ -21,15 +21,15 @@ const ServerConsoleContainer = () => {
const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual);
return (
<ServerContentBlock title={'Console'} className={'flex flex-col gap-2 sm:gap-4'}>
<ServerContentBlock title={'Console'}>
{(isInstalling || isTransferring) && (
<Alert type={'warning'}>
<Alert type={'warning'} className={'mb-4'}>
{isInstalling
? '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.'}
</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'}>
<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>
@ -40,8 +40,8 @@ const ServerConsoleContainer = () => {
</Can>
</div>
</div>
<div className={'grid grid-cols-4 gap-2 sm:gap-4'}>
<div className={'col-span-4 lg:col-span-3'}>
<div className={'grid grid-cols-4 gap-2 sm:gap-4 mb-4'}>
<div className={'flex col-span-4 lg:col-span-3'}>
<Spinner.Suspense>
<Console />
</Spinner.Suspense>

View file

@ -19,7 +19,7 @@
}
.terminal {
@apply relative h-full flex flex-col;
@apply flex flex-col w-full;
& .overflows_container {
@apply -ml-4 sm:ml-0;

View file

@ -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"
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
xterm-addon-attach@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-attach/-/xterm-addon-attach-0.6.0.tgz#220c23addd62ab88c9914e2d4c06f7407e44680e"
integrity sha512-Mo8r3HTjI/EZfczVCwRU6jh438B4WLXxdFO86OB7bx0jGhwh2GdF4ifx/rP+OB+Cb2vmLhhVIZ00/7x3YSP3dg==
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-fit@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.5.0.tgz#2d51b983b786a97dcd6cde805e700c7f913bc596"
integrity sha512-DsS9fqhXHacEmsPxBJZvfj2la30Iz9xk+UKjhQgnYNkrUIN5CYLbw7WEfz117c7+S86S/tpHPfvNxJsF5/G8wQ==
xterm-addon-search-bar@^0.2.0:
version "0.2.0"
@ -9455,20 +9450,20 @@ xterm-addon-search-bar@^0.2.0:
babel-runtime "^6.26.0"
rxjs-compat "^6.5.4"
xterm-addon-search@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.7.0.tgz#c929d3e5cbb335e82bff72f158ea82936d9cd4ef"
integrity sha512-6060evmJJ+tZcjnx33FXaeEHLpuXEa7l9UzUsYfMlCKbu88AbE+5LJocTKCHYd71cwCwb9pjmv/G1o9Rf9Zbcg==
xterm-addon-search@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0.tgz#95278ebb818cfcf882209ae75be96e0bea5d52a5"
integrity sha512-aoolI8YuHvdGw+Qjg8g2M4kst0v86GtB7WeBm4F0jNXA005/6QbWWy9eCsvnIDLJOFI5JSSrZnD6CaOkvBQYPA==
xterm-addon-web-links@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.4.0.tgz#265cbf8221b9b315d0a748e1323bee331cd5da03"
integrity sha512-xv8GeiINmx0zENO9hf5k+5bnkaE8mRzF+OBAr9WeFq2eLaQSudioQSiT34M1ofKbzcdjSsKiZm19Rw3i4eXamg==
xterm-addon-web-links@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.6.0.tgz#0296cb6c99588847894670d998c9ea6a6aeb26ee"
integrity sha512-H6XzjWWZu8FBo+fnYpxdPk9w5M6drbsvwPEJZGRS38MihiQaVFpKlCMKdfRgDbKGE530tw1yH54rhpZfHgt2/A==
xterm@^4.15.0:
version "4.15.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.15.0.tgz#e52038507eba7e0d36d47f81e29fe548c82b9561"
integrity sha512-Ik1GoSq1yqKZQ2LF37RPS01kX9t4TP8gpamUYblD09yvWX5mEYuMK4CcqH6+plgiNEZduhTz/UrcaWs97gOlOw==
xterm@^4.19.0:
version "4.19.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.19.0.tgz#c0f9d09cd61de1d658f43ca75f992197add9ef6d"
integrity sha512-c3Cp4eOVsYY5Q839dR5IejghRPpxciGmLWWaP9g+ppfMeBChMeLa1DCA+pmX/jyDZ+zxFOmlJL/82qVdayVoGQ==
y18n@^4.0.0:
version "4.0.0"