@dotrino/vaultd 0.17.0 → 0.18.0
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/src/tui/app.js +22 -9
- package/src/tui/i18n.js +25 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/vaultd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Certificador personal de Dotrino: daemon headless que custodia la clave maestra y delega capacidades a tus dispositivos por el proxy. Tu CA propia.",
|
|
6
6
|
"bin": {
|
package/src/tui/app.js
CHANGED
|
@@ -729,14 +729,27 @@ async function onConfirmKey (st, key) {
|
|
|
729
729
|
const INNER_TABS = ['devices', 'secrets', 'me']
|
|
730
730
|
const tabLabel = (i, k) => ({ devices: i.tabDevices, secrets: i.tabSecrets, me: i.tabMe })[k]
|
|
731
731
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
732
|
+
/**
|
|
733
|
+
* Las teclas que se pueden usar AHORA, no el catálogo entero. Aprobar/rechazar sin nadie
|
|
734
|
+
* esperando, o revocar sin un aparato seleccionado, no hacen nada: anunciarlas confunde
|
|
735
|
+
* («¿por qué no pasa nada?») y además quema esas letras para otros usos en la pantalla.
|
|
736
|
+
*/
|
|
737
|
+
const helpSegs = (i, screen, st = {}) => {
|
|
738
|
+
const segs = {
|
|
739
|
+
profiles: i.helpProfiles,
|
|
740
|
+
devices: i.helpDevices,
|
|
741
|
+
secrets: i.helpSecrets,
|
|
742
|
+
pairing: i.helpPairing,
|
|
743
|
+
pairmode: i.helpPairMode,
|
|
744
|
+
me: i.helpMe
|
|
745
|
+
}[screen] || []
|
|
746
|
+
if (typeof segs !== 'function') return segs
|
|
747
|
+
return segs({
|
|
748
|
+
pendiente: !!st.pending,
|
|
749
|
+
hayAparatos: (st.devices?.issued || []).length > 0,
|
|
750
|
+
haySecretos: Object.keys(st.secrets || {}).length > 0
|
|
751
|
+
})
|
|
752
|
+
}
|
|
740
753
|
|
|
741
754
|
const title = (i, screen) => ({
|
|
742
755
|
profiles: i.titleProfiles,
|
|
@@ -851,7 +864,7 @@ function render (term, st) {
|
|
|
851
864
|
} else lines[statusRow] = ''
|
|
852
865
|
|
|
853
866
|
// barra de ayuda
|
|
854
|
-
let help = fitHelp(helpSegs(i, st.screen), cols)
|
|
867
|
+
let help = fitHelp(helpSegs(i, st.screen, st), cols)
|
|
855
868
|
if (st.input) help = i.helpInput
|
|
856
869
|
else if (st.confirm) help = i.helpConfirm
|
|
857
870
|
lines[rows - 1] = t.bar(help, cols)
|
package/src/tui/i18n.js
CHANGED
|
@@ -175,12 +175,24 @@ const es = {
|
|
|
175
175
|
// language/quit); lo único que se traduce es la palabra que las explica.
|
|
176
176
|
// Segmentos, no una línea: el render recorta del medio si no caben.
|
|
177
177
|
helpProfiles: ['↑↓', 'Enter entrar', 'p emparejar', 'n nueva', 'r renombrar', 'd borrar', 'c clave', 'x quitar-clave', 'u desbloq', 'k bloquear', 'l English', 'q salir'],
|
|
178
|
-
|
|
178
|
+
// La barra dice lo que se PUEDE hacer AHORA, no todo lo que existe: aprobar/rechazar solo
|
|
179
|
+
// valen si hay alguien esperando, y renombrar/revocar solo si hay un aparato seleccionado.
|
|
180
|
+
// Anunciar teclas muertas confunde y además las quema para otros usos.
|
|
181
|
+
helpDevices: ({ pendiente, hayAparatos } = {}) => [
|
|
182
|
+
'←→ pestaña', '↑↓', 'p emparejar',
|
|
183
|
+
...(pendiente ? ['a aprobar', 'x rechazar'] : []),
|
|
184
|
+
...(hayAparatos ? ['n renombrar', 'v revocar'] : []),
|
|
185
|
+
'r refrescar', 'Esc bóvedas', 'l English', 'q salir'
|
|
186
|
+
],
|
|
179
187
|
renameDeviceLabel: (id) => `¿Cómo quieres llamar a ${id}?`,
|
|
180
188
|
renameDeviceHint: 'el nombre con el que lo reconoces (Esc cancela)',
|
|
181
189
|
renaming: 'Renombrando…',
|
|
182
190
|
deviceRenamed: (n) => `Ahora se llama «${n}»`,
|
|
183
|
-
helpSecrets:
|
|
191
|
+
helpSecrets: ({ haySecretos } = {}) => [
|
|
192
|
+
'←→ pestaña', '↑↓', 'n nueva variable',
|
|
193
|
+
...(haySecretos ? ['x quitar (variable/scope)'] : []),
|
|
194
|
+
'r refrescar', 'Esc bóvedas', 'l English', 'q salir'
|
|
195
|
+
],
|
|
184
196
|
helpPairing: ['a aprobar', 'x rechazar', 'r reiniciar', '↑↓ scroll', 'Esc atrás', 'l English'],
|
|
185
197
|
helpPairMode: ['↑↓', 'Enter elegir', 'Esc atrás', 'l English', 'q salir'],
|
|
186
198
|
|
|
@@ -355,12 +367,21 @@ const en = {
|
|
|
355
367
|
helpConfirm: 'y confirm · n/Esc cancel',
|
|
356
368
|
|
|
357
369
|
helpProfiles: ['↑↓', 'Enter open', 'p pair', 'n new', 'r rename', 'd delete', 'c password', 'x drop-password', 'u unlock', 'k lock', 'l Español', 'q quit'],
|
|
358
|
-
helpDevices:
|
|
370
|
+
helpDevices: ({ pendiente, hayAparatos } = {}) => [
|
|
371
|
+
'←→ tab', '↑↓', 'p pair',
|
|
372
|
+
...(pendiente ? ['a approve', 'x reject'] : []),
|
|
373
|
+
...(hayAparatos ? ['n rename', 'v revoke'] : []),
|
|
374
|
+
'r refresh', 'Esc vaults', 'l Español', 'q quit'
|
|
375
|
+
],
|
|
359
376
|
renameDeviceLabel: (id) => `What do you want to call ${id}?`,
|
|
360
377
|
renameDeviceHint: 'the name you recognise it by (Esc cancels)',
|
|
361
378
|
renaming: 'Renaming…',
|
|
362
379
|
deviceRenamed: (n) => `Now called "${n}"`,
|
|
363
|
-
helpSecrets:
|
|
380
|
+
helpSecrets: ({ haySecretos } = {}) => [
|
|
381
|
+
'←→ tab', '↑↓', 'n new variable',
|
|
382
|
+
...(haySecretos ? ['x remove (variable/scope)'] : []),
|
|
383
|
+
'r refresh', 'Esc vaults', 'l Español', 'q quit'
|
|
384
|
+
],
|
|
364
385
|
helpPairing: ['a approve', 'x reject', 'r restart', '↑↓ scroll', 'Esc back', 'l Español'],
|
|
365
386
|
helpPairMode: ['↑↓', 'Enter choose', 'Esc back', 'l Español', 'q quit'],
|
|
366
387
|
|