integrate logs in job #18
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proc#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
show right new panel, which shows logs (same output as in log tab but less width ofc)
when we select a job, we see the log coming right away and being refreshed, so its very easy to see the logs
use the prefix filter for that, all local logging has predefined prefix
hero_collab_ui.hero_collab_ui
is the $service.$action name which can indeed like here be the same
Implementation Spec for Issue #18 — Integrate Logs in Job Panel
Objective
When a user selects a job in the Jobs tab, a new right-side log panel slides in alongside the existing detail panel. It shows live-refreshing log output filtered by the job's source prefix (e.g.
hero_collab_ui.hero_collab_ui), usinglogs.filterwith the job'sactionfield as thesrcpattern.Architecture Summary
logs.filterwithsrc: 'hero_collab_ui.hero_collab_ui*'already worksFiles to Modify
crates/hero_proc_ui/templates/index.html#jobs-log-panelHTML element inside Jobs tab.main-containercrates/hero_proc_ui/static/css/dashboard.css.job-log-panelCSS (slide-in panel, 340px width, responsive hide)crates/hero_proc_ui/static/js/dashboard.jsopenJobLogPanel(),fetchJobLogs(),stopJobLogPolling(),closeJobLogPanel(); wire intoviewJob(),closePanel(),switchTab()Implementation Plan
Step 1: Add Log Panel HTML (index.html)
Add
#jobs-log-paneldiv after the existing#jobs-detailpanel inside.main-container. Contains header with source label + live dot + close button, and a.logs-containerbody.Dependencies: none
Step 2: Add CSS for Job Log Panel (dashboard.css)
Add
.job-log-panelstyles: flex column,width: 0→var(--log-panel-width, 340px)when.open, border-left, responsive hide at 1200px.Dependencies: Step 1
Step 3: Add JavaScript Functions (dashboard.js)
Add
openJobLogPanel(src),fetchJobLogs(),stopJobLogPolling(),closeJobLogPanel(). WireopenJobLogPanel(j.action)intoviewJob(),closeJobLogPanel()intoclosePanel('jobs'),stopJobLogPolling()intoswitchTab().Dependencies: Steps 1 & 2
Acceptance Criteria
<action>*(e.g.hero_collab_ui.hero_collab_ui*)Notes
actionfield on a Job (e.g.hero_collab_ui.hero_collab_ui) is used directly as the logsrcprefix pattern with*appendedTest Results
Failed Tests
crates/hero_proc_integration_test/src/harness.rs - harness (line 14)— doc test compile failureThe doc example in
harness.rsusesTestHarnesswithout importing it and uses.awaitoutside anasyncblock. The compiler suggests adding:and the example needs to be wrapped in an
asynccontext (e.g.#[tokio::main]ortokio::test).Warnings (non-blocking)
hero_proc_lib: unused importpartition_pathindb/logs/store.rshero_proc_integration_test: unused fieldtimestampinstress.rshero_proc_integration_tests: unused importSinkExtinpty.rs; unused functionsadd_loop_serviceandadd_dependent_serviceinservice_management.rshero_proc_integration_tests: unused functionshell_escapeinfixtures.rsStatus: ❌ Some tests failed
Run:
cargo test -p hero_proc_integration_test --docto reproduce the failing doc test.Implementation Complete
Changes Made
Approach: Logs are shown at the bottom of the existing job detail sidebar (not a new panel), avoiding two vertical sidebars.
Files Modified:
crates/hero_proc_ui/static/js/dashboard.jsjob.logsfetch fromviewJob()#jobs-log-container(300px scrollable) at bottom of detail panel contentstartJobLogPolling(src),stopJobLogPolling(),fetchJobLogs()— pollslogs.filterwithaction + '*'every 2sstartJobLogPolling(j.action)intoviewJob()stopJobLogPolling()intoclosePanel('jobs')andswitchTab()crates/hero_proc_ui/static/css/dashboard.css.job-log-live-dot— animated green dot indicator shown when polling is activeBehavior
<action>*(e.g.hero_collab_ui.hero_collab_ui*)Test Results
harness.rsunrelated to this change)Implementation committed:
0dd7a92Browse:
0dd7a92