pisha-server 0.0.0-stage → 0.0.11
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/LICENSE +21 -0
- package/README.md +40 -2
- package/accounts/accounts.js +754 -0
- package/accounts/index.js +1 -0
- package/accounts/passwords.js +41 -0
- package/accounts/totp.js +54 -0
- package/boards/boards.js +1079 -0
- package/boards/github.js +212 -0
- package/boards/index.js +1 -0
- package/boards/sync.js +980 -0
- package/companies.js +294 -0
- package/company-export.js +101 -0
- package/company.js +79 -0
- package/dashboard/dashboard.js +407 -0
- package/dashboard/index.js +1 -0
- package/data-upgrade.js +69 -0
- package/install/linux.sh +181 -0
- package/install/macos.sh +121 -0
- package/install/windows.bat +54 -0
- package/machines/index.js +3 -0
- package/machines/machines.js +910 -0
- package/messaging/inbox.js +252 -0
- package/messaging/index.js +3 -0
- package/messaging/messaging.js +551 -0
- package/messaging/plans.js +67 -0
- package/observation/index.js +1 -0
- package/observation/observation.js +224 -0
- package/organization/index.js +1 -0
- package/organization/organization.js +218 -0
- package/package.json +54 -4
- package/permissions/index.js +1 -0
- package/permissions/permissions.js +211 -0
- package/pisha-host.mjs +3297 -0
- package/pisha-host.mjs.sig +1 -0
- package/platform/acme.js +207 -0
- package/platform/basics.js +14 -0
- package/platform/config.js +154 -0
- package/platform/control.js +93 -0
- package/platform/credentials.js +151 -0
- package/platform/database.js +251 -0
- package/platform/errors.js +13 -0
- package/platform/files.js +50 -0
- package/platform/http.js +207 -0
- package/platform/index.js +58 -0
- package/platform/limits.js +122 -0
- package/platform/listen.js +183 -0
- package/platform/roles.js +6 -0
- package/platform/stream.js +19 -0
- package/platform/text.js +83 -0
- package/platform/ws.js +186 -0
- package/routes.js +405 -0
- package/server.js +65 -0
- package/sessions/index.js +1 -0
- package/sessions/sessions.js +533 -0
- package/ui/LICENSE-affectui.txt +26 -0
- package/ui/addmachine.js +151 -0
- package/ui/api.js +20 -0
- package/ui/app.js +143 -0
- package/ui/attention.js +78 -0
- package/ui/back.js +166 -0
- package/ui/boards.js +958 -0
- package/ui/chat.js +388 -0
- package/ui/content.js +157 -0
- package/ui/dialogs.js +135 -0
- package/ui/doing.js +112 -0
- package/ui/dom.js +6 -0
- package/ui/ds-base.css +146 -0
- package/ui/ds-components.css +229 -0
- package/ui/fonts/LICENSE-space-grotesk.txt +93 -0
- package/ui/fonts/space-grotesk-latin-700-normal.woff2 +0 -0
- package/ui/fonts/space-grotesk-latin-ext-700-normal.woff2 +0 -0
- package/ui/format.js +25 -0
- package/ui/i18n.js +2093 -0
- package/ui/icons/apple-touch-icon.png +0 -0
- package/ui/icons/icon-192.png +0 -0
- package/ui/icons/icon-512.png +0 -0
- package/ui/icons/maskable-512.png +0 -0
- package/ui/icons.js +40 -0
- package/ui/inbox.js +535 -0
- package/ui/index.html +103 -0
- package/ui/machines.js +261 -0
- package/ui/manifest.webmanifest +16 -0
- package/ui/mosaic.js +189 -0
- package/ui/nav.js +141 -0
- package/ui/newteam.js +223 -0
- package/ui/org.js +653 -0
- package/ui/overlays.css +126 -0
- package/ui/palette.js +179 -0
- package/ui/people.js +370 -0
- package/ui/permissions.js +202 -0
- package/ui/qr.js +158 -0
- package/ui/router.js +171 -0
- package/ui/routes.js +46 -0
- package/ui/screen-boards.css +241 -0
- package/ui/screen-inbox.css +201 -0
- package/ui/screen-machines.css +76 -0
- package/ui/screen-mosaic.css +26 -0
- package/ui/screen-newteam.css +90 -0
- package/ui/screen-org.css +113 -0
- package/ui/screen-session.css +99 -0
- package/ui/screen-signin.css +28 -0
- package/ui/screen-team.css +80 -0
- package/ui/screen-teams.css +41 -0
- package/ui/session.js +42 -0
- package/ui/shell.css +122 -0
- package/ui/signin.js +120 -0
- package/ui/squads.js +370 -0
- package/ui/state.js +59 -0
- package/ui/stream.js +268 -0
- package/ui/styles.css +343 -0
- package/ui/team.js +115 -0
- package/ui/teams.js +58 -0
- package/ui/terminal.js +261 -0
- package/ui/theme.js +32 -0
- package/ui/timeline.js +163 -0
- package/ui/topbar.js +205 -0
- package/ui/voice-parse.js +98 -0
- package/ui/voice.js +320 -0
- package/vendor/InterVariable.woff2 +0 -0
- package/vendor/LICENSE-inter +92 -0
- package/vendor/LICENSE-xterm +21 -0
- package/vendor/README.md +8 -0
- package/vendor/addon-fit.js +2 -0
- package/vendor/xterm.css +218 -0
- package/vendor/xterm.js +2 -0
package/ui/qr.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// A QR code as an SVG (ISO 18004: bytes, error correction level M), so that an
|
|
2
|
+
// authenticator app can read a key with its camera. Written here because the
|
|
3
|
+
// dashboard loads nothing from outside, and a key must not go to any service.
|
|
4
|
+
|
|
5
|
+
// Per version: [error codewords per block, [blocks, data codewords in each]...].
|
|
6
|
+
const BLOCKS = [
|
|
7
|
+
null,
|
|
8
|
+
[10, [1, 16]], [16, [1, 28]], [26, [1, 44]], [18, [2, 32]], [24, [2, 43]], [16, [4, 27]],
|
|
9
|
+
[18, [4, 31]], [22, [2, 38], [2, 39]], [22, [3, 36], [2, 37]], [26, [4, 43], [1, 44]],
|
|
10
|
+
[30, [1, 50], [4, 51]], [22, [6, 36], [2, 37]],
|
|
11
|
+
]
|
|
12
|
+
const ALIGNMENT = [null, [], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58]]
|
|
13
|
+
|
|
14
|
+
// Arithmetic in GF(256).
|
|
15
|
+
const EXP = new Uint8Array(512), LOG = new Uint8Array(256)
|
|
16
|
+
for (let i = 0, x = 1; i < 255; i++) {
|
|
17
|
+
EXP[i] = x
|
|
18
|
+
LOG[x] = i
|
|
19
|
+
x = x << 1 ^ (x & 0x80 ? 0x11d : 0)
|
|
20
|
+
}
|
|
21
|
+
for (let i = 255; i < 512; i++) EXP[i] = EXP[i - 255]
|
|
22
|
+
const mul = (a, b) => (a && b ? EXP[LOG[a] + LOG[b]] : 0)
|
|
23
|
+
|
|
24
|
+
function errorCodewords(data, count) {
|
|
25
|
+
let gen = [1]
|
|
26
|
+
for (let i = 0; i < count; i++) {
|
|
27
|
+
const next = new Array(gen.length + 1).fill(0)
|
|
28
|
+
gen.forEach((c, j) => { next[j] ^= c; next[j + 1] ^= mul(c, EXP[i]) })
|
|
29
|
+
gen = next
|
|
30
|
+
}
|
|
31
|
+
const rest = [...data, ...new Array(count).fill(0)]
|
|
32
|
+
for (let i = 0; i < data.length; i++) {
|
|
33
|
+
const f = rest[i]
|
|
34
|
+
if (f) for (let j = 0; j < gen.length; j++) rest[i + j] ^= mul(gen[j], f)
|
|
35
|
+
}
|
|
36
|
+
return rest.slice(data.length)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// The bytes, with padding, split in blocks with their error codes, interleaved.
|
|
40
|
+
function codewords(bytes, version) {
|
|
41
|
+
const [ec, ...groups] = BLOCKS[version]
|
|
42
|
+
const capacity = groups.reduce((n, [blocks, size]) => n + blocks * size, 0)
|
|
43
|
+
let bits = '0100' + bytes.length.toString(2).padStart(version < 10 ? 8 : 16, '0')
|
|
44
|
+
for (const b of bytes) bits += b.toString(2).padStart(8, '0')
|
|
45
|
+
bits += '0'.repeat(Math.min(4, capacity * 8 - bits.length))
|
|
46
|
+
bits += '0'.repeat((8 - bits.length % 8) % 8)
|
|
47
|
+
const data = bits.match(/.{8}/g).map(x => parseInt(x, 2))
|
|
48
|
+
for (let pad = 0xec; data.length < capacity; pad ^= 0xec ^ 0x11) data.push(pad)
|
|
49
|
+
const blocks = []
|
|
50
|
+
let at = 0
|
|
51
|
+
for (const [count, size] of groups) for (let i = 0; i < count; i++) { blocks.push(data.slice(at, at + size)); at += size }
|
|
52
|
+
const errors = blocks.map(b => errorCodewords(b, ec))
|
|
53
|
+
const out = []
|
|
54
|
+
for (let i = 0; i < Math.max(...blocks.map(b => b.length)); i++) for (const b of blocks) if (i < b.length) out.push(b[i])
|
|
55
|
+
for (let i = 0; i < ec; i++) for (const e of errors) out.push(e[i])
|
|
56
|
+
return out
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const MASKS = [
|
|
60
|
+
(r, c) => (r + c) % 2 === 0, r => r % 2 === 0, (r, c) => c % 3 === 0, (r, c) => (r + c) % 3 === 0,
|
|
61
|
+
(r, c) => (Math.floor(r / 2) + Math.floor(c / 3)) % 2 === 0, (r, c) => r * c % 2 + r * c % 3 === 0,
|
|
62
|
+
(r, c) => (r * c % 2 + r * c % 3) % 2 === 0, (r, c) => ((r + c) % 2 + r * c % 3) % 2 === 0,
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
function bch(value, generator, bits) {
|
|
66
|
+
const top = g => 31 - Math.clz32(g)
|
|
67
|
+
let rest = value << bits
|
|
68
|
+
while (rest && top(rest) >= top(generator)) rest ^= generator << (top(rest) - top(generator))
|
|
69
|
+
return value << bits | rest
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function draw(version, words, mask) {
|
|
73
|
+
const n = version * 4 + 17
|
|
74
|
+
const grid = Array.from({ length: n }, () => new Array(n).fill(null))
|
|
75
|
+
const set = (r, c, on) => { if (r >= 0 && c >= 0 && r < n && c < n) grid[r][c] = on }
|
|
76
|
+
const finder = (r, c) => {
|
|
77
|
+
for (let i = -1; i <= 7; i++) {
|
|
78
|
+
for (let j = -1; j <= 7; j++) {
|
|
79
|
+
const ring = i >= 0 && i <= 6 && (j === 0 || j === 6) || j >= 0 && j <= 6 && (i === 0 || i === 6)
|
|
80
|
+
set(r + i, c + j, ring || i >= 2 && i <= 4 && j >= 2 && j <= 4)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
finder(0, 0); finder(0, n - 7); finder(n - 7, 0)
|
|
85
|
+
for (let i = 8; i < n - 8; i++) { set(6, i, i % 2 === 0); set(i, 6, i % 2 === 0) }
|
|
86
|
+
// (Everywhere but where the finders are: also over the timing lines.)
|
|
87
|
+
const last = ALIGNMENT[version].at(-1)
|
|
88
|
+
for (const r of ALIGNMENT[version]) {
|
|
89
|
+
for (const c of ALIGNMENT[version]) {
|
|
90
|
+
if (r === 6 && c === 6 || r === 6 && c === last || r === last && c === 6) continue
|
|
91
|
+
for (let i = -2; i <= 2; i++) for (let j = -2; j <= 2; j++) set(r + i, c + j, Math.max(Math.abs(i), Math.abs(j)) !== 1)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Level M, and this mask.
|
|
95
|
+
const format = bch(mask, 0x537, 10) ^ 0x5412
|
|
96
|
+
const bit = (v, i) => (v >> i & 1) === 1
|
|
97
|
+
for (let i = 0; i < 15; i++) {
|
|
98
|
+
set(i < 6 ? i : i < 8 ? i + 1 : n - 15 + i, 8, bit(format, i))
|
|
99
|
+
set(8, i < 8 ? n - 1 - i : i === 8 ? 7 : 14 - i, bit(format, i))
|
|
100
|
+
}
|
|
101
|
+
set(n - 8, 8, true)
|
|
102
|
+
if (version >= 7) {
|
|
103
|
+
const info = bch(version, 0x1f25, 12)
|
|
104
|
+
for (let i = 0; i < 18; i++) {
|
|
105
|
+
set(Math.floor(i / 3), n - 11 + i % 3, bit(info, i))
|
|
106
|
+
set(n - 11 + i % 3, Math.floor(i / 3), bit(info, i))
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const stream = words.flatMap(w => Array.from({ length: 8 }, (_, i) => bit(w, 7 - i)))
|
|
110
|
+
let at = 0
|
|
111
|
+
for (let right = n - 1, up = true; right > 0; right -= 2, up = !up) {
|
|
112
|
+
if (right === 6) right--
|
|
113
|
+
for (let k = 0; k < n; k++) {
|
|
114
|
+
const r = up ? n - 1 - k : k
|
|
115
|
+
for (const c of [right, right - 1]) {
|
|
116
|
+
if (grid[r][c] !== null) continue
|
|
117
|
+
grid[r][c] = (stream[at++] ?? false) !== MASKS[mask](r, c)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return grid
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// How hard it is to read, by the four rules of the standard: the lowest wins.
|
|
125
|
+
function penalty(grid) {
|
|
126
|
+
const n = grid.length
|
|
127
|
+
let score = 0
|
|
128
|
+
const line = get => {
|
|
129
|
+
let run = 1
|
|
130
|
+
for (let i = 1; i < n; i++) {
|
|
131
|
+
if (get(i) === get(i - 1)) { if (++run === 5) score += 3; else if (run > 5) score++ } else run = 1
|
|
132
|
+
}
|
|
133
|
+
const text = Array.from({ length: n }, (_, i) => (get(i) ? '1' : '0')).join('')
|
|
134
|
+
score += 40 * ((text.match(/(?=10111010000)/g)?.length ?? 0) + (text.match(/(?=00001011101)/g)?.length ?? 0))
|
|
135
|
+
}
|
|
136
|
+
let dark = 0
|
|
137
|
+
for (let i = 0; i < n; i++) { line(j => grid[i][j]); line(j => grid[j][i]) }
|
|
138
|
+
for (let r = 0; r < n; r++) {
|
|
139
|
+
for (let c = 0; c < n; c++) {
|
|
140
|
+
if (grid[r][c]) dark++
|
|
141
|
+
if (r < n - 1 && c < n - 1 && grid[r][c] === grid[r + 1][c] && grid[r][c] === grid[r][c + 1] && grid[r][c] === grid[r + 1][c + 1]) score += 3
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return score + 10 * Math.floor(Math.abs(dark * 100 / (n * n) - 50) / 5)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// The code as an SVG, or null if the text doesn't fit (then the key is typed).
|
|
148
|
+
export function qrSvg(text, label = 'QR') {
|
|
149
|
+
const bytes = [...new TextEncoder().encode(text)]
|
|
150
|
+
const version = BLOCKS.findIndex((b, v) => v && bytes.length + (v < 10 ? 2 : 3) <= b.slice(1).reduce((s, [count, size]) => s + count * size, 0))
|
|
151
|
+
if (version < 1) return null
|
|
152
|
+
const words = codewords(bytes, version)
|
|
153
|
+
const grid = MASKS.map((_, m) => draw(version, words, m)).reduce((best, g) => (penalty(g) < penalty(best) ? g : best))
|
|
154
|
+
const n = grid.length
|
|
155
|
+
let path = ''
|
|
156
|
+
grid.forEach((row, r) => row.forEach((on, c) => { if (on) path += `M${c + 4} ${r + 4}h1v1h-1z` }))
|
|
157
|
+
return `<svg class="qr" viewBox="0 0 ${n + 8} ${n + 8}" role="img" aria-label="${label}" shape-rendering="crispEdges"><rect width="100%" height="100%" fill="#fff"/><path d="${path}" fill="#000"/></svg>`
|
|
158
|
+
}
|
package/ui/router.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { $, store } from './dom.js'
|
|
2
|
+
import { T, COLLATOR } from './i18n.js'
|
|
3
|
+
import { state, sessions, unread, can, companyPref } from './state.js'
|
|
4
|
+
import { dur, now, esc } from './format.js'
|
|
5
|
+
import { sortedSessions, squadOpen } from './content.js'
|
|
6
|
+
import { ChatView } from './chat.js'
|
|
7
|
+
import { setHtml, renderNav } from './nav.js'
|
|
8
|
+
import { personaTag, sessionTerm, renderTop } from './topbar.js'
|
|
9
|
+
import { buildMosaic, renderArchived } from './mosaic.js'
|
|
10
|
+
import { renderInbox } from './inbox.js'
|
|
11
|
+
import { renderTeams } from './teams.js'
|
|
12
|
+
import { renderBoards } from './boards.js'
|
|
13
|
+
import { renderTeam } from './team.js'
|
|
14
|
+
import { renderSessionAside } from './session.js'
|
|
15
|
+
import { renderNewTeam } from './newteam.js'
|
|
16
|
+
import { renderAddMachine } from './addmachine.js'
|
|
17
|
+
import { closeMenu } from './dialogs.js'
|
|
18
|
+
import { renderHosts } from './machines.js'
|
|
19
|
+
import { hideOrgTip, renderOrg } from './org.js'
|
|
20
|
+
import { TermView } from './terminal.js'
|
|
21
|
+
import { Timeline } from './timeline.js'
|
|
22
|
+
import { icon } from './icons.js'
|
|
23
|
+
import { parseRoute, dec } from './routes.js'
|
|
24
|
+
import { trackNavigation } from './back.js'
|
|
25
|
+
|
|
26
|
+
// views
|
|
27
|
+
export let mosaicPanes = new Map() // name -> {pane, view}
|
|
28
|
+
|
|
29
|
+
export { dec }
|
|
30
|
+
|
|
31
|
+
// Set once the user moves around the dashboard (not on the page it opened on).
|
|
32
|
+
export let navigatedInApp = false
|
|
33
|
+
|
|
34
|
+
// (A real click or key here, not a URL change made from outside.)
|
|
35
|
+
// (Inside the app itself: typing the token on the login page doesn't count.)
|
|
36
|
+
for (const ev of ['click', 'keydown']) document.addEventListener(ev, e => { if (e.isTrusted && !$('app').hidden && e.target.closest?.('#app')) navigatedInApp = true }, true)
|
|
37
|
+
|
|
38
|
+
export const currentRoute = () => parseRoute(location.hash)
|
|
39
|
+
|
|
40
|
+
export function clearMosaic() {
|
|
41
|
+
for (const p of mosaicPanes.values()) p.view.destroy()
|
|
42
|
+
mosaicPanes.clear()
|
|
43
|
+
state.mosaicKey = null
|
|
44
|
+
$('mosaic').innerHTML = ''
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// A worker's state in a coordinator's team: what it is doing, and for how long.
|
|
48
|
+
function workerState(w) {
|
|
49
|
+
const a = w.activity ?? {}
|
|
50
|
+
if (!w.online) return { k: 'offline', dot: '', text: T.wOffline }
|
|
51
|
+
if (a.state === 'waiting') return { k: 'waiting', dot: 'warn pulse', text: T.wWaiting }
|
|
52
|
+
if (a.state === 'compacting') return { k: 'working', dot: 'info pulse', text: T.compacting }
|
|
53
|
+
if (a.state === 'tool' || a.state === 'working') return { k: 'working', dot: 'ok pulse', text: T.wWorking(dur(now() - ((a.state === 'tool' ? a.tool?.since : a.since) ?? now()))), since: a.since }
|
|
54
|
+
return { k: 'idle', dot: 'ok', text: T.wIdle(a.since ? dur(now() - a.since) : '—'), since: a.since ?? now() }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// A coordinator's team: who waits for a permission, who is idle (longest
|
|
58
|
+
// first: ready for more work), who works, who is gone.
|
|
59
|
+
export function teamStrip(c) {
|
|
60
|
+
const ws = sortedSessions().filter(s => s.role !== 'coordinator' && s.coordinator === c.name).map(w => ({ w, st: workerState(w) }))
|
|
61
|
+
const rank = { waiting: 0, idle: 1, working: 2, offline: 3 }
|
|
62
|
+
ws.sort((a, b) => (rank[a.st.k] - rank[b.st.k]) || ((a.st.since ?? 0) - (b.st.since ?? 0)) || COLLATOR.compare(a.w.name, b.w.name))
|
|
63
|
+
const n = k => ws.filter(x => x.st.k === k).length
|
|
64
|
+
const chips = ws.map(({ w, st }) => `<span class="wchip ${st.k}"><button class="wname" data-go="#/s/${encodeURIComponent(w.name)}"><span class="dot ${st.dot}"></span>${esc(w.name)}</button>${personaTag(w.persona)}<span class="wst">${esc(st.text)}</span>${st.k === 'idle' ? `<button class="give" data-givework="${esc(c.name)}" title="${esc(T.giveWorkTitle(w.name, c.name))}">${T.giveWork}</button>` : ''}</span>`).join('')
|
|
65
|
+
return `<div class="team-sum">${ws.length ? esc(T.teamSummary(ws.length, n('working'), n('idle'), n('waiting'))) : T.noWorkers}</div>
|
|
66
|
+
<div class="team-list">${chips}${can('operator') ? `<button class="btn addw" data-addworker="${esc(c.name)}" title="${esc(T.addWorkerTo(c.name))}">${T.addWorker}</button>` : ''}</div>`
|
|
67
|
+
}
|
|
68
|
+
export function refreshLeads() {
|
|
69
|
+
if (currentRoute().view !== 'leads') return
|
|
70
|
+
for (const [name, p] of mosaicPanes) { const s = sessions.get(name); const el = p.pane.querySelector('.team'); if (s && el) setHtml(el, teamStrip(s)) }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// "Give work": straight to the coordinator's terminal, ready to type (nothing typed for you).
|
|
74
|
+
export function giveWork(coord) {
|
|
75
|
+
const p = mosaicPanes.get(coord)
|
|
76
|
+
if (p?.kind === 'term' && p.view.x) { p.pane.scrollIntoView?.({ block: 'nearest' }); p.view.x.focus() }
|
|
77
|
+
else location.hash = `#/s/${encodeURIComponent(coord)}`
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A session's terminal, as it is, and beside it what it is doing and what
|
|
81
|
+
// mattered (folded unless chosen otherwise on a phone, where it would cover it).
|
|
82
|
+
function mountSessionTerm(host, name) {
|
|
83
|
+
if (state.termView?.host === host && state.termView.term === name && state.timeline) return
|
|
84
|
+
state.termView?.destroy()
|
|
85
|
+
state.timeline?.destroy()
|
|
86
|
+
const kept = store.get(companyPref('pishaTlFolded'))
|
|
87
|
+
const folded = kept ? kept === '1' : matchMedia('(max-width: 900px)').matches
|
|
88
|
+
$('terminal').innerHTML = `<div class="tv${folded ? ' folded' : ''}"><div class="tv-term"></div><aside class="tv-aside" aria-label="${esc(T.tlAside(name))}"><button type="button" class="icon-btn tv-fold" data-tvfold aria-expanded="${!folded}" aria-label="${esc(folded ? T.tlShow : T.tlHide)}" title="${esc(folded ? T.tlShow : T.tlHide)}">${icon('chevron', folded ? 'flip' : '')}</button><div class="tv-body"></div></aside></div>`
|
|
89
|
+
state.termView = new TermView(host, name, $('terminal').querySelector('.tv-term'))
|
|
90
|
+
state.timeline = new Timeline(name, $('terminal').querySelector('.tv-body'))
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function route() {
|
|
94
|
+
const r = currentRoute()
|
|
95
|
+
closeMenu()
|
|
96
|
+
// Going to a worker unfolds its squad in the sidebar, so it shows where you are.
|
|
97
|
+
const c = r.view === 'session' && sessions.get(r.name)?.role === 'worker' ? sessions.get(r.name).coordinator : null
|
|
98
|
+
if (c && squadOpen[c] === false) { squadOpen[c] = true; store.set(companyPref('pishaSquads'), JSON.stringify(squadOpen)) }
|
|
99
|
+
$('archived').hidden = r.view !== 'archived'
|
|
100
|
+
$('inbox').hidden = r.view !== 'inbox'
|
|
101
|
+
$('teams').hidden = r.view !== 'teams'
|
|
102
|
+
$('boards').hidden = r.view !== 'boards' && r.view !== 'board'
|
|
103
|
+
$('team').hidden = r.view !== 'team'
|
|
104
|
+
$('newteam').hidden = r.view !== 'newteam'
|
|
105
|
+
$('addmachine').hidden = r.view !== 'addmachine'
|
|
106
|
+
$('org').hidden = r.view !== 'org'
|
|
107
|
+
hideOrgTip()
|
|
108
|
+
$('hosts').hidden = r.view !== 'hosts'
|
|
109
|
+
const st = sessionTerm(r)
|
|
110
|
+
// (The timeline beside a conversation goes with it.)
|
|
111
|
+
if (state.chatTimeline && !(r.view === 'session' && !st && state.chatTimeline.name === r.name)) { state.chatTimeline.destroy(); state.chatTimeline = null }
|
|
112
|
+
const termMode = r.view === 'terminal' || !!st
|
|
113
|
+
$('terminal').hidden = !termMode
|
|
114
|
+
if (!termMode && state.termView) { state.termView.destroy(); state.termView = null; $('terminal').innerHTML = '' }
|
|
115
|
+
// (A terminal of a session opened there has its panel too; any other, none.)
|
|
116
|
+
const ofSession = r.view === 'terminal' && sessions.get(r.term)?.host_id === r.host
|
|
117
|
+
if ((!termMode || (r.view === 'terminal' && !ofSession)) && state.timeline) { state.timeline.destroy(); state.timeline = null }
|
|
118
|
+
if (r.view === 'hosts' || r.view === 'terminal') {
|
|
119
|
+
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
|
120
|
+
clearMosaic()
|
|
121
|
+
$('session').hidden = true
|
|
122
|
+
$('mosaic').hidden = true
|
|
123
|
+
if (r.view === 'hosts') renderHosts(r.host)
|
|
124
|
+
else if (ofSession) mountSessionTerm(r.host, r.term)
|
|
125
|
+
else if (!state.termView || state.termView.host !== r.host || state.termView.term !== r.term || state.termView.root !== $('terminal')) {
|
|
126
|
+
state.termView?.destroy()
|
|
127
|
+
state.termView = new TermView(r.host, r.term, $('terminal'))
|
|
128
|
+
}
|
|
129
|
+
} else if (r.view === 'mosaic' || r.view === 'leads') {
|
|
130
|
+
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
|
131
|
+
$('session').hidden = true
|
|
132
|
+
$('mosaic').hidden = false
|
|
133
|
+
buildMosaic()
|
|
134
|
+
} else if (r.view === 'archived' || r.view === 'org' || r.view === 'inbox' || r.view === 'teams' || r.view === 'boards' || r.view === 'board' || r.view === 'team' || r.view === 'newteam' || r.view === 'addmachine') {
|
|
135
|
+
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
|
136
|
+
clearMosaic()
|
|
137
|
+
$('session').hidden = true
|
|
138
|
+
$('mosaic').hidden = true
|
|
139
|
+
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 === 'team') renderTeam(); else if (r.view === 'newteam') renderNewTeam(); else if (r.view === 'addmachine') renderAddMachine(); else renderArchived()
|
|
140
|
+
} else if (st) {
|
|
141
|
+
// The session's live terminal, as in Machines: watch it and type to it.
|
|
142
|
+
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
|
143
|
+
clearMosaic()
|
|
144
|
+
$('mosaic').hidden = true
|
|
145
|
+
$('session').hidden = true
|
|
146
|
+
mountSessionTerm(st.host.id, r.name)
|
|
147
|
+
unread.delete(r.name)
|
|
148
|
+
} else {
|
|
149
|
+
clearMosaic()
|
|
150
|
+
$('mosaic').hidden = true
|
|
151
|
+
$('session').hidden = false
|
|
152
|
+
if (!state.sessionView || state.sessionView.name !== r.name) {
|
|
153
|
+
state.sessionView?.destroy()
|
|
154
|
+
state.sessionView = new ChatView(r.name, { full: true })
|
|
155
|
+
// The conversation, and beside it the team and where it runs.
|
|
156
|
+
$('session').innerHTML = '<div class="sv"><div class="sv-thread"></div><aside class="sv-aside"><div class="sv-info"></div><div class="sv-tl"></div></aside></div>'
|
|
157
|
+
$('session').querySelector('.sv-thread').appendChild(state.sessionView.el)
|
|
158
|
+
$('session').querySelector('.sv-aside').setAttribute('aria-label', r.name)
|
|
159
|
+
state.chatTimeline?.destroy()
|
|
160
|
+
state.chatTimeline = new Timeline(r.name, $('session').querySelector('.sv-tl'), { now: false })
|
|
161
|
+
}
|
|
162
|
+
renderSessionAside()
|
|
163
|
+
unread.delete(r.name)
|
|
164
|
+
}
|
|
165
|
+
renderTop()
|
|
166
|
+
renderNav()
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// (Only while signed in: a link opened on the login page doesn't load views, or ask the server with no token.)
|
|
170
|
+
// (Every step counts for the back button, before the view is drawn.)
|
|
171
|
+
window.addEventListener('hashchange', () => { trackNavigation(); if (state.me && !$('app').hidden) route() })
|
package/ui/routes.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// What an address in the dashboard points to. (Pure: the back button reads
|
|
2
|
+
// the ones it came from with it too.)
|
|
3
|
+
|
|
4
|
+
export const dec = v => { try { return decodeURIComponent(v) } catch { return v } }
|
|
5
|
+
|
|
6
|
+
// Names in the address are only ever session names and machine ids: any
|
|
7
|
+
// other text (a crafted link) goes to the main view, never into the header.
|
|
8
|
+
const ROUTE_NAME = /^[A-Za-z0-9_-]{1,32}$/
|
|
9
|
+
const ROUTE_ID = /^[A-Za-z0-9_-]{1,64}$/
|
|
10
|
+
export function parseRoute(hash) {
|
|
11
|
+
// The inbox is home: what needs you comes first.
|
|
12
|
+
if (hash === '' || hash === '#' || hash === '#/' || hash === '#/inbox') return { view: 'inbox' }
|
|
13
|
+
// One entry of it picked: a question or result (i12), a permission (p<name>), a name to approve (a<name>).
|
|
14
|
+
// What is done is its own tab, with its own entries.
|
|
15
|
+
if (hash === '#/inbox/done') return { view: 'inbox', tab: 'done' }
|
|
16
|
+
if (hash === '#/inbox/running') return { view: 'inbox', tab: 'running' }
|
|
17
|
+
const ib = hash.match(/^#\/inbox\/(done\/)?([ipa][A-Za-z0-9_-]{1,64})$/)
|
|
18
|
+
if (ib) return ib[1] ? { view: 'inbox', tab: 'done', item: ib[2] } : { view: 'inbox', item: ib[2] }
|
|
19
|
+
if (hash === '#/teams') return { view: 'teams' }
|
|
20
|
+
// The task boards; one of them, with a task open beside it (or a new one).
|
|
21
|
+
if (hash === '#/boards') return { view: 'boards' }
|
|
22
|
+
const bd = hash.match(/^#\/b\/(\d{1,9})(?:\/(new|[A-Za-z][A-Za-z0-9]{0,5}-\d{1,9}))?$/)
|
|
23
|
+
if (bd) return { view: 'board', board: Number(bd[1]), ...(bd[2] ? { task: bd[2] } : {}) }
|
|
24
|
+
if (hash === '#/new') return { view: 'newteam' }
|
|
25
|
+
if (hash === '#/mosaic') return { view: 'mosaic' }
|
|
26
|
+
if (hash === '#/archived') return { view: 'archived' }
|
|
27
|
+
if (hash === '#/hosts') return { view: 'hosts' }
|
|
28
|
+
if (hash === '#/hosts/new') return { view: 'addmachine' }
|
|
29
|
+
if (hash === '#/c') return { view: 'leads' }
|
|
30
|
+
if (hash === '#/org') return { view: 'org' }
|
|
31
|
+
// A team: its page, or every session of it live.
|
|
32
|
+
const ql = hash.match(/^#\/q\/([^/]+)\/live$/)
|
|
33
|
+
if (ql) return ROUTE_NAME.test(dec(ql[1])) ? { view: 'mosaic', squad: dec(ql[1]) } : { view: 'teams' }
|
|
34
|
+
const q = hash.match(/^#\/q\/([^/]+)$/)
|
|
35
|
+
if (q) return ROUTE_NAME.test(dec(q[1])) ? { view: 'team', squad: dec(q[1]) } : { view: 'teams' }
|
|
36
|
+
const h = hash.match(/^#\/h\/(.+)$/)
|
|
37
|
+
if (h) return ROUTE_ID.test(dec(h[1])) ? { view: 'hosts', host: dec(h[1]) } : { view: 'hosts' }
|
|
38
|
+
const t = hash.match(/^#\/t\/([^/]+)\/(.+)$/)
|
|
39
|
+
if (t) return ROUTE_ID.test(dec(t[1])) && ROUTE_NAME.test(dec(t[2])) ? { view: 'terminal', host: dec(t[1]), term: dec(t[2]) } : { view: 'hosts' }
|
|
40
|
+
// A session: its live terminal when it has one (opened on a machine
|
|
41
|
+
// from here), else its chat; ".../chat" always the chat.
|
|
42
|
+
const sc = hash.match(/^#\/s\/([^/]+)\/chat$/)
|
|
43
|
+
if (sc) return ROUTE_NAME.test(dec(sc[1])) ? { view: 'session', name: dec(sc[1]), chat: true } : { view: 'mosaic' }
|
|
44
|
+
const m = hash.match(/^#\/s\/(.+)$/)
|
|
45
|
+
return m && ROUTE_NAME.test(dec(m[1])) ? { view: 'session', name: dec(m[1]) } : { view: 'mosaic' }
|
|
46
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* Task boards: the list of them, one board in columns or as a list, and the
|
|
2
|
+
task open beside it. Colours only from the tokens: a label's colour is one
|
|
3
|
+
of the states' (see --c below). */
|
|
4
|
+
|
|
5
|
+
#boards { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
|
|
6
|
+
|
|
7
|
+
/* What each category and each label colour is. */
|
|
8
|
+
[data-cat="backlog"] { --c: var(--idle); }
|
|
9
|
+
[data-cat="unstarted"] { --c: var(--muted); }
|
|
10
|
+
[data-cat="started"] { --c: var(--info); }
|
|
11
|
+
[data-cat="review"] { --c: var(--warn); }
|
|
12
|
+
[data-cat="done"] { --c: var(--ok); }
|
|
13
|
+
[data-cat="closed"] { --c: var(--line-2); }
|
|
14
|
+
[data-color="gray"] { --c: var(--muted); }
|
|
15
|
+
[data-color="blue"] { --c: var(--info); }
|
|
16
|
+
[data-color="green"] { --c: var(--ok); }
|
|
17
|
+
[data-color="yellow"] { --c: var(--warn); }
|
|
18
|
+
[data-color="orange"] { --c: var(--accent); }
|
|
19
|
+
[data-color="red"] { --c: var(--err); }
|
|
20
|
+
[data-color="purple"] { --c: var(--coord); }
|
|
21
|
+
[data-color="pink"] { --c: var(--worker); }
|
|
22
|
+
|
|
23
|
+
.lbl {
|
|
24
|
+
display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border-radius: var(--r-pill);
|
|
25
|
+
font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; color: var(--c);
|
|
26
|
+
background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
|
|
27
|
+
}
|
|
28
|
+
.lbl.type { border-radius: var(--r-sm); }
|
|
29
|
+
.bd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; margin-right: 6px; vertical-align: middle; }
|
|
30
|
+
.bd-id { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
|
|
31
|
+
.bd-pending { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 600; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); white-space: nowrap; }
|
|
32
|
+
.bd-prio { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
|
|
33
|
+
.bd-prio[data-p="2"] { color: var(--info); }
|
|
34
|
+
.bd-prio[data-p="3"] { color: var(--warn); }
|
|
35
|
+
.bd-prio[data-p="4"] { color: var(--err); }
|
|
36
|
+
.bd-due { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
|
|
37
|
+
.bd-due.late { color: var(--err); font-weight: 600; }
|
|
38
|
+
.bd-ncom { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
|
|
39
|
+
.bd-parent { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
|
|
40
|
+
.bd-subs-n { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
41
|
+
.bd-subs-n.all { color: var(--ok); }
|
|
42
|
+
.bd-who { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: var(--fs-xs); color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
|
|
43
|
+
.bd-who.bd-agent { font-family: var(--mono); }
|
|
44
|
+
.bd-who .ic { width: 13px; height: 13px; }
|
|
45
|
+
.ic.up { transform: rotate(-90deg); }
|
|
46
|
+
|
|
47
|
+
/* --- the list of boards --- */
|
|
48
|
+
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; padding: 20px; max-width: 1600px; }
|
|
49
|
+
.bl { flex: 1; min-height: 0; overflow-y: auto; }
|
|
50
|
+
.bl-sec { margin: 8px 20px -8px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
|
|
51
|
+
.bl-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; color: inherit; text-decoration: none; transition: border-color var(--t-fast) var(--ease); }
|
|
52
|
+
.bl-card:hover { border-color: var(--line-2); }
|
|
53
|
+
.bl-card.archived { opacity: .7; }
|
|
54
|
+
.bl-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
|
|
55
|
+
.bl-h b { font-size: var(--fs-md); font-weight: 600; margin-right: auto; }
|
|
56
|
+
.bl-desc { margin: 0; font-size: var(--fs-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
57
|
+
.bl-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: var(--fs-sm); color: var(--muted); }
|
|
58
|
+
.bl-bar { display: flex; height: 4px; border-radius: var(--r-pill); overflow: hidden; background: var(--raised); }
|
|
59
|
+
.bl-bar span { background: var(--c); }
|
|
60
|
+
#boards .empty { min-height: 60vh; justify-content: center; }
|
|
61
|
+
#boards .empty span { max-width: 420px; }
|
|
62
|
+
|
|
63
|
+
/* --- one board --- */
|
|
64
|
+
.bd { flex: 1; min-height: 0; display: flex; }
|
|
65
|
+
.bd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
66
|
+
.bd-fbar { flex: none; }
|
|
67
|
+
.bd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
|
|
68
|
+
.bd-filters .input { height: 32px; width: auto; min-width: 0; }
|
|
69
|
+
.bd-filters input[type=search] { flex: 1 1 200px; max-width: 320px; }
|
|
70
|
+
.bd-filters select { flex: 0 1 180px; }
|
|
71
|
+
.bd-onlypending { margin: 0; align-items: center; }
|
|
72
|
+
.bd-onlypending input { margin-top: 0; }
|
|
73
|
+
.bd-view { flex: 1; min-height: 0; overflow: auto; }
|
|
74
|
+
.bd-empty { padding: 32px 20px; text-align: center; color: var(--muted); }
|
|
75
|
+
|
|
76
|
+
.bd-cols { display: flex; gap: 12px; align-items: flex-start; min-height: 100%; padding: 16px 20px; width: max-content; min-width: 100%; }
|
|
77
|
+
.bd-col { width: 280px; flex: none; display: flex; flex-direction: column; max-height: 100%; background: var(--tray); border: 0; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--t-fast) ease, background-color var(--t-fast) ease; }
|
|
78
|
+
.bd-col.over { background: color-mix(in srgb, var(--info) 6%, var(--tray)); box-shadow: 0 0 0 1.5px var(--info); }
|
|
79
|
+
.bd-col-h { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px 12px; }
|
|
80
|
+
.bd-col-h h2 { margin: 0; font-size: var(--fs-sm); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
81
|
+
.bd-count { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
|
|
82
|
+
.bd-step { margin: -4px 12px 8px; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
83
|
+
.bd-step[title] { cursor: help; }
|
|
84
|
+
.field .bd-step { margin: 4px 0 0; white-space: normal; }
|
|
85
|
+
.bd-col-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; min-height: 40px; }
|
|
86
|
+
|
|
87
|
+
.bd-card { display: flex; flex-direction: column; gap: 6px; padding: 11px 12px; background: var(--panel); border: 0; border-radius: var(--r-md); box-shadow: var(--shadow-card); cursor: pointer; transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
|
|
88
|
+
.bd-card:hover { box-shadow: var(--shadow-card-hover); }
|
|
89
|
+
.bd-card.on { box-shadow: 0 0 0 1.5px var(--text), 0 8px 20px -10px rgba(0, 0, 0, .28); }
|
|
90
|
+
.bd-card.dragging { opacity: .45; }
|
|
91
|
+
.bd-card[draggable="true"] { cursor: grab; }
|
|
92
|
+
.bd-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
|
|
93
|
+
.bd-title { color: var(--text); text-decoration: none; font-size: var(--fs-md); line-height: 1.35; overflow-wrap: anywhere; }
|
|
94
|
+
.bd-title:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
|
|
95
|
+
.bd-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
|
|
96
|
+
|
|
97
|
+
.bd-tablewrap { padding: 8px 20px 20px; }
|
|
98
|
+
.bd-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
|
99
|
+
.bd-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--bg); }
|
|
100
|
+
.bd-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
|
|
101
|
+
.bd-table td .lbl + .lbl { margin-left: 4px; }
|
|
102
|
+
.bd-table tr[data-task] { cursor: pointer; }
|
|
103
|
+
.bd-table tr[data-task]:hover td, .bd-table tr.on td { background: var(--raised); }
|
|
104
|
+
.bd-table .bd-who { margin-left: 0; }
|
|
105
|
+
|
|
106
|
+
/* --- the task open beside it --- */
|
|
107
|
+
.bd-panel[hidden] { display: none; }
|
|
108
|
+
.bd-panel { width: min(460px, 42vw); flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); min-height: 0; }
|
|
109
|
+
.bd-panel-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
|
|
110
|
+
.bd-panel-h .grow { flex: 1; }
|
|
111
|
+
.bd-gh { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
|
|
112
|
+
a.bd-gh:hover { color: var(--text); }
|
|
113
|
+
.bd-ghsec p { margin: 0 0 6px; }
|
|
114
|
+
.bd-ghstate a { color: var(--text); font-weight: 600; }
|
|
115
|
+
.bd-ghacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
|
|
116
|
+
.bd-panel-h .bd-id { font-size: var(--fs-sm); }
|
|
117
|
+
.bd-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
|
|
118
|
+
.bd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
|
|
119
|
+
.bd-labels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s3); padding: 0; border: 0; }
|
|
120
|
+
.bd-labels legend { font-size: var(--fs-md); font-weight: 500; color: var(--text); margin-bottom: 6px; padding: 0; }
|
|
121
|
+
.bd-lpick { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
|
|
122
|
+
.bd-lpick input { accent-color: var(--info); }
|
|
123
|
+
.bd-form .actions { display: flex; justify-content: flex-end; gap: var(--s2); }
|
|
124
|
+
.bd-form .actions .danger { margin-right: auto; }
|
|
125
|
+
.bd-form .err, .bd-cform .err { color: var(--err); font-size: var(--fs-sm); }
|
|
126
|
+
.bd-form .err:empty, .bd-cform .err:empty { display: none; }
|
|
127
|
+
.bd-pending-hint { color: var(--warn); }
|
|
128
|
+
|
|
129
|
+
.bd-up { display: block; margin: 0 0 12px; font-size: var(--fs-sm); color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
130
|
+
.bd-up:hover { color: var(--text); }
|
|
131
|
+
.bd-subsec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
|
|
132
|
+
.bd-subsec h3 { margin: 0 0 10px; font-size: var(--fs-md); font-weight: 600; }
|
|
133
|
+
.bd-subs { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
|
|
134
|
+
.bd-subs li { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; cursor: pointer; font-size: var(--fs-sm); }
|
|
135
|
+
.bd-subs li + li { border-top: 1px solid var(--line); }
|
|
136
|
+
.bd-subs li:hover { background: var(--panel-2); }
|
|
137
|
+
.bd-subs .bd-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
138
|
+
.bd-subs .grow { flex: 1; }
|
|
139
|
+
.bd-subs .bd-who { margin-left: 0; }
|
|
140
|
+
.bd-comsec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
|
|
141
|
+
.bd-edited { font-size: var(--fs-xs); color: var(--muted); font-style: italic; }
|
|
142
|
+
/* Pull requests: their state in GitHub's colours, from the tokens. */
|
|
143
|
+
[data-pr="open"] { --pr: var(--ok); }
|
|
144
|
+
[data-pr="draft"] { --pr: var(--muted); }
|
|
145
|
+
[data-pr="merged"] { --pr: var(--coord); }
|
|
146
|
+
[data-pr="closed"] { --pr: var(--err); }
|
|
147
|
+
.bd-pr-tag { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); color: var(--pr); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
148
|
+
.bd-pr-tag svg { width: 13px; height: 13px; }
|
|
149
|
+
.bd-prsec { margin-bottom: 16px; }
|
|
150
|
+
.bd-prsec h3 { margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
|
|
151
|
+
.bd-prs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
|
|
152
|
+
.bd-prs li { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; font-size: var(--fs-sm); min-width: 0; }
|
|
153
|
+
.bd-prs li + li { border-top: 1px solid var(--line); }
|
|
154
|
+
.bd-prs a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
|
|
155
|
+
.bd-prs a:hover { text-decoration: underline; }
|
|
156
|
+
.bd-prs .grow { flex: 1; }
|
|
157
|
+
.bd-pr-ic { display: inline-flex; flex: none; color: var(--pr); }
|
|
158
|
+
.bd-pr-ic svg { width: 16px; height: 16px; }
|
|
159
|
+
.bd-pr-st { flex: none; font-size: var(--fs-xs); color: var(--pr); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; white-space: nowrap; }
|
|
160
|
+
.bd-pr-rv { flex: none; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
|
|
161
|
+
.bd-pr-rv[data-rv="approved"] { color: var(--ok); }
|
|
162
|
+
.bd-pr-rv[data-rv="changes"] { color: var(--err); }
|
|
163
|
+
.bd-comsec h3 { margin: 0 0 10px; font-size: var(--fs-md); font-weight: 600; }
|
|
164
|
+
.bd-coms { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
|
|
165
|
+
.bd-com { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); }
|
|
166
|
+
.bd-com-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-xs); color: var(--muted); }
|
|
167
|
+
.bd-com-h b { color: var(--text); font-size: var(--fs-sm); }
|
|
168
|
+
.bd-com p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); }
|
|
169
|
+
.bd-cform textarea { width: 100%; margin-bottom: 8px; }
|
|
170
|
+
.bd-cform .check { margin-bottom: 8px; }
|
|
171
|
+
.bd-cform .actions { display: flex; justify-content: flex-end; }
|
|
172
|
+
.bd-hist { margin-top: 16px; font-size: var(--fs-sm); }
|
|
173
|
+
.bd-hist summary { cursor: pointer; color: var(--muted); }
|
|
174
|
+
.bd-hist ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
|
|
175
|
+
.bd-hist li span { color: var(--muted); }
|
|
176
|
+
|
|
177
|
+
/* --- settings and dialogs --- */
|
|
178
|
+
.bd-teams { border: 0; margin: 0 0 var(--s3); padding: 0; }
|
|
179
|
+
.bd-teams legend { font-size: var(--fs-md); font-weight: 500; color: var(--text); margin-bottom: 6px; padding: 0; }
|
|
180
|
+
.bd-teams .check { margin-bottom: 6px; }
|
|
181
|
+
.bd-teams .hint { display: block; font-size: var(--fs-sm); color: var(--muted); }
|
|
182
|
+
.bd-edit { margin: 0 0 var(--s4); }
|
|
183
|
+
.bd-edit h4 { margin: 0 0 4px; font-size: var(--fs-sm); font-weight: 600; }
|
|
184
|
+
.bd-edit .dim-note { margin: 0 0 8px; font-size: var(--fs-sm); }
|
|
185
|
+
.bd-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
|
|
186
|
+
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 190px) auto auto; gap: 6px; align-items: center; }
|
|
187
|
+
.bd-row .input { height: 32px; }
|
|
188
|
+
.bd-prefix input { max-width: 140px; text-transform: uppercase; font-family: var(--mono); }
|
|
189
|
+
.modal .bd-set-actions { flex-wrap: wrap; position: sticky; bottom: calc(-1 * var(--s5)); margin: var(--s4) calc(-1 * var(--s5)) calc(-1 * var(--s5)); padding: 12px var(--s5) var(--s5); background: var(--panel); border-top: 1px solid var(--line); }
|
|
190
|
+
.bd-set-actions .grow { flex: 1; }
|
|
191
|
+
.bd-notify-list { margin: 8px 0; padding-left: 18px; font-size: var(--fs-sm); }
|
|
192
|
+
.bd-notify-list ul { margin: 4px 0 8px; padding-left: 16px; }
|
|
193
|
+
|
|
194
|
+
@media (max-width: 900px) {
|
|
195
|
+
.bl-grid { padding: 12px; gap: 12px; }
|
|
196
|
+
.bl-sec { margin: 8px 12px -4px; }
|
|
197
|
+
.bd-filters { padding: 10px 12px; }
|
|
198
|
+
.bd-filters input[type=search] { max-width: none; flex-basis: 100%; }
|
|
199
|
+
.bd-filters select { flex: 1 1 140px; }
|
|
200
|
+
/* One column at a time, swiped sideways (inside the board, never the page). */
|
|
201
|
+
.bd-cols { padding: 12px; scroll-snap-type: x mandatory; }
|
|
202
|
+
.bd-view:has(.bd-cols) { scroll-snap-type: x mandatory; }
|
|
203
|
+
.bd-col { width: calc(100vw - 48px); max-width: 340px; scroll-snap-align: start; }
|
|
204
|
+
.bd-tablewrap { padding: 8px 12px 16px; }
|
|
205
|
+
.bd-table th:nth-child(4), .bd-table td:nth-child(4), .bd-table th:nth-child(5), .bd-table td:nth-child(5), .bd-table th:nth-child(7), .bd-table td:nth-child(7) { display: none; }
|
|
206
|
+
/* The task over the whole screen, above the tab bar. */
|
|
207
|
+
.bd-panel { position: fixed; inset: 0 0 calc(58px + env(safe-area-inset-bottom)) 0; z-index: 30; width: auto; border-left: 0; }
|
|
208
|
+
.bd-grid2 { grid-template-columns: 1fr; }
|
|
209
|
+
.bd-row { grid-template-columns: minmax(0, 1fr) minmax(0, 120px) auto auto; }
|
|
210
|
+
.bd-card { min-height: 44px; }
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* The trash: deleted tasks, each with its restore button. */
|
|
214
|
+
.bd-trash { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
|
|
215
|
+
.bd-trash li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
|
|
216
|
+
.bd-trash li + li { border-top: 1px solid var(--line); }
|
|
217
|
+
.bd-trash .grow { flex: 1; min-width: 0; }
|
|
218
|
+
.bd-trash-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
|
|
219
|
+
.bd-trash .dim-note { margin-top: 2px; font-size: var(--fs-xs); }
|
|
220
|
+
.bd-trash .btn { flex: none; }
|
|
221
|
+
.bd-trash-body { max-height: 60vh; overflow-y: auto; }
|
|
222
|
+
|
|
223
|
+
/* The board's state with GitHub, in its header. */
|
|
224
|
+
.bd-ghstat { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
|
|
225
|
+
.bd-ghstat .bd-ghtext { overflow: hidden; text-overflow: ellipsis; }
|
|
226
|
+
.bd-ghstat.err .bd-ghtext { color: var(--err); }
|
|
227
|
+
.bd-gherr { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
|
|
228
|
+
.bd-ghnow { width: 28px; height: 28px; }
|
|
229
|
+
.bd-ghnow .ic { width: 16px; height: 16px; }
|
|
230
|
+
.bd-ghstat.busy .bd-ghnow .ic { animation: bd-spin 1s linear infinite; }
|
|
231
|
+
@keyframes bd-spin { to { transform: rotate(360deg); } }
|
|
232
|
+
@media (prefers-reduced-motion: reduce) { .bd-ghstat.busy .bd-ghnow .ic { animation: none; } }
|
|
233
|
+
@media (max-width: 900px) { .bd-ghstat .long { display: none; } }
|
|
234
|
+
|
|
235
|
+
/* A task's people: their initials, overlapping a little. */
|
|
236
|
+
.bd-ppl-tag { display: inline-flex; align-items: center; margin-left: auto; }
|
|
237
|
+
.bd-card-foot .bd-who + .bd-ppl-tag { margin-left: 4px; }
|
|
238
|
+
.bd-av { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--panel); background: var(--panel-2); color: var(--text); font-size: 10px; font-weight: 600; line-height: 1; }
|
|
239
|
+
.bd-av + .bd-av { margin-left: -6px; }
|
|
240
|
+
.bd-av.more { color: var(--muted); }
|
|
241
|
+
.bd-subs .bd-ppl-tag { margin-left: 0; }
|