feat(ui): Terminal tab — embedded blackflame ttyd to CT300 (claude in persistent tmux)
ttyd on CT300 (:7681, firewalled to Traefik) behind same-origin /terminal via Traefik + CF Access; iframe view + nav entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,7 @@ const VIEWS = {
|
|||||||
'sacred-valley': () => import('./views/sacred_valley.js'),
|
'sacred-valley': () => import('./views/sacred_valley.js'),
|
||||||
sentinel: () => import('./views/sentinel.js'),
|
sentinel: () => import('./views/sentinel.js'),
|
||||||
'little-blue': () => import('./views/little_blue.js'),
|
'little-blue': () => import('./views/little_blue.js'),
|
||||||
|
terminal: () => import('./views/terminal.js'),
|
||||||
jobs: () => import('./views/jobs.js')
|
jobs: () => import('./views/jobs.js')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export function renderSidebar(root) {
|
|||||||
navItem('Sacred Valley', '/sacred-valley'),
|
navItem('Sacred Valley', '/sacred-valley'),
|
||||||
navItem('Sentinel', '/sentinel'),
|
navItem('Sentinel', '/sentinel'),
|
||||||
navItem('Little Blue', '/little-blue'),
|
navItem('Little Blue', '/little-blue'),
|
||||||
|
navItem('Terminal', '/terminal'),
|
||||||
navItem('Search', '/search'),
|
navItem('Search', '/search'),
|
||||||
inboxItem,
|
inboxItem,
|
||||||
navItem('Jobs', '/jobs'),
|
navItem('Jobs', '/jobs'),
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const ROUTES = [
|
|||||||
{ name: 'sacred-valley', re: /^\/sacred-valley$/, keys: [] },
|
{ name: 'sacred-valley', re: /^\/sacred-valley$/, keys: [] },
|
||||||
{ name: 'sentinel', re: /^\/sentinel$/, keys: [] },
|
{ name: 'sentinel', re: /^\/sentinel$/, keys: [] },
|
||||||
{ name: 'little-blue', re: /^\/little-blue$/, keys: [] },
|
{ name: 'little-blue', re: /^\/little-blue$/, keys: [] },
|
||||||
|
{ name: 'terminal', re: /^\/terminal$/, keys: [] },
|
||||||
{ name: 'jobs', re: /^\/jobs$/, keys: [] },
|
{ name: 'jobs', re: /^\/jobs$/, keys: [] },
|
||||||
{ name: 'home', re: /^\/?$/, keys: [] }
|
{ name: 'home', re: /^\/?$/, keys: [] }
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -155,6 +155,11 @@ button.ghost:hover { color: var(--text); border-color: var(--accent-dim); }
|
|||||||
.lb-toast.err { border-color: var(--bad); color: var(--bad); }
|
.lb-toast.err { border-color: var(--bad); color: var(--bad); }
|
||||||
@media (max-width: 900px) { .lb-grid { grid-template-columns: 1fr; } }
|
@media (max-width: 900px) { .lb-grid { grid-template-columns: 1fr; } }
|
||||||
|
|
||||||
|
/* Terminal tab (embedded ttyd) */
|
||||||
|
.term-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
|
||||||
|
.term-title { font-family: var(--font-display); color: var(--accent); letter-spacing: 0.08em; font-size: 14px; }
|
||||||
|
.term-frame { width: 100%; height: calc(100vh - 100px); border: 1px solid var(--border); border-radius: 6px; background: var(--bg); display: block; }
|
||||||
|
|
||||||
/* modal */
|
/* modal */
|
||||||
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
|
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
|
||||||
.modal {
|
.modal {
|
||||||
|
|||||||
21
public/views/terminal.js
Normal file
21
public/views/terminal.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
// #/terminal — embeds the CT 300 web terminal (ttyd → persistent tmux/claude),
|
||||||
|
// same-origin under /terminal so it shares the Void's CF Access session.
|
||||||
|
import { el, mount } from '../dom.js';
|
||||||
|
|
||||||
|
export async function render(main) {
|
||||||
|
mount(main,
|
||||||
|
el('div', { class: 'term-bar' },
|
||||||
|
el('span', { class: 'term-title' }, '◆ Terminal'),
|
||||||
|
el('span', { class: 'muted', style: { fontSize: '11px' } }, 'claude @ ct300 · persistent tmux'),
|
||||||
|
el('button', { class: 'ghost', style: { marginLeft: 'auto' }, onclick: () => {
|
||||||
|
const f = document.getElementById('term-frame'); if (f) f.src = f.src;
|
||||||
|
} }, '⟳ Reconnect')
|
||||||
|
),
|
||||||
|
el('iframe', {
|
||||||
|
id: 'term-frame',
|
||||||
|
src: '/terminal/',
|
||||||
|
class: 'term-frame',
|
||||||
|
allow: 'clipboard-read; clipboard-write'
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user