This commit is contained in:
Bozhidar 2024-04-28 14:02:39 +03:00
parent d5623b854f
commit 21a545829e
5 changed files with 8 additions and 5 deletions

View file

@ -31,7 +31,7 @@ class Terminal extends Page
if ($runNewTerminal) { if ($runNewTerminal) {
$exec = shell_exec('node /usr/local/phyre/web/Modules/Terminal/nodejs/terminal/server.js >> /usr/local/phyre/web/storage/logs/terminal/server-terminal.log &'); $exec = shell_exec('node /usr/local/phyre/web/Modules/Terminal/nodejs/terminal/server.js >> /usr/local/phyre/web/storage/logs/terminal/server-terminal.log &');
} }
return [ return [
'title' => 'Terminal', 'title' => 'Terminal',
'sessionId' => $sessionId, 'sessionId' => $sessionId,

View file

@ -9,7 +9,9 @@
@vite('resources/js/web-terminal.js') @vite('resources/js/web-terminal.js')
<div id="js-web-terminal"></div> <div class="bg-black/5 dark:bg-white/5 rounded p-4">
<div id="js-web-terminal"></div>
</div>
</div> </div>

View file

@ -17,7 +17,7 @@
"css": [ "css": [
"assets/web-terminal-c039bc4a.css" "assets/web-terminal-c039bc4a.css"
], ],
"file": "assets/web-terminal-6085c523.js", "file": "assets/web-terminal-940be4ad.js",
"isEntry": true, "isEntry": true,
"src": "resources/js/web-terminal.js" "src": "resources/js/web-terminal.js"
} }

View file

@ -10,7 +10,7 @@ if (terminalElement !== null) {
const terminal = new Terminal({ const terminal = new Terminal({
allowTransparency: true, allowTransparency: true,
theme: { theme: {
background: '#09090b', background: 'rgba(22,22,23,0)',
foreground: '#cccccc', foreground: '#cccccc',
selectionBackground: '#399ef440', selectionBackground: '#399ef440',
black: '#666666', black: '#666666',
@ -45,6 +45,7 @@ if (terminalElement !== null) {
fitAddon.fit(); fitAddon.fit();
const socket = new WebSocket(`ws://${window.location.host}/_shell/?sessionId=${window.terminal.sessionId}`); const socket = new WebSocket(`ws://${window.location.host}/_shell/?sessionId=${window.terminal.sessionId}`);
socket.addEventListener('open', (_) => { socket.addEventListener('open', (_) => {
terminal.onData((data) => socket.send(data)); terminal.onData((data) => socket.send(data));