shell-mirror 1.5.108 → 1.5.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/app/terminal.html +18 -10
- package/public/app/terminal.js +7 -8
package/package.json
CHANGED
package/public/app/terminal.html
CHANGED
|
@@ -176,12 +176,8 @@
|
|
|
176
176
|
font-weight: 600;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
.session-tab-
|
|
180
|
-
|
|
181
|
-
border: none;
|
|
182
|
-
color: inherit;
|
|
183
|
-
font: inherit;
|
|
184
|
-
cursor: pointer;
|
|
179
|
+
.session-tab-name {
|
|
180
|
+
flex: 1;
|
|
185
181
|
padding: 2px 4px;
|
|
186
182
|
}
|
|
187
183
|
|
|
@@ -514,10 +510,10 @@
|
|
|
514
510
|
|
|
515
511
|
<!-- Content -->
|
|
516
512
|
<div style="padding: 24px;">
|
|
517
|
-
<div style="display: flex; align-items: center; gap: 16px; margin-bottom: 20px;">
|
|
513
|
+
<div id="close-session-info" style="display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-left: 16px; border-left: 4px solid #888;">
|
|
518
514
|
<div style="font-size: 2.5rem;">🗑️</div>
|
|
519
515
|
<div>
|
|
520
|
-
<div id="close-session-name" style="font-size: 1.1rem;
|
|
516
|
+
<div id="close-session-name" style="font-size: 1.1rem; font-weight: 500; margin-bottom: 4px;">Session 1</div>
|
|
521
517
|
<div id="close-session-duration" style="font-size: 0.85rem; color: #888;">Duration: 5 minutes</div>
|
|
522
518
|
</div>
|
|
523
519
|
</div>
|
|
@@ -539,7 +535,7 @@
|
|
|
539
535
|
// Close Session Modal Functions
|
|
540
536
|
let pendingCloseSessionId = null;
|
|
541
537
|
|
|
542
|
-
function showCloseSessionModal(sessionId, sessionName, createdAt) {
|
|
538
|
+
function showCloseSessionModal(sessionId, sessionName, createdAt, sessionColor) {
|
|
543
539
|
pendingCloseSessionId = sessionId;
|
|
544
540
|
|
|
545
541
|
// Calculate duration
|
|
@@ -547,6 +543,18 @@
|
|
|
547
543
|
|
|
548
544
|
document.getElementById('close-session-name').textContent = sessionName || 'Session';
|
|
549
545
|
document.getElementById('close-session-duration').textContent = `Duration: ${duration}`;
|
|
546
|
+
|
|
547
|
+
// Apply session color to border and name
|
|
548
|
+
const infoDiv = document.getElementById('close-session-info');
|
|
549
|
+
const nameDiv = document.getElementById('close-session-name');
|
|
550
|
+
if (sessionColor) {
|
|
551
|
+
infoDiv.style.borderLeftColor = sessionColor.border;
|
|
552
|
+
nameDiv.style.color = sessionColor.border;
|
|
553
|
+
} else {
|
|
554
|
+
infoDiv.style.borderLeftColor = '#888';
|
|
555
|
+
nameDiv.style.color = '#fff';
|
|
556
|
+
}
|
|
557
|
+
|
|
550
558
|
document.getElementById('close-session-modal').style.display = 'flex';
|
|
551
559
|
}
|
|
552
560
|
|
|
@@ -576,6 +584,6 @@
|
|
|
576
584
|
}
|
|
577
585
|
</script>
|
|
578
586
|
|
|
579
|
-
<script src="/app/terminal.js?v=1.5.
|
|
587
|
+
<script src="/app/terminal.js?v=1.5.94"></script>
|
|
580
588
|
</body>
|
|
581
589
|
</html>
|
package/public/app/terminal.js
CHANGED
|
@@ -1030,13 +1030,9 @@ function renderTabs() {
|
|
|
1030
1030
|
: `color: ${color.muted};`;
|
|
1031
1031
|
|
|
1032
1032
|
return `
|
|
1033
|
-
<div class="session-tab ${isActive ? 'active' : ''}" style="${tabStyle}" title="${displayName}" data-color-index="${sessionColorMap[session.id]}">
|
|
1034
|
-
<
|
|
1035
|
-
|
|
1036
|
-
style="${textStyle}">
|
|
1037
|
-
<span class="session-tab-name">${displayName}</span>
|
|
1038
|
-
</button>
|
|
1039
|
-
<button class="session-tab-close" onclick="closeSession('${session.id}', event)" title="Close session" style="color: ${isActive ? color.text : color.muted}">×</button>
|
|
1033
|
+
<div class="session-tab ${isActive ? 'active' : ''}" style="${tabStyle}; cursor: pointer;" title="${displayName}" data-color-index="${sessionColorMap[session.id]}" onclick="switchToSession('${session.id}')">
|
|
1034
|
+
<span class="session-tab-name" style="${textStyle}">${displayName}</span>
|
|
1035
|
+
<button class="session-tab-close" onclick="event.stopPropagation(); closeSession('${session.id}', event)" title="Close session" style="color: ${isActive ? color.text : color.muted}">×</button>
|
|
1040
1036
|
</div>
|
|
1041
1037
|
`;
|
|
1042
1038
|
}).join('');
|
|
@@ -1065,9 +1061,12 @@ function closeSession(sessionId, event) {
|
|
|
1065
1061
|
const sessionName = session?.name || 'this session';
|
|
1066
1062
|
const createdAt = session?.createdAt || null;
|
|
1067
1063
|
|
|
1064
|
+
// Get session color for modal
|
|
1065
|
+
const sessionColor = getSessionColor(sessionId);
|
|
1066
|
+
|
|
1068
1067
|
// Show custom modal instead of browser confirm()
|
|
1069
1068
|
if (typeof showCloseSessionModal === 'function') {
|
|
1070
|
-
showCloseSessionModal(sessionId, sessionName, createdAt);
|
|
1069
|
+
showCloseSessionModal(sessionId, sessionName, createdAt, sessionColor);
|
|
1071
1070
|
} else {
|
|
1072
1071
|
// Fallback to native confirm if modal not available
|
|
1073
1072
|
if (confirm(`Close "${sessionName}"?\n\nThis will terminate the terminal session.`)) {
|