Merge branch 'main' into web-run-tabs
This commit is contained in:
@@ -22,6 +22,10 @@ import {
|
||||
sessionExportArtifact,
|
||||
viewerIndexByUrl,
|
||||
} from "./artifacts.js";
|
||||
import {
|
||||
PIPELINE_GRAPH_EMPTY,
|
||||
mount as mountGraph,
|
||||
} from "./graph.js";
|
||||
import {
|
||||
PIPELINE_SORTS,
|
||||
PIPELINE_DETAIL_TABS,
|
||||
@@ -134,6 +138,10 @@ const state = {
|
||||
pipelineSort: "server_order",
|
||||
pipelineMenu: null,
|
||||
pipelineTab: "summary",
|
||||
// The mounted workflow graph (P6) and whether its panel is expanded. The
|
||||
// handle is dropped on every re-render so its listeners can never leak.
|
||||
pipelineGraph: null,
|
||||
pipelineGraphExpanded: false,
|
||||
versionsExpanded: false,
|
||||
pipelinesLoaded: false,
|
||||
runsLoaded: false,
|
||||
@@ -253,6 +261,13 @@ function render() {
|
||||
}
|
||||
|
||||
function renderContent() {
|
||||
// The graph owns wheel/pointer/resize listeners; drop the previous mount
|
||||
// before rebuilding the DOM so a re-render, tab switch or view switch never
|
||||
// leaves an observer or listener behind.
|
||||
if (state.pipelineGraph) {
|
||||
state.pipelineGraph.unmount();
|
||||
state.pipelineGraph = null;
|
||||
}
|
||||
const nodes = [];
|
||||
if (state.error) {
|
||||
nodes.push(h("div", { class: "banner error" }, h("strong", { text: "Error: " }), state.error));
|
||||
@@ -561,6 +576,19 @@ function renderPipelineDetail() {
|
||||
);
|
||||
if (state.pipelineTab === "graph") {
|
||||
pane.append(h("p", { class: "graph-note muted", text: graphNote() }));
|
||||
const stages = d.graph?.stages ?? [];
|
||||
if (!stages.length) {
|
||||
pane.append(h("div", { class: "muted pad", text: PIPELINE_GRAPH_EMPTY }));
|
||||
return pane;
|
||||
}
|
||||
const host = h("div", { class: "graph-host" });
|
||||
pane.append(host);
|
||||
state.pipelineGraph = mountGraph(host, d.graph, {
|
||||
expanded: state.pipelineGraphExpanded,
|
||||
onExpandedChange: (value) => {
|
||||
state.pipelineGraphExpanded = value;
|
||||
},
|
||||
});
|
||||
return pane;
|
||||
}
|
||||
if (state.pipelineTab === "source") {
|
||||
|
||||
+1245
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user