Version bump to 0.1.1, visual, and term update
This commit is contained in:
1 parent
459e6022bf
commit
7a7ecf08b3
6 files changed
+137
-11
No files matched your search
+10
-3
@@ -126,12 +126,13 @@ function renderAuth(mode) {
|
||||
err,
|
||||
btn,
|
||||
);
|
||||
$('#app').replaceChildren(h('div', { class: 'login' },
|
||||
h('h1', null, 'lab', h('b', null, 'deck'), ' ' + S.version),
|
||||
$('#app').replaceChildren(h('div', { class: 'authpage' }, h('div', { class: 'login' },
|
||||
h('h1', null, 'lab', h('b', null, 'deck')),
|
||||
h('p', null, setup
|
||||
? 'First start. Choose a master password. It encrypts every SSH password and key stored here, and it cannot be recovered if you lose it.'
|
||||
: 'Enter the master password to unlock the vault.'),
|
||||
form));
|
||||
form)),
|
||||
h('footer', { class: 'status' }, h('span', { class: 'grow' }), versionTag()));
|
||||
}
|
||||
|
||||
async function startApp() {
|
||||
@@ -202,6 +203,10 @@ async function loadServices() {
|
||||
async function loadHosts() { S.hosts = await api('GET', '/api/hosts'); }
|
||||
async function loadSnippets() { S.snippets = await api('GET', '/api/snippets'); }
|
||||
|
||||
function versionTag() {
|
||||
return h('span', { class: 'ver', title: 'labdeck ' + S.version }, 'v' + S.version);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------ status bar
|
||||
function updateStatus() {
|
||||
const el = $('#status');
|
||||
@@ -220,6 +225,7 @@ function updateStatus() {
|
||||
n ? h('span', { class: 'hide-s' }, n + ' ssh session' + (n > 1 ? 's' : '')) : null,
|
||||
h('span', { class: 'hide-s' }, 'vault unlocked'),
|
||||
h('span', { id: 'clock' }, new Date().toLocaleTimeString()),
|
||||
versionTag(),
|
||||
].filter(Boolean));
|
||||
const tc = $('#termcount');
|
||||
if (tc) tc.textContent = S.sessions.length ? String(S.sessions.length) : '';
|
||||
@@ -770,6 +776,7 @@ async function openSocket(s) {
|
||||
gotCtl = true;
|
||||
const line = (c, txt) => t.write(`\r\n\x1b[${c}m${txt.replace(/\r?\n/g, '\r\n')}\x1b[0m`);
|
||||
if (m.t === 'info') line('2', '# ' + m.msg);
|
||||
else if (m.t === 'prompt') t.write('\r\n\x1b[33m' + m.msg.replace(/\r?\n/g, '\r\n') + '\x1b[0m');
|
||||
else if (m.t === 'error') { s.status = 'error'; line('31', m.msg); t.write('\r\n\x1b[2m# press Enter to reconnect\x1b[0m\r\n'); }
|
||||
else if (m.t === 'closed') { s.status = 'closed'; line('2', '# ' + m.msg + ' - press Enter to reconnect'); t.write('\r\n'); }
|
||||
else if (m.t === 'ready') { s.status = 'connected'; t.write('\r\n'); fitSession(s); if (s.ws === ws && ws.readyState === 1) ws.send(JSON.stringify({ t: 'resize', cols: t.cols, rows: t.rows })); }
|
||||
|
||||
@@ -82,6 +82,8 @@ footer.status {
|
||||
border-top: 1px solid var(--line); background: var(--bg2); color: var(--dim); white-space: nowrap; overflow: hidden;
|
||||
}
|
||||
footer.status .grow { flex: 1; }
|
||||
footer.status .ver { color: var(--dim); opacity: 0.8; font-variant-numeric: tabular-nums; padding-left: 14px; border-left: 1px solid var(--line); line-height: 14px; }
|
||||
.authpage { flex: 1; overflow: auto; }
|
||||
|
||||
/* ---------- controls ---------- */
|
||||
.btn {
|
||||
|
||||
Reference in new issue
Block a user