web: unify mobile back and audit controls and link pipeline run history
This commit is contained in:
@@ -200,6 +200,19 @@ function renderRunToolbar() {
|
||||
h("span", { class: "spacer" }),
|
||||
renderAttentionBell(),
|
||||
);
|
||||
const pipelineId = state.runFilters.pipelineId;
|
||||
if (pipelineId != null) {
|
||||
const name = state.pipelines.find((pipeline) => pipeline.id === pipelineId)?.name ??
|
||||
state.runs.find((run) => run.pipeline_id === pipelineId)?.name ?? `Pipeline ${pipelineId}`;
|
||||
const chip = h("button", {
|
||||
class: "pipeline-filter-chip",
|
||||
type: "button",
|
||||
"aria-label": `Clear pipeline filter: ${name}`,
|
||||
title: `Showing only ${name}`,
|
||||
onclick: () => setPipelineFilter(null),
|
||||
}, h("span", { text: name }), h("span", { "aria-hidden": "true", text: "×" }));
|
||||
toolbar.insertBefore(chip, toolbar.querySelector(".spacer"));
|
||||
}
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
@@ -302,6 +315,7 @@ function toggleStatusFilter(status) {
|
||||
|
||||
function setPipelineFilter(pipelineId) {
|
||||
state.runFilters = { ...state.runFilters, pipelineId };
|
||||
if (state.selectedRunId == null) rt.pushRoute(pipelineId == null ? { kind: "runs" } : { kind: "runs", pipelineId });
|
||||
closeMenu();
|
||||
}
|
||||
|
||||
@@ -312,6 +326,7 @@ function setTimeRangeFilter(timeRange) {
|
||||
|
||||
function clearRunFilters() {
|
||||
state.runFilters = defaultRunFilters();
|
||||
if (state.selectedRunId == null) rt.pushRoute({ kind: "runs" });
|
||||
closeMenu();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user