pisha-server 0.0.12 → 0.0.13
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/company.js +7 -2
- package/dashboard/dashboard.js +5 -2
- package/machines/machines.js +2 -0
- package/messaging/index.js +1 -1
- package/messaging/messaging.js +29 -3
- package/observation/observation.js +19 -0
- package/package.json +2 -1
- package/pisha-host.mjs +36 -7
- package/pisha-host.mjs.sig +1 -1
- package/platform/http.js +3 -1
- package/platform/index.js +3 -0
- package/routes.js +15 -1
- package/ui/addmachine.js +7 -0
- package/ui/back.js +2 -0
- package/ui/content.js +14 -2
- package/ui/i18n.js +242 -4
- package/ui/icons.js +1 -0
- package/ui/inbox.js +12 -4
- package/ui/index.html +2 -0
- package/ui/nav.js +3 -2
- package/ui/palette.js +2 -1
- package/ui/router.js +4 -2
- package/ui/routes.js +4 -0
- package/ui/screen-session.css +1 -0
- package/ui/screen-webhooks.css +111 -0
- package/ui/session.js +5 -2
- package/ui/stream.js +3 -0
- package/ui/team.js +2 -0
- package/ui/timeline.js +1 -0
- package/ui/topbar.js +6 -0
- package/ui/webhooks.js +427 -0
- package/usage/usage.js +2 -1
- package/webhooks/index.js +1 -0
- package/webhooks/webhooks.js +800 -0
package/ui/i18n.js
CHANGED
|
@@ -14,6 +14,8 @@ export const COLLATOR = new Intl.Collator(LOCALE, { numeric: true })
|
|
|
14
14
|
const I18N = {
|
|
15
15
|
en: {
|
|
16
16
|
offline: ago => `Disconnected · seen ${ago} ago`,
|
|
17
|
+
notJoined: 'Not connected: Pisha refused to log in',
|
|
18
|
+
svNotJoined: 'Why it is not connected',
|
|
17
19
|
working: d => `Working · ${d}`,
|
|
18
20
|
waitingTool: what => `Waiting for permission · ${what}`,
|
|
19
21
|
waitingInput: w => `Waiting: ${w || 'your answer'}`,
|
|
@@ -424,6 +426,8 @@ const I18N = {
|
|
|
424
426
|
tlDismissed: 'You dismissed it',
|
|
425
427
|
ibxPermTitle: (name, what) => (what ? `${name} asks for permission: ${what}` : `${name} asks for permission`),
|
|
426
428
|
ibxPermHint: 'It is answered in its session: open it to see exactly what it wants to run.',
|
|
429
|
+
ibxWithCoord: c => `${c} is deciding it`,
|
|
430
|
+
ibxPermRelayedHint: c => `It went to ${c}, its coordinator: ${c} decides it, or asks you here in the inbox. You can still answer it in its session, and ${c} is told.`,
|
|
427
431
|
ibxApproveTitle: name => `${name} wants to coordinate`,
|
|
428
432
|
ibxApproveHint: 'A name nobody has used before took the coordinator role. Approve it from its session if you know it.',
|
|
429
433
|
ibxOpenSession: 'Open its session',
|
|
@@ -500,8 +504,123 @@ const I18N = {
|
|
|
500
504
|
usageNoTasks: 'Nothing spent on a board task in this period.',
|
|
501
505
|
usageEmpty: 'Nothing spent in this period',
|
|
502
506
|
usageEmptyHint: 'Each session reports the tokens it spends as it works: Claude Code, Codex CLI and Grok CLI.',
|
|
503
|
-
usageCauses: { user: 'Your orders', inbox: 'Your answers from the inbox', coordinator: 'From their coordinator', worker: 'Workers\' reports', link: 'Between linked teams', board: 'Board notices', system: 'Server notices', other: 'Other messages', self: 'On its own' },
|
|
504
|
-
usageCauseHints: { user: 'Turns started by what you typed in a session\'s terminal', inbox: 'Turns started by your answers from the inbox', coordinator: 'Workers\' turns on what their coordinator handed them', worker: 'Coordinators\' turns on their workers\' reports', link: 'Turns started by a message from a linked team', board: 'Turns started by the task board', system: 'Turns started by the server\'s notices', other: 'Turns started by another message', self: 'Before any prompt: a session starting, or after a compaction' },
|
|
507
|
+
usageCauses: { user: 'Your orders', inbox: 'Your answers from the inbox', coordinator: 'From their coordinator', worker: 'Workers\' reports', link: 'Between linked teams', board: 'Board notices', webhook: 'Webhooks', system: 'Server notices', other: 'Other messages', self: 'On its own' },
|
|
508
|
+
usageCauseHints: { user: 'Turns started by what you typed in a session\'s terminal', inbox: 'Turns started by your answers from the inbox', coordinator: 'Workers\' turns on what their coordinator handed them', worker: 'Coordinators\' turns on their workers\' reports', link: 'Turns started by a message from a linked team', board: 'Turns started by the task board', webhook: 'Turns started by what a webhook brought', system: 'Turns started by the server\'s notices', other: 'Turns started by another message', self: 'Before any prompt: a session starting, or after a compaction' },
|
|
509
|
+
whTitle: 'Webhooks',
|
|
510
|
+
whSub: 'What other services sent your teams',
|
|
511
|
+
whStatus: { queued: 'Queued', delivered: 'Delivered', processing: 'Being dealt with', unreported: 'No report', done: 'Done', ignored: 'Nothing to do', failed: 'Failed', filtered: 'Filtered out', ping: 'Ping', duplicate: 'Repeated', undelivered: 'Not delivered', no_coordinator: 'No coordinator', bad_signature: 'Bad signature', bad_json: 'Not JSON', too_large: 'Too large', disabled: 'Turned off', rate_limited: 'Too many' },
|
|
512
|
+
whNone: 'No webhooks yet. Make one so a service like GitHub or GitLab can send this team what happens there: its coordinator gets it as it came, with your instructions.',
|
|
513
|
+
whSeeLog: 'See the log',
|
|
514
|
+
whNew: 'New webhook',
|
|
515
|
+
whOn: 'On',
|
|
516
|
+
whOff: 'Turned off',
|
|
517
|
+
whOffNoCoord: 'Turned off: the team has no coordinator',
|
|
518
|
+
whPreset: { github: 'GitHub', gitlab: 'GitLab', stripe: 'Stripe', standard: 'Standard Webhooks', custom: 'Other' },
|
|
519
|
+
whNothingYet: 'Nothing received yet',
|
|
520
|
+
whOnlyEvents: n => `Only ${n} event${n === 1 ? '' : 's'}`,
|
|
521
|
+
whActions: name => `Actions for ${name}`,
|
|
522
|
+
whEdit: 'Edit',
|
|
523
|
+
whTest: 'Send a test',
|
|
524
|
+
whShowUrl: 'Show its address',
|
|
525
|
+
whNewSecret: 'New secret',
|
|
526
|
+
whTurnOff: 'Turn off',
|
|
527
|
+
whTurnOn: 'Turn on',
|
|
528
|
+
whTestSent: (id, status) => `Test sent (#${id}): ${status}. Its coordinator will see it as a webhook.`,
|
|
529
|
+
whNewSecretTitle: name => `New secret for ${name}?`,
|
|
530
|
+
whNewSecretText: 'The current one stops working at once: whatever sends to this webhook is refused until you give it the new one.',
|
|
531
|
+
whDeleteTitle: name => `Delete ${name}?`,
|
|
532
|
+
whDeleteText: 'Its address stops working, and its log is deleted with it.',
|
|
533
|
+
whEditTitle: name => `Edit ${name}`,
|
|
534
|
+
whNewTitle: team => `New webhook for ${team}`,
|
|
535
|
+
whName: 'Name',
|
|
536
|
+
whNamePh: 'GitHub — website repository',
|
|
537
|
+
whService: 'Service',
|
|
538
|
+
whVerify: 'How it signs',
|
|
539
|
+
whVerifyName: { 'hmac-sha256': 'HMAC-SHA256 of the body (like GitHub)', token: 'A token in a header (like GitLab)', stripe: 'Timestamped, like Stripe (t=…,v1=…)', standard: 'Standard Webhooks (Svix, Resend, Clerk…)' },
|
|
540
|
+
whSigHeader: 'Signature header',
|
|
541
|
+
whEventHeader: 'Event header',
|
|
542
|
+
whDeliveryHeader: 'Delivery id header',
|
|
543
|
+
whEvents: 'Events it takes',
|
|
544
|
+
whEventsHint: 'Separated by commas. An event alone (push) or with its action (pull_request.opened). Empty: all of them.',
|
|
545
|
+
whPrompt: 'What the coordinator should do with it',
|
|
546
|
+
whPromptPh: 'Review each new pull request and tell me if something is wrong',
|
|
547
|
+
whPromptHint: 'Optional. It goes with every delivery, before the JSON.',
|
|
548
|
+
whOwnSecret: 'Secret',
|
|
549
|
+
whOwnSecretPh: 'Empty: one is made for you',
|
|
550
|
+
whCreate: 'Create',
|
|
551
|
+
whMadeTitle: name => `${name} is ready`,
|
|
552
|
+
whRenewedTitle: name => `New secret for ${name}`,
|
|
553
|
+
whUrlTitle: name => `Address of ${name}`,
|
|
554
|
+
whUrl: 'Address (Payload URL)',
|
|
555
|
+
whSecret: 'Secret',
|
|
556
|
+
whToken: 'Secret token',
|
|
557
|
+
whSecretOnce: 'Copy it now: it will not be shown again. You can always make a new one.',
|
|
558
|
+
whSecretHidden: 'The secret is not shown again. If you lost it, make a new one from the webhook\'s menu.',
|
|
559
|
+
whSteps: {
|
|
560
|
+
github: ['In GitHub, open the repository or organisation: Settings › Webhooks › Add webhook.', 'Paste the address in Payload URL, and choose application/json as Content type.', 'Paste the secret in Secret, pick the events and save: GitHub sends a ping, which shows up in the log.'],
|
|
561
|
+
gitlab: ['In GitLab, open the project: Settings › Webhooks › Add new webhook.', 'Paste the address in URL and the secret in Secret token.', 'Pick the triggers and save. Test sends one so you can see it in the log.'],
|
|
562
|
+
stripe: ['In Stripe, open Developers › Webhooks › Add destination, and choose the events.', 'Paste the address as the endpoint URL and save.', 'Stripe shows its Signing secret (whsec_…): it is the one you pasted here. If you made it before, check it is the same.'],
|
|
563
|
+
standard: ['In the service (Resend, Clerk, any built on Svix…), add an endpoint with this address and choose the events.', 'The service shows its signing secret (whsec_…): it is the one you pasted here.', 'Send a test from there: it shows up in the log.'],
|
|
564
|
+
custom: ['Give the service the address and the secret.', 'It must send JSON by POST, signed as you chose, in the headers you named.'],
|
|
565
|
+
},
|
|
566
|
+
whPublicNote: 'The service must be able to reach this server from the internet: with your own domain (HTTPS), or through a tunnel if Pisha runs on your computer.',
|
|
567
|
+
whLogOf: team => `Webhooks of ${team}`,
|
|
568
|
+
whAllWebhooks: 'All webhooks',
|
|
569
|
+
whAllStatuses: 'Any state',
|
|
570
|
+
whBackToTeam: 'Back to the team',
|
|
571
|
+
whLogEmpty: 'Nothing has come in',
|
|
572
|
+
whLogEmptyHint: 'Everything that reaches a webhook is written down here, also what was refused.',
|
|
573
|
+
whLogNoHooks: 'There are no webhooks here: make one on a team\'s page.',
|
|
574
|
+
whWhen: 'Received',
|
|
575
|
+
whWebhook: 'Webhook',
|
|
576
|
+
whEvent: 'Event',
|
|
577
|
+
whState: 'State',
|
|
578
|
+
whResult: 'Result',
|
|
579
|
+
whMore: 'Show older ones',
|
|
580
|
+
whShown: n => `${n} shown`,
|
|
581
|
+
whDeliveredTo: c => `Given to ${c}`,
|
|
582
|
+
whDeliveryTitle: id => `Delivery #${id}`,
|
|
583
|
+
whDeliveryKey: 'Delivery id',
|
|
584
|
+
whFrom: 'From',
|
|
585
|
+
whSize: 'Size',
|
|
586
|
+
whBytes: n => (n >= 1024 ? `${(n / 1024).toFixed(1)} KB` : `${n} bytes`),
|
|
587
|
+
whReason: 'Why',
|
|
588
|
+
whTo: 'Given to',
|
|
589
|
+
whMessage: id => `message #${id}`,
|
|
590
|
+
whHeaders: n => `Headers (${n})`,
|
|
591
|
+
whBody: 'What it sent',
|
|
592
|
+
whNoBody: 'Nothing of it was kept: what is refused is written down without what it brought.',
|
|
593
|
+
whRedeliver: 'Give it to the coordinator again',
|
|
594
|
+
whRedelivered: id => `Given again as delivery #${id}.`,
|
|
595
|
+
whWhy: { processing: 'Its coordinator is on it', unreported: 'Its coordinator\'s turn ended without saying what came of it', filtered: 'Not one of the events this webhook takes', duplicate: 'Already received: not given again', bad_signature: 'The signature does not match this webhook\'s secret', bad_json: 'What came is not JSON', too_large: 'Bigger than a webhook may send', disabled: 'The webhook is turned off', rate_limited: 'Too many in a minute', no_coordinator: 'The team has no coordinator', ping: 'The service checking the address' },
|
|
596
|
+
whWhyAgain: id => `Given again, from #${id}`,
|
|
597
|
+
whWhyTest: 'A test sent from the dashboard',
|
|
598
|
+
whServiceSecret: 'Signing secret, from the service',
|
|
599
|
+
whServiceSecretHint: 'This service makes the secret itself: copy it from where you add the webhook there.',
|
|
600
|
+
whSecretFromService: 'The secret is the one the service gave you, which you pasted: it is not shown here.',
|
|
601
|
+
whPasteSecretText: 'Paste the new signing secret the service shows. The current one stops working at once.',
|
|
602
|
+
whByEvent: 'Instructions by event',
|
|
603
|
+
whByEventHint: 'For one event (pull_request) or one event and action (pull_request.opened): the most specific one is used, and the ones above for the rest.',
|
|
604
|
+
whByEventAdd: '+ Instructions for an event',
|
|
605
|
+
whRemove: 'Remove',
|
|
606
|
+
whBatch: 'Gather bursts (seconds)',
|
|
607
|
+
whBatchHint: 'What arrives within these seconds goes to the coordinator in one notice. 0: each one on its own.',
|
|
608
|
+
whBatchTag: n => `Gathers ${n} s`,
|
|
609
|
+
whTogether: list => `Given in one notice with ${list}: what its coordinator did is theirs too.`,
|
|
610
|
+
whNoWorkerReport: 'No report from the worker yet',
|
|
611
|
+
whWaitingFor: names => `Waiting for ${names}'s report`,
|
|
612
|
+
whWorkerTokens: (n, calls) => `Its workers: ${n} tokens in ${calls} call${calls === 1 ? '' : 's'}`,
|
|
613
|
+
whWhatItDid: 'What its coordinator did',
|
|
614
|
+
whNoReport: 'It has not said what came of it (webhook_result).',
|
|
615
|
+
whNotYet: 'Its coordinator has not started on it yet.',
|
|
616
|
+
whNoTrace: 'Nothing of its turn was seen: its observation may be off.',
|
|
617
|
+
whTook: s => (s < 90 ? `Its turn: ${s} s` : `Its turn: ${Math.round(s / 60)} min`),
|
|
618
|
+
whStillOn: 'Still on it',
|
|
619
|
+
whTools: n => `${n} tool call${n === 1 ? '' : 's'}`,
|
|
620
|
+
whSent: n => `${n} message${n === 1 ? '' : 's'} sent`,
|
|
621
|
+
whSentTo: to => `To ${to}:`,
|
|
622
|
+
whLastWords: 'What it said at the end',
|
|
623
|
+
whTokens: (n, calls) => `${n} tokens in ${calls} call${calls === 1 ? '' : 's'}`,
|
|
505
624
|
boardsCount: n => `${n} board${n === 1 ? '' : 's'}`,
|
|
506
625
|
noBoards: 'No boards yet',
|
|
507
626
|
noBoardsHint: 'A board keeps the company\'s tasks. People and agents work on them, and each team sees the boards it is given.',
|
|
@@ -1078,6 +1197,8 @@ const I18N = {
|
|
|
1078
1197
|
},
|
|
1079
1198
|
es: {
|
|
1080
1199
|
offline: ago => `Desconectada · vista hace ${ago}`,
|
|
1200
|
+
notJoined: 'Sin conectar: Pisha no pudo iniciar sesión',
|
|
1201
|
+
svNotJoined: 'Por qué no está conectada',
|
|
1081
1202
|
working: d => `Trabajando · ${d}`,
|
|
1082
1203
|
waitingTool: what => `Esperando permiso · ${what}`,
|
|
1083
1204
|
waitingInput: w => `Esperando: ${w || 'tu respuesta'}`,
|
|
@@ -1488,6 +1609,8 @@ const I18N = {
|
|
|
1488
1609
|
tlDismissed: 'La descartaste',
|
|
1489
1610
|
ibxPermTitle: (name, what) => (what ? `${name} pide permiso: ${what}` : `${name} pide permiso`),
|
|
1490
1611
|
ibxPermHint: 'Se responde en su sesión: ábrela para ver exactamente qué quiere ejecutar.',
|
|
1612
|
+
ibxWithCoord: c => `Lo está decidiendo ${c}`,
|
|
1613
|
+
ibxPermRelayedHint: c => `Se le ha pasado a ${c}, su coordinador: lo decide ${c} o te lo pregunta aquí, en la bandeja. También puedes contestarlo en su sesión, y ${c} se entera.`,
|
|
1491
1614
|
ibxApproveTitle: name => `${name} quiere coordinar`,
|
|
1492
1615
|
ibxApproveHint: 'Un nombre que nadie había usado tomó el rol de coordinador. Apruébalo desde su sesión si lo conoces.',
|
|
1493
1616
|
ibxOpenSession: 'Abrir su sesión',
|
|
@@ -1564,8 +1687,123 @@ const I18N = {
|
|
|
1564
1687
|
usageNoTasks: 'Nada gastado en tareas del tablero en este periodo.',
|
|
1565
1688
|
usageEmpty: 'Nada gastado en este periodo',
|
|
1566
1689
|
usageEmptyHint: 'Cada sesión informa de los tokens que gasta mientras trabaja: Claude Code, Codex CLI y Grok CLI.',
|
|
1567
|
-
usageCauses: { user: 'Tus órdenes', inbox: 'Tus respuestas desde la bandeja', coordinator: 'De su coordinador', worker: 'Informes de los workers', link: 'Entre equipos enlazados', board: 'Avisos del tablero', system: 'Avisos del servidor', other: 'Otros mensajes', self: 'Por su cuenta' },
|
|
1568
|
-
usageCauseHints: { user: 'Turnos empezados por lo que escribiste en el terminal de una sesión', inbox: 'Turnos empezados por tus respuestas desde la bandeja', coordinator: 'Turnos de los workers con lo que les pasó su coordinador', worker: 'Turnos de los coordinadores con los informes de sus workers', link: 'Turnos empezados por un mensaje de un equipo enlazado', board: 'Turnos empezados por el tablero de tareas', system: 'Turnos empezados por avisos del servidor', other: 'Turnos empezados por otro mensaje', self: 'Antes de cualquier prompt: una sesión que empieza, o tras una compactación' },
|
|
1690
|
+
usageCauses: { user: 'Tus órdenes', inbox: 'Tus respuestas desde la bandeja', coordinator: 'De su coordinador', worker: 'Informes de los workers', link: 'Entre equipos enlazados', board: 'Avisos del tablero', webhook: 'Webhooks', system: 'Avisos del servidor', other: 'Otros mensajes', self: 'Por su cuenta' },
|
|
1691
|
+
usageCauseHints: { user: 'Turnos empezados por lo que escribiste en el terminal de una sesión', inbox: 'Turnos empezados por tus respuestas desde la bandeja', coordinator: 'Turnos de los workers con lo que les pasó su coordinador', worker: 'Turnos de los coordinadores con los informes de sus workers', link: 'Turnos empezados por un mensaje de un equipo enlazado', board: 'Turnos empezados por el tablero de tareas', webhook: 'Turnos empezados por lo que trajo un webhook', system: 'Turnos empezados por avisos del servidor', other: 'Turnos empezados por otro mensaje', self: 'Antes de cualquier prompt: una sesión que empieza, o tras una compactación' },
|
|
1692
|
+
whTitle: 'Webhooks',
|
|
1693
|
+
whSub: 'Lo que otros servicios envían a tus equipos',
|
|
1694
|
+
whStatus: { queued: 'En cola', delivered: 'Entregado', processing: 'En marcha', unreported: 'Sin informe', done: 'Hecho', ignored: 'Nada que hacer', failed: 'Falló', filtered: 'Filtrado', ping: 'Ping', duplicate: 'Repetido', undelivered: 'No entregado', no_coordinator: 'Sin coordinador', bad_signature: 'Firma inválida', bad_json: 'No es JSON', too_large: 'Demasiado grande', disabled: 'Desactivado', rate_limited: 'Demasiados' },
|
|
1695
|
+
whNone: 'Aún no hay webhooks. Crea uno para que un servicio como GitHub o GitLab envíe a este equipo lo que pasa allí: su coordinador lo recibe tal cual, con tus instrucciones.',
|
|
1696
|
+
whSeeLog: 'Ver el registro',
|
|
1697
|
+
whNew: 'Nuevo webhook',
|
|
1698
|
+
whOn: 'Activo',
|
|
1699
|
+
whOff: 'Desactivado',
|
|
1700
|
+
whOffNoCoord: 'Desactivado: el equipo no tiene coordinador',
|
|
1701
|
+
whPreset: { github: 'GitHub', gitlab: 'GitLab', stripe: 'Stripe', standard: 'Standard Webhooks', custom: 'Otro' },
|
|
1702
|
+
whNothingYet: 'Aún no ha llegado nada',
|
|
1703
|
+
whOnlyEvents: n => `Solo ${n} evento${n === 1 ? '' : 's'}`,
|
|
1704
|
+
whActions: name => `Acciones de ${name}`,
|
|
1705
|
+
whEdit: 'Editar',
|
|
1706
|
+
whTest: 'Enviar una prueba',
|
|
1707
|
+
whShowUrl: 'Ver su dirección',
|
|
1708
|
+
whNewSecret: 'Nuevo secreto',
|
|
1709
|
+
whTurnOff: 'Desactivar',
|
|
1710
|
+
whTurnOn: 'Activar',
|
|
1711
|
+
whTestSent: (id, status) => `Prueba enviada (#${id}): ${status}. Su coordinador la verá como un webhook.`,
|
|
1712
|
+
whNewSecretTitle: name => `¿Nuevo secreto para ${name}?`,
|
|
1713
|
+
whNewSecretText: 'El actual deja de funcionar al momento: lo que envíe a este webhook se rechaza hasta que le des el nuevo.',
|
|
1714
|
+
whDeleteTitle: name => `¿Eliminar ${name}?`,
|
|
1715
|
+
whDeleteText: 'Su dirección deja de funcionar y su registro se elimina con él.',
|
|
1716
|
+
whEditTitle: name => `Editar ${name}`,
|
|
1717
|
+
whNewTitle: team => `Nuevo webhook para ${team}`,
|
|
1718
|
+
whName: 'Nombre',
|
|
1719
|
+
whNamePh: 'GitHub — repositorio de la web',
|
|
1720
|
+
whService: 'Servicio',
|
|
1721
|
+
whVerify: 'Cómo firma',
|
|
1722
|
+
whVerifyName: { 'hmac-sha256': 'HMAC-SHA256 del cuerpo (como GitHub)', token: 'Un token en una cabecera (como GitLab)', stripe: 'Con marca de tiempo, como Stripe (t=…,v1=…)', standard: 'Standard Webhooks (Svix, Resend, Clerk…)' },
|
|
1723
|
+
whSigHeader: 'Cabecera de la firma',
|
|
1724
|
+
whEventHeader: 'Cabecera del evento',
|
|
1725
|
+
whDeliveryHeader: 'Cabecera del id de entrega',
|
|
1726
|
+
whEvents: 'Eventos que acepta',
|
|
1727
|
+
whEventsHint: 'Separados por comas. Un evento solo (push) o con su acción (pull_request.opened). Vacío: todos.',
|
|
1728
|
+
whPrompt: 'Qué debe hacer el coordinador con él',
|
|
1729
|
+
whPromptPh: 'Revisa cada pull request nueva y avísame si algo está mal',
|
|
1730
|
+
whPromptHint: 'Opcional. Va con cada entrega, antes del JSON.',
|
|
1731
|
+
whOwnSecret: 'Secreto',
|
|
1732
|
+
whOwnSecretPh: 'Vacío: se genera uno',
|
|
1733
|
+
whCreate: 'Crear',
|
|
1734
|
+
whMadeTitle: name => `${name} está listo`,
|
|
1735
|
+
whRenewedTitle: name => `Nuevo secreto para ${name}`,
|
|
1736
|
+
whUrlTitle: name => `Dirección de ${name}`,
|
|
1737
|
+
whUrl: 'Dirección (Payload URL)',
|
|
1738
|
+
whSecret: 'Secreto',
|
|
1739
|
+
whToken: 'Token secreto',
|
|
1740
|
+
whSecretOnce: 'Cópialo ahora: no se volverá a mostrar. Siempre puedes generar otro.',
|
|
1741
|
+
whSecretHidden: 'El secreto no se vuelve a mostrar. Si lo perdiste, genera uno nuevo desde el menú del webhook.',
|
|
1742
|
+
whSteps: {
|
|
1743
|
+
github: ['En GitHub, abre el repositorio u organización: Settings › Webhooks › Add webhook.', 'Pega la dirección en Payload URL y elige application/json como Content type.', 'Pega el secreto en Secret, elige los eventos y guarda: GitHub envía un ping, que aparece en el registro.'],
|
|
1744
|
+
gitlab: ['En GitLab, abre el proyecto: Settings › Webhooks › Add new webhook.', 'Pega la dirección en URL y el secreto en Secret token.', 'Elige los disparadores y guarda. Con Test envías uno para verlo en el registro.'],
|
|
1745
|
+
stripe: ['En Stripe, abre Developers › Webhooks › Add destination y elige los eventos.', 'Pega la dirección como URL del endpoint y guarda.', 'Stripe muestra su Signing secret (whsec_…): es el que pegaste aquí. Si lo creaste antes, comprueba que es el mismo.'],
|
|
1746
|
+
standard: ['En el servicio (Resend, Clerk, cualquiera hecho con Svix…), añade un endpoint con esta dirección y elige los eventos.', 'El servicio muestra su secreto de firma (whsec_…): es el que pegaste aquí.', 'Envía una prueba desde allí: aparece en el registro.'],
|
|
1747
|
+
custom: ['Dale al servicio la dirección y el secreto.', 'Tiene que enviar JSON por POST, firmado como elegiste, en las cabeceras que indicaste.'],
|
|
1748
|
+
},
|
|
1749
|
+
whPublicNote: 'El servicio tiene que poder llegar a este servidor desde internet: con tu propio dominio (HTTPS), o con un túnel si Pisha corre en tu ordenador.',
|
|
1750
|
+
whLogOf: team => `Webhooks de ${team}`,
|
|
1751
|
+
whAllWebhooks: 'Todos los webhooks',
|
|
1752
|
+
whAllStatuses: 'Cualquier estado',
|
|
1753
|
+
whBackToTeam: 'Volver al equipo',
|
|
1754
|
+
whLogEmpty: 'No ha llegado nada',
|
|
1755
|
+
whLogEmptyHint: 'Aquí queda anotado todo lo que llega a un webhook, también lo rechazado.',
|
|
1756
|
+
whLogNoHooks: 'Aquí no hay webhooks: crea uno en la página de un equipo.',
|
|
1757
|
+
whWhen: 'Recibido',
|
|
1758
|
+
whWebhook: 'Webhook',
|
|
1759
|
+
whEvent: 'Evento',
|
|
1760
|
+
whState: 'Estado',
|
|
1761
|
+
whResult: 'Resultado',
|
|
1762
|
+
whMore: 'Ver más antiguos',
|
|
1763
|
+
whShown: n => `${n} mostrados`,
|
|
1764
|
+
whDeliveredTo: c => `Entregado a ${c}`,
|
|
1765
|
+
whDeliveryTitle: id => `Entrega #${id}`,
|
|
1766
|
+
whDeliveryKey: 'Id de entrega',
|
|
1767
|
+
whFrom: 'Desde',
|
|
1768
|
+
whSize: 'Tamaño',
|
|
1769
|
+
whBytes: n => (n >= 1024 ? `${(n / 1024).toFixed(1).replace('.', ',')} KB` : `${n} bytes`),
|
|
1770
|
+
whReason: 'Motivo',
|
|
1771
|
+
whTo: 'Entregado a',
|
|
1772
|
+
whMessage: id => `mensaje #${id}`,
|
|
1773
|
+
whHeaders: n => `Cabeceras (${n})`,
|
|
1774
|
+
whBody: 'Lo que envió',
|
|
1775
|
+
whNoBody: 'No se guardó nada: lo rechazado se anota sin lo que traía.',
|
|
1776
|
+
whRedeliver: 'Entregárselo otra vez al coordinador',
|
|
1777
|
+
whRedelivered: id => `Entregado otra vez como entrega #${id}.`,
|
|
1778
|
+
whWhy: { processing: 'Su coordinador está con ello', unreported: 'El turno de su coordinador terminó sin decir qué salió de ello', filtered: 'No es uno de los eventos que acepta este webhook', duplicate: 'Ya recibido: no se entrega otra vez', bad_signature: 'La firma no coincide con el secreto del webhook', bad_json: 'Lo que llegó no es JSON', too_large: 'Más grande de lo que puede enviar un webhook', disabled: 'El webhook está desactivado', rate_limited: 'Demasiados en un minuto', no_coordinator: 'El equipo no tiene coordinador', ping: 'El servicio comprobando la dirección' },
|
|
1779
|
+
whWhyAgain: id => `Entregado otra vez, desde la #${id}`,
|
|
1780
|
+
whWhyTest: 'Una prueba enviada desde el panel',
|
|
1781
|
+
whServiceSecret: 'Secreto de firma, del servicio',
|
|
1782
|
+
whServiceSecretHint: 'Este servicio genera el secreto él mismo: cópialo de donde añades el webhook allí.',
|
|
1783
|
+
whSecretFromService: 'El secreto es el que te dio el servicio y pegaste: aquí no se muestra.',
|
|
1784
|
+
whPasteSecretText: 'Pega el nuevo secreto de firma que muestra el servicio. El actual deja de funcionar al momento.',
|
|
1785
|
+
whByEvent: 'Instrucciones por evento',
|
|
1786
|
+
whByEventHint: 'Para un evento (pull_request) o un evento y acción (pull_request.opened): se usa la más concreta, y las de arriba para el resto.',
|
|
1787
|
+
whByEventAdd: '+ Instrucciones para un evento',
|
|
1788
|
+
whRemove: 'Quitar',
|
|
1789
|
+
whBatch: 'Agrupar ráfagas (segundos)',
|
|
1790
|
+
whBatchHint: 'Lo que llegue en estos segundos le llega al coordinador en un solo aviso. 0: cada uno por separado.',
|
|
1791
|
+
whBatchTag: n => `Agrupa ${n} s`,
|
|
1792
|
+
whTogether: list => `Entregado en un solo aviso con ${list}: lo que hizo su coordinador también es de ellas.`,
|
|
1793
|
+
whNoWorkerReport: 'El worker aún no ha informado',
|
|
1794
|
+
whWaitingFor: names => `Esperando el informe de ${names}`,
|
|
1795
|
+
whWorkerTokens: (n, calls) => `Sus workers: ${n} tokens en ${calls} llamada${calls === 1 ? '' : 's'}`,
|
|
1796
|
+
whWhatItDid: 'Qué hizo su coordinador',
|
|
1797
|
+
whNoReport: 'No ha dicho qué salió de ello (webhook_result).',
|
|
1798
|
+
whNotYet: 'Su coordinador aún no se ha puesto con ello.',
|
|
1799
|
+
whNoTrace: 'No se vio nada de su turno: puede que tenga la observación apagada.',
|
|
1800
|
+
whTook: s => (s < 90 ? `Su turno: ${s} s` : `Su turno: ${Math.round(s / 60)} min`),
|
|
1801
|
+
whStillOn: 'Sigue con ello',
|
|
1802
|
+
whTools: n => `${n} llamada${n === 1 ? '' : 's'} a herramientas`,
|
|
1803
|
+
whSent: n => `${n} mensaje${n === 1 ? '' : 's'} enviado${n === 1 ? '' : 's'}`,
|
|
1804
|
+
whSentTo: to => `A ${to}:`,
|
|
1805
|
+
whLastWords: 'Lo que dijo al final',
|
|
1806
|
+
whTokens: (n, calls) => `${n} tokens en ${calls} llamada${calls === 1 ? '' : 's'}`,
|
|
1569
1807
|
boardsCount: n => `${n} tablero${n === 1 ? '' : 's'}`,
|
|
1570
1808
|
noBoards: 'Todavía no hay tableros',
|
|
1571
1809
|
noBoardsHint: 'Un tablero guarda las tareas de la empresa. Personas y agentes trabajan en ellas, y cada equipo ve los tableros que se le asignan.',
|
package/ui/icons.js
CHANGED
|
@@ -19,6 +19,7 @@ const PATHS = {
|
|
|
19
19
|
more: '<circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/>',
|
|
20
20
|
sun: '<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>',
|
|
21
21
|
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
|
|
22
|
+
webhook: '<circle cx="12" cy="6" r="2.6"/><circle cx="5.5" cy="17.5" r="2.6"/><circle cx="18.5" cy="17.5" r="2.6"/><path d="M10.7 8.3 6.9 15M8.1 17.5h7.8M13.3 8.3l3.8 6.7"/>',
|
|
22
23
|
usage: '<path d="M4 20h16"/><rect x="5" y="11" width="3" height="6" rx="1"/><rect x="10.5" y="6" width="3" height="11" rx="1"/><rect x="16" y="9" width="3" height="8" rx="1"/>',
|
|
23
24
|
board: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16M15 4v16"/><path d="M5.5 8h1.5M11 8h2M11 11h2M17 8h1.5"/>',
|
|
24
25
|
pr: '<circle cx="6" cy="6" r="2.3"/><circle cx="6" cy="18" r="2.3"/><circle cx="18" cy="18" r="2.3"/><path d="M6 8.3v7.4M18 15.7V10a3 3 0 0 0-3-3h-4"/><path d="m13 4.5-2.5 2.5 2.5 2.5"/>',
|
package/ui/inbox.js
CHANGED
|
@@ -61,6 +61,9 @@ export function cantAnswer(i) {
|
|
|
61
61
|
return null
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
// The coordinator a worker's permission prompt went to, while it is there.
|
|
65
|
+
const relayedTo = s => s.activity?.relayed_to ?? null
|
|
66
|
+
|
|
64
67
|
// What a session waiting for permission wants to run.
|
|
65
68
|
const permWhat = s => { const a = s.activity ?? {}; return a.tool?.name ? [a.tool.name, a.tool.summary].filter(Boolean).join(' · ') : a.waiting ?? '' }
|
|
66
69
|
|
|
@@ -79,7 +82,8 @@ function entries() {
|
|
|
79
82
|
const tells = open.filter(i => i.kind === 'tell').map(i => ({ key: `i${i.id}`, kind: 'tell', i, at: i.created_at }))
|
|
80
83
|
const newest = (a, b) => b.at - a.at
|
|
81
84
|
return [
|
|
82
|
-
|
|
85
|
+
// (A worker's prompt its coordinator is deciding comes after what the coordinators ask.)
|
|
86
|
+
{ id: 'decide', label: T.ibxDecide, list: [...perms.filter(e => !relayedTo(e.s)).sort(newest), ...asks.sort(newest), ...perms.filter(e => relayedTo(e.s)).sort(newest), ...approvals] },
|
|
83
87
|
{ id: 'know', label: T.inboxTell, list: tells.sort(newest) },
|
|
84
88
|
]
|
|
85
89
|
}
|
|
@@ -168,7 +172,7 @@ function row(e, on, tab = 'pending') {
|
|
|
168
172
|
meta = [who(e.s.name), esc(teamOf(e.s.name))]
|
|
169
173
|
} else if (e.kind === 'perm') {
|
|
170
174
|
dot = 'warn'; title = T.ibxPermTitle(e.s.name, permWhat(e.s))
|
|
171
|
-
meta = [who(e.s.name), esc(teamOf(e.s.name))]
|
|
175
|
+
meta = [who(e.s.name), esc(teamOf(e.s.name)), relayedTo(e.s) ? esc(T.ibxWithCoord(relayedTo(e.s))) : '']
|
|
172
176
|
} else if (e.kind === 'approve') {
|
|
173
177
|
dot = 'warn'; title = T.ibxApproveTitle(e.s.name)
|
|
174
178
|
meta = [who(e.s.name), esc(T.approveNote)]
|
|
@@ -221,8 +225,12 @@ function detail(e) {
|
|
|
221
225
|
const s = e.s
|
|
222
226
|
return `<article class="ibx-card">${head(s.name, T.ibxPermission, e.at, false)}
|
|
223
227
|
<div class="ibx-body"><h2 class="ibx-q">${esc(T.ibxPermTitle(s.name, ''))}</h2><pre class="ibx-perm">${esc(permWhat(s) || status(s).text)}</pre>
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
${relayedTo(s)
|
|
229
|
+
// (With its coordinator: answered there, or asked here; its terminal is only the way around.)
|
|
230
|
+
? `<p class="ibx-note" data-relayed>${esc(T.ibxPermRelayedHint(relayedTo(s)))}</p>
|
|
231
|
+
<div class="ibx-actions"><a class="btn" href="#/s/${encodeURIComponent(s.name)}">${esc(T.ibxOpenSession)}</a></div>`
|
|
232
|
+
: `<p class="ibx-note">${esc(T.ibxPermHint)}</p>
|
|
233
|
+
<div class="ibx-actions"><a class="btn primary ok" href="#/s/${encodeURIComponent(s.name)}">${esc(T.ibxOpenSession)}</a></div>`}</div></article>`
|
|
226
234
|
}
|
|
227
235
|
if (e.kind === 'approve') {
|
|
228
236
|
const s = e.s
|
package/ui/index.html
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
<link rel="stylesheet" href="/ui/screen-org.css">
|
|
26
26
|
<link rel="stylesheet" href="/ui/screen-boards.css">
|
|
27
27
|
<link rel="stylesheet" href="/ui/screen-usage.css">
|
|
28
|
+
<link rel="stylesheet" href="/ui/screen-webhooks.css">
|
|
28
29
|
<link rel="stylesheet" href="/ui/screen-team.css">
|
|
29
30
|
<link rel="stylesheet" href="/ui/screen-session.css">
|
|
30
31
|
<link rel="stylesheet" href="/ui/screen-machines.css">
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
<div id="teams" hidden></div>
|
|
84
85
|
<div id="boards" hidden></div>
|
|
85
86
|
<div id="usage" hidden></div>
|
|
87
|
+
<div id="webhooks" hidden></div>
|
|
86
88
|
<div id="team" hidden></div>
|
|
87
89
|
<div id="newteam" hidden></div>
|
|
88
90
|
<div id="addmachine" hidden></div>
|
package/ui/nav.js
CHANGED
|
@@ -97,9 +97,10 @@ export function renderNav() {
|
|
|
97
97
|
let html = `<div class="rail-group" role="group" aria-label="${esc(T.mainNav)}">
|
|
98
98
|
<a href="#/"${here(r.view === 'inbox')}>${icon('inbox')}<span class="name">${esc(T.inbox)}</span>${inboxN ? `<span class="badge">${inboxN}</span>` : ''}</a>
|
|
99
99
|
<a href="#/teams"${here(isTeams(r) && !r.squad)}>${icon('teams')}<span class="name">${esc(T.teams)}</span></a>
|
|
100
|
+
<div class="rail-row"><a href="#/hosts"${here(isMachines(r))}>${icon('machines')}<span class="name">${esc(T.machines)}</span>${machineList.length ? `<span class="rail-count">${esc(T.ofTotal(machinesOn, machineList.length))}</span>` : ''}</a>${can('manager') ? `<button type="button" class="icon-btn" id="addHostBtn" title="${esc(T.addTitle)}" aria-label="${esc(T.addTitle)}">${icon('plus')}</button>` : ''}</div>
|
|
100
101
|
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span class="name">${esc(T.boards)}</span>${boardsPending() ? `<span class="rail-count" title="${esc(T.pendingTitle)}">${boardsPending()}</span>` : ''}</a>
|
|
102
|
+
<a href="#/webhooks"${here(r.view === 'webhooks')}>${icon('webhook')}<span class="name">${esc(T.whTitle)}</span></a>
|
|
101
103
|
<a href="#/usage"${here(r.view === 'usage')}>${icon('usage')}<span class="name">${esc(T.usage)}</span></a>
|
|
102
|
-
<div class="rail-row"><a href="#/hosts"${here(isMachines(r))}>${icon('machines')}<span class="name">${esc(T.machines)}</span>${machineList.length ? `<span class="rail-count">${esc(T.ofTotal(machinesOn, machineList.length))}</span>` : ''}</a>${can('manager') ? `<button type="button" class="icon-btn" id="addHostBtn" title="${esc(T.addTitle)}" aria-label="${esc(T.addTitle)}">${icon('plus')}</button>` : ''}</div>
|
|
103
104
|
</div>`
|
|
104
105
|
|
|
105
106
|
// Names waiting for the user: their ⋯ menu has the button.
|
|
@@ -119,8 +120,8 @@ export function renderNav() {
|
|
|
119
120
|
// the thumb's reach. (There is no sidebar there: all it has is reached from these.)
|
|
120
121
|
setHtml($('tabbar'), `<a href="#/"${here(r.view === 'inbox')}>${icon('inbox')}<span>${esc(T.inbox)}</span>${inboxN ? `<span class="badge">${inboxN}</span>` : ''}</a>
|
|
121
122
|
<a href="#/teams"${here(isTeams(r) || r.view === 'session')}>${icon('teams')}<span>${esc(T.teams)}</span></a>
|
|
122
|
-
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span>${esc(T.boards)}</span></a>
|
|
123
123
|
<a href="#/hosts"${here(isMachines(r))}>${icon('machines')}<span>${esc(T.machines)}</span></a>
|
|
124
|
+
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span>${esc(T.boards)}</span></a>
|
|
124
125
|
<button type="button" class="rail-item" data-palette>${icon('search')}<span>${esc(T.goToShort)}</span></button>
|
|
125
126
|
<button type="button" class="rail-item" data-settings aria-haspopup="dialog">${icon('settings')}<span>${esc(T.settings)}</span></button>`)
|
|
126
127
|
}
|
package/ui/palette.js
CHANGED
|
@@ -57,8 +57,9 @@ function candidates() {
|
|
|
57
57
|
{ group: 'screens', label: T.teams, lead: icon('teams'), go: '#/teams' },
|
|
58
58
|
{ group: 'screens', label: T.viewMosaic, sub: T.allSessions, lead: icon('teams'), go: '#/mosaic' },
|
|
59
59
|
{ group: 'screens', label: T.org, lead: icon('teams'), go: '#/org' },
|
|
60
|
-
{ group: 'screens', label: T.usage, sub: T.usageSub, lead: icon('usage'), go: '#/usage' },
|
|
61
60
|
{ group: 'screens', label: T.machines, sub: hosts.size ? T.ofTotal([...hosts.values()].filter(h => h.online).length, hosts.size) : '', lead: icon('machines'), go: '#/hosts' },
|
|
61
|
+
{ group: 'screens', label: T.whTitle, sub: T.whSub, lead: icon('webhook'), go: '#/webhooks' },
|
|
62
|
+
{ group: 'screens', label: T.usage, sub: T.usageSub, lead: icon('usage'), go: '#/usage' },
|
|
62
63
|
{ group: 'screens', label: T.settings, lead: icon('settings'), run: async () => (await import('./people.js')).openSettings() },
|
|
63
64
|
)
|
|
64
65
|
if (sortedSessions({ archived: true }).length) items.push({ group: 'screens', label: T.archived, lead: icon('archive'), go: '#/archived' })
|
package/ui/router.js
CHANGED
|
@@ -11,6 +11,7 @@ import { renderInbox } from './inbox.js'
|
|
|
11
11
|
import { renderTeams } from './teams.js'
|
|
12
12
|
import { renderBoards } from './boards.js'
|
|
13
13
|
import { renderUsage } from './usage.js'
|
|
14
|
+
import { renderWebhooks } from './webhooks.js'
|
|
14
15
|
import { renderTeam } from './team.js'
|
|
15
16
|
import { renderSessionAside } from './session.js'
|
|
16
17
|
import { renderNewTeam } from './newteam.js'
|
|
@@ -102,6 +103,7 @@ export function route() {
|
|
|
102
103
|
$('teams').hidden = r.view !== 'teams'
|
|
103
104
|
$('boards').hidden = r.view !== 'boards' && r.view !== 'board'
|
|
104
105
|
$('usage').hidden = r.view !== 'usage'
|
|
106
|
+
$('webhooks').hidden = r.view !== 'webhooks'
|
|
105
107
|
$('team').hidden = r.view !== 'team'
|
|
106
108
|
$('newteam').hidden = r.view !== 'newteam'
|
|
107
109
|
$('addmachine').hidden = r.view !== 'addmachine'
|
|
@@ -133,12 +135,12 @@ export function route() {
|
|
|
133
135
|
$('session').hidden = true
|
|
134
136
|
$('mosaic').hidden = false
|
|
135
137
|
buildMosaic()
|
|
136
|
-
} else if (r.view === 'archived' || r.view === 'org' || r.view === 'inbox' || r.view === 'teams' || r.view === 'boards' || r.view === 'board' || r.view === 'usage' || r.view === 'team' || r.view === 'newteam' || r.view === 'addmachine') {
|
|
138
|
+
} else if (r.view === 'archived' || r.view === 'org' || r.view === 'inbox' || r.view === 'teams' || r.view === 'boards' || r.view === 'board' || r.view === 'usage' || r.view === 'webhooks' || r.view === 'team' || r.view === 'newteam' || r.view === 'addmachine') {
|
|
137
139
|
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
|
138
140
|
clearMosaic()
|
|
139
141
|
$('session').hidden = true
|
|
140
142
|
$('mosaic').hidden = true
|
|
141
|
-
if (r.view === 'org') renderOrg(); else if (r.view === 'inbox') renderInbox(); else if (r.view === 'teams') renderTeams(); else if (r.view === 'boards' || r.view === 'board') renderBoards(); else if (r.view === 'usage') renderUsage(); else if (r.view === 'team') renderTeam(); else if (r.view === 'newteam') renderNewTeam(); else if (r.view === 'addmachine') renderAddMachine(); else renderArchived()
|
|
143
|
+
if (r.view === 'org') renderOrg(); else if (r.view === 'inbox') renderInbox(); else if (r.view === 'teams') renderTeams(); else if (r.view === 'boards' || r.view === 'board') renderBoards(); else if (r.view === 'usage') renderUsage(); else if (r.view === 'webhooks') renderWebhooks(); else if (r.view === 'team') renderTeam(); else if (r.view === 'newteam') renderNewTeam(); else if (r.view === 'addmachine') renderAddMachine(); else renderArchived()
|
|
142
144
|
} else if (st) {
|
|
143
145
|
// The session's live terminal, as in Machines: watch it and type to it.
|
|
144
146
|
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
package/ui/routes.js
CHANGED
|
@@ -20,6 +20,10 @@ export function parseRoute(hash) {
|
|
|
20
20
|
// The task boards; one of them, with a task open beside it (or a new one).
|
|
21
21
|
if (hash === '#/boards') return { view: 'boards' }
|
|
22
22
|
if (hash === '#/usage') return { view: 'usage' }
|
|
23
|
+
// What came in through the webhooks: all of them, or one team's.
|
|
24
|
+
if (hash === '#/webhooks') return { view: 'webhooks' }
|
|
25
|
+
const wq = hash.match(/^#\/webhooks\/q\/([^/]+)$/)
|
|
26
|
+
if (wq) return ROUTE_NAME.test(dec(wq[1])) ? { view: 'webhooks', team: dec(wq[1]) } : { view: 'webhooks' }
|
|
23
27
|
const bd = hash.match(/^#\/b\/(\d{1,9})(?:\/(new|[A-Za-z][A-Za-z0-9]{0,5}-\d{1,9}))?$/)
|
|
24
28
|
if (bd) return { view: 'board', board: Number(bd[1]), ...(bd[2] ? { task: bd[2] } : {}) }
|
|
25
29
|
if (hash === '#/new') return { view: 'newteam' }
|
package/ui/screen-session.css
CHANGED
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
.tl-bar i { display: block; height: 100%; border-radius: inherit; background: var(--info); }
|
|
72
72
|
.tl-bar i.hot { background: var(--warn); }
|
|
73
73
|
.tl-plan { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: var(--fs-sm); color: var(--muted); }
|
|
74
|
+
.tl-why { margin: -6px 0 12px; padding: 8px 10px; border-radius: var(--r); background: var(--err-soft); color: var(--err); font-size: var(--fs-sm); overflow-wrap: anywhere; }
|
|
74
75
|
.tl-task { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
|
|
75
76
|
.tl-task .tq-label { display: block; margin: 0 0 3px; }
|
|
76
77
|
.tl-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: var(--fs-sm); }
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* Webhooks: a team's list on its page, the log of what came in, and the
|
|
2
|
+
dialogs to make one and to read one delivery. */
|
|
3
|
+
|
|
4
|
+
/* On a team's page. */
|
|
5
|
+
.wh-h-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
|
|
6
|
+
.wh-list { list-style: none; margin: 0; padding: 4px 0; }
|
|
7
|
+
.wh-row { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 52px 10px 16px; }
|
|
8
|
+
.wh-row + .wh-row { border-top: 1px solid var(--line); }
|
|
9
|
+
.wh-main, .wh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
|
|
10
|
+
.wh-name { font-weight: 600; overflow-wrap: anywhere; }
|
|
11
|
+
.wh-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
|
|
12
|
+
.wh-meta { font-size: var(--fs-sm); color: var(--muted); }
|
|
13
|
+
.wh-when { white-space: nowrap; }
|
|
14
|
+
.wh-events { white-space: nowrap; }
|
|
15
|
+
.wh-more { position: absolute; top: 8px; right: 10px; }
|
|
16
|
+
|
|
17
|
+
/* The log. */
|
|
18
|
+
#webhooks { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
|
|
19
|
+
.wh-table-card { overflow: hidden; padding: 0; }
|
|
20
|
+
.wh-table { width: 100%; min-width: 640px; border-collapse: collapse; }
|
|
21
|
+
.wh-table th { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
|
|
22
|
+
.wh-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
23
|
+
.wh-table tr:last-child td { border-bottom: 0; }
|
|
24
|
+
.wh-table tbody tr { cursor: pointer; }
|
|
25
|
+
.wh-table tbody tr:hover { background: var(--raised); }
|
|
26
|
+
.wh-table tbody tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
|
|
27
|
+
.wh-table td small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
|
|
28
|
+
.wh-when-c { white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
29
|
+
.wh-ev { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
|
|
30
|
+
.wh-res { color: var(--muted); font-size: var(--fs-sm); max-width: 360px; overflow-wrap: anywhere; }
|
|
31
|
+
.wh-more-row { display: flex; justify-content: center; }
|
|
32
|
+
|
|
33
|
+
/* The dialogs. */
|
|
34
|
+
/* (Long ones scroll; their buttons stay in sight.) */
|
|
35
|
+
.modal .wh-actions { position: sticky; bottom: calc(var(--pad) * -1); z-index: 1; }
|
|
36
|
+
.wh-form { display: flex; flex-direction: column; gap: 12px; }
|
|
37
|
+
.wh-form .field { margin: 0; }
|
|
38
|
+
.wh-form .field small { display: block; margin-top: 4px; }
|
|
39
|
+
.wh-form .field > .seg { margin-top: 4px; }
|
|
40
|
+
.wh-custom { display: flex; flex-direction: column; gap: 12px; }
|
|
41
|
+
.wh-custom[hidden] { display: none; }
|
|
42
|
+
.wh-label { margin: 12px 0 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
|
|
43
|
+
.wh-label:first-child { margin-top: 0; }
|
|
44
|
+
.wh-note { margin: 0 0 8px; font-size: var(--fs-sm); color: var(--warn); }
|
|
45
|
+
.wh-secret .cmdrow, .wh-detail .cmdrow { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
|
|
46
|
+
.wh-secret .cmdrow .cmd { flex: 1; min-width: 0; margin: 0; white-space: pre-wrap; word-break: break-all; }
|
|
47
|
+
.wh-steps { margin: 14px 0 10px; padding-left: 20px; color: var(--ink-2); line-height: 1.55; }
|
|
48
|
+
.wh-steps li + li { margin-top: 4px; }
|
|
49
|
+
.wh-d-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
50
|
+
.wh-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 12px; }
|
|
51
|
+
.wh-facts dt { color: var(--muted); font-size: var(--fs-sm); }
|
|
52
|
+
.wh-facts dd { margin: 0; overflow-wrap: anywhere; }
|
|
53
|
+
.wh-facts code, .wh-kv code { font-family: var(--mono); font-size: 12.5px; }
|
|
54
|
+
.wh-headers { margin: 0 0 12px; }
|
|
55
|
+
.wh-headers summary { cursor: pointer; color: var(--ink-2); font-size: var(--fs-sm); }
|
|
56
|
+
.wh-kv { margin-top: 8px; border-collapse: collapse; }
|
|
57
|
+
.wh-kv th { padding: 3px 14px 3px 0; text-align: left; font-weight: 500; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; vertical-align: top; }
|
|
58
|
+
.wh-kv td { padding: 3px 0; overflow-wrap: anywhere; }
|
|
59
|
+
.wh-body { max-height: 46vh; margin: 0; overflow: auto; white-space: pre; }
|
|
60
|
+
.wh-detail + .err { margin-top: 8px; }
|
|
61
|
+
|
|
62
|
+
/* What to do by event, and gathering bursts, in the dialog. */
|
|
63
|
+
.wh-form .seg { flex-wrap: wrap; }
|
|
64
|
+
.wh-by-event > small { display: block; margin: 2px 0 8px; }
|
|
65
|
+
.wh-pe-list { display: flex; flex-direction: column; gap: 8px; }
|
|
66
|
+
.wh-pe-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) auto; gap: 8px; align-items: start; }
|
|
67
|
+
.wh-pe-row input, .wh-pe-row textarea { width: 100%; }
|
|
68
|
+
.wh-pe-row input { font-family: var(--mono); font-size: 12.5px; }
|
|
69
|
+
.wh-pe-add { align-self: flex-start; margin-top: 6px; padding-left: 0; }
|
|
70
|
+
.wh-batch input { max-width: 120px; }
|
|
71
|
+
|
|
72
|
+
/* What the coordinator did with it. */
|
|
73
|
+
.wh-turn { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--raised); }
|
|
74
|
+
.wh-turn .wh-label { margin-top: 0; }
|
|
75
|
+
.wh-report { margin: 0 0 6px; overflow-wrap: anywhere; }
|
|
76
|
+
.wh-report .tag { margin-right: 4px; vertical-align: 1px; }
|
|
77
|
+
.wh-report small { margin-left: 8px; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
|
|
78
|
+
.wh-turn .dim-note { margin: 0 0 6px; }
|
|
79
|
+
.wh-turn-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; color: var(--muted); font-size: var(--fs-sm); }
|
|
80
|
+
.wh-trace-part { margin-top: 6px; }
|
|
81
|
+
.wh-trace-part summary { cursor: pointer; color: var(--ink-2); font-size: var(--fs-sm); }
|
|
82
|
+
.wh-tools, .wh-msgs { margin: 6px 0 0; padding-left: 20px; font-size: var(--fs-sm); max-height: 240px; overflow: auto; }
|
|
83
|
+
.wh-tools li, .wh-msgs li { margin: 2px 0; overflow-wrap: anywhere; }
|
|
84
|
+
.wh-tools code { font-family: var(--mono); font-size: 12px; }
|
|
85
|
+
.wh-tools span { color: var(--muted); }
|
|
86
|
+
.wh-tools li.bad code { color: var(--err); }
|
|
87
|
+
.wh-said { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); max-height: 240px; overflow: auto; }
|
|
88
|
+
|
|
89
|
+
.wh-wreport { margin: 3px 0 6px; overflow-wrap: anywhere; }
|
|
90
|
+
.wh-wreport .tag { margin-right: 4px; }
|
|
91
|
+
|
|
92
|
+
@media (max-width: 900px) {
|
|
93
|
+
#webhooks { padding: 12px; }
|
|
94
|
+
.wh-pe-row { grid-template-columns: minmax(0, 1fr) auto; }
|
|
95
|
+
.wh-pe-row textarea { grid-column: 1 / -1; grid-row: 2; }
|
|
96
|
+
/* The log as a list: each entry two lines, nothing cut off. */
|
|
97
|
+
.wh-table { min-width: 0; }
|
|
98
|
+
.wh-table thead { display: none; }
|
|
99
|
+
.wh-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
|
|
100
|
+
.wh-table tbody tr:last-child { border-bottom: 0; }
|
|
101
|
+
.wh-table td { display: block; padding: 0; border: 0; }
|
|
102
|
+
.wh-table td:nth-child(2) { grid-column: 1; grid-row: 1; }
|
|
103
|
+
.wh-table td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
|
|
104
|
+
.wh-table td.wh-when-c { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-sm); }
|
|
105
|
+
.wh-table td.wh-when-c small { display: inline; margin-left: 6px; }
|
|
106
|
+
.wh-table td.wh-ev, .wh-table td.wh-res { grid-column: 1 / -1; max-width: none; }
|
|
107
|
+
.wh-table td.wh-res:empty { display: none; }
|
|
108
|
+
.wh-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
|
|
109
|
+
.wh-facts dd { margin-bottom: 8px; }
|
|
110
|
+
.wh-row { padding-right: 48px; min-height: 48px; }
|
|
111
|
+
}
|
package/ui/session.js
CHANGED
|
@@ -2,7 +2,7 @@ import { $ } from './dom.js'
|
|
|
2
2
|
import { T, LOCALE } from './i18n.js'
|
|
3
3
|
import { state, sessions, hosts } from './state.js'
|
|
4
4
|
import { esc, kfmt } from './format.js'
|
|
5
|
-
import { sortedSessions, status, agentMark } from './content.js'
|
|
5
|
+
import { sortedSessions, status, agentMark, loginError } from './content.js'
|
|
6
6
|
import { setHtml } from './nav.js'
|
|
7
7
|
import { currentRoute } from './router.js'
|
|
8
8
|
import { permissionsSection } from './permissions.js'
|
|
@@ -34,7 +34,10 @@ export function renderSessionAside() {
|
|
|
34
34
|
[T.svPersona, s.persona?.name ? esc(s.persona.name) : ''],
|
|
35
35
|
[T.svOpened, s.created_at ? esc(when(s.created_at * 1000)) : ''],
|
|
36
36
|
].filter(f => f[1])
|
|
37
|
-
|
|
37
|
+
// Running on its machine, but its plugin refused to log in: why, first.
|
|
38
|
+
const why = !s.online ? loginError(s) : null
|
|
39
|
+
setHtml(box, `${why ? `<section><h2 class="tq-label">${esc(T.svNotJoined)}</h2><p class="tl-why" data-login-error>${esc(why)}</p></section>` : ''}
|
|
40
|
+
${members.length ? `<section><h2 class="tq-label">${esc(T.svTeam)}</h2><ul class="sv-members">${members.map(m => member(m, s.name)).join('')}</ul><a class="ibx-link sv-small" href="#/q/${encodeURIComponent(team)}">${esc(T.svSeeTeam)}</a></section>` : ''}
|
|
38
41
|
${facts.length ? `<section><h2 class="tq-label">${esc(T.svDetails)}</h2><dl class="ibx-facts sv-facts">${facts.map(([k, v]) => `<dt>${esc(k)}</dt><dd>${v}</dd>`).join('')}</dl></section>` : ''}
|
|
39
42
|
${s.role !== 'solo' && s.opened_role !== 'solo' ? permissionsSection({ session: s.name }) : ''}
|
|
40
43
|
${a.observe === 'off' ? `<p class="sv-small sv-quiet">${esc(T.svNotObserved)}</p>` : ''}`)
|
package/ui/stream.js
CHANGED
|
@@ -20,6 +20,7 @@ import { renderInbox, refreshInbox } from './inbox.js'
|
|
|
20
20
|
import { refreshTeams } from './teams.js'
|
|
21
21
|
import { boardsArrived, taskArrived, boardDeleted } from './boards.js'
|
|
22
22
|
import { refreshTeam, noteReport } from './team.js'
|
|
23
|
+
import { webhooksArrived, deliveryArrived } from './webhooks.js'
|
|
23
24
|
import { refreshSessionAside } from './session.js'
|
|
24
25
|
import { setVersion, showLogin } from './app.js'
|
|
25
26
|
|
|
@@ -121,6 +122,8 @@ function onStream(type, data) {
|
|
|
121
122
|
soon(renderNav); soon(refreshInbox); soon(refreshTeams); soon(refreshTeam); soon(refreshSessionAside)
|
|
122
123
|
return
|
|
123
124
|
}
|
|
125
|
+
if (type === 'webhooks') return webhooksArrived(data)
|
|
126
|
+
if (type === 'webhook-delivery') return deliveryArrived(data)
|
|
124
127
|
if (type === 'squads') {
|
|
125
128
|
state.squadMeta = new Map((Array.isArray(data) ? data : []).map(q => [q.coordinator, q]))
|
|
126
129
|
if (currentRoute().view === 'org') soon(renderOrg)
|