mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 14:17:18 +00:00
feat(terminal): lazy-load targets and polish theme UI
Defer container loading with wire:init and a containersLoaded gate, add autoStart/starting session state, extract a shared theme selector, and restyle terminal headers, pickers, and fullscreen chrome. Cover the new packaging and header behavior in feature tests.
This commit is contained in:
1 parent
7c6d00c8de
commit
8ae9c03209
10 files changed
+651
-165
No files matched your search
@@ -152,6 +152,7 @@ export function initializeTerminalComponent() {
|
||||
return {
|
||||
fullscreen: false,
|
||||
terminalActive: false,
|
||||
starting: false,
|
||||
message: '(connection closed)',
|
||||
term: null,
|
||||
fitAddon: null,
|
||||
@@ -203,6 +204,7 @@ export function initializeTerminalComponent() {
|
||||
: 'system',
|
||||
|
||||
init() {
|
||||
this.starting = this.$el.dataset.autoStart === 'true';
|
||||
this.themeObserver = new MutationObserver(() => {
|
||||
if (this.selectedTheme === 'system') {
|
||||
applicationTerminalThemes.system = createSystemTerminalTheme();
|
||||
@@ -676,6 +678,7 @@ export function initializeTerminalComponent() {
|
||||
}
|
||||
|
||||
if (event.data === 'pty-ready') {
|
||||
this.starting = false;
|
||||
if (!this.term._initialized) {
|
||||
this.term.open(document.getElementById('terminal'));
|
||||
this.term._initialized = true;
|
||||
@@ -715,6 +718,7 @@ export function initializeTerminalComponent() {
|
||||
// Notify parent component that terminal is connected
|
||||
this.$wire.dispatch('terminalConnected');
|
||||
} else if (event.data === 'unprocessable') {
|
||||
this.starting = false;
|
||||
if (this.term) this.term.reset();
|
||||
this.terminalActive = false;
|
||||
this.lastSentCommand = null;
|
||||
@@ -724,6 +728,7 @@ export function initializeTerminalComponent() {
|
||||
// Notify parent component that terminal connection failed
|
||||
this.$wire.dispatch('terminalDisconnected');
|
||||
} else if (event.data === 'pty-exited') {
|
||||
this.starting = false;
|
||||
this.exitFullscreen();
|
||||
this.mobileToolbarCollapsed = false;
|
||||
this.terminalActive = false;
|
||||
|
||||
Reference in new issue
Block a user