logViewerController
The browser half of the log viewer.
import { logViewerController } from "@sdxc/ui/app";Set up job2s
Current runner version: '2.321.0'
Operating System
Ubuntu 24.04.1 LTS
Runner Image: ubuntu-24.04
Install dependencies14s
Run bun install --frozen-lockfile
bun install v1.3.2
Resolving dependencies
Resolved, downloaded and extracted [412]
+ vitest@4.1.11
+ typescript@6.0.3
412 packages installed [13.82s]
Run tests41s
bun run test --reporter=dot
RUN v4.1.11 /home/runner/work/delta/delta
✓ src/lexer/chars.test.ts (18 tests) 6ms
✓ src/lexer/tokens.test.ts (42 tests) 11ms
✗ src/lexer/identifier.test.ts (9 tests | 1 failed) 9ms
× reads an identifier that starts with a Unicode letter
✓ src/parser/expression.test.ts (64 tests) 23ms
FAIL src/lexer/identifier.test.ts > reads an identifier that starts with a Unicode letter
AssertionError: expected undefined to deeply equal { kind: 'identifier', value: 'ñandú' }
❯ src/lexer/identifier.test.ts:27:41
Test Files 1 failed | 3 passed (4)
Tests 1 failed | 132 passed (133)
Process completed with exit code 1.
Upload coverage
Complete job1s
Cleaning up orphan processes
View code
// LogViewer's controller island carries logViewerController(), which searches every step and follows new lines.
<LogViewer
steps={job.steps}
lineHref={(step, n) => `#step:${step}:${n}`}
timestamps={showTimes}
timestampsHref={showTimes ? "?" : "?ts=1"}
labels={{
log: "Job log",
states: { success: "Succeeded", failure: "Failed", running: "In progress", queued: "Queued", skipped: "Skipped", cancelled: "Cancelled" },
search: "Search logs",
matches: "{index} of {count}",
noMatches: "No results",
previousMatch: "Previous match",
nextMatch: "Next match",
showTimestamps: "Show timestamps",
hideTimestamps: "Hide timestamps",
jumpToLatest: "Jump to latest",
refresh: "Refresh",
}}
/>Usage
Wires the LogViewer the host sits in: search over every line, each live step's stream, and
following the tail; it all detaches when the host unmounts.
Signature
logViewerController(options: LogViewerBehavior.Options): MixinDescriptor<HTMLElement>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | LogViewerBehavior.Options | Yes | The counter's copy. |
Examples
<div hidden mix={[logViewerController({ matches: "{index} of {count}", noMatches: "No results" })]} />Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/app too.
Type
LogViewerBehavior.Options
Plain data only, since the options cross into the browser with the viewer's island.
type LogViewerBehavior.Options = {
/** The counter, with `{index}` and `{count}` replaced. */
matches: string;
/** Shown in place of the counter when nothing matches. */
noMatches: string;
}