Merge branch 'main' of github.com:apache/skywalking-booster-ui into feat/async-profile

This commit is contained in:
Fine 2024-11-25 09:47:14 +08:00
commit bdf12cee62
4 changed files with 33 additions and 28 deletions

View File

@ -16,18 +16,22 @@
*/ */
import { ElNotification } from "element-plus"; import { ElNotification } from "element-plus";
export default (value: string): void => {
const input = document.createElement("input"); export default (text: string): void => {
input.value = value; navigator.clipboard
document.body.appendChild(input); .writeText(text)
input.select(); .then(() => {
if (document.execCommand("Copy")) { ElNotification({
document.execCommand("Copy"); title: "Success",
} message: "Copied",
input.remove(); type: "success",
ElNotification({ });
title: "Success", })
message: "Copied", .catch((err) => {
type: "success", ElNotification({
}); title: "Error",
message: err,
type: "warning",
});
});
}; };

View File

@ -88,7 +88,7 @@ limitations under the License. -->
const index = isNaN(item.activedTabIndex) ? 0 : item.activedTabIndex; const index = isNaN(item.activedTabIndex) ? 0 : item.activedTabIndex;
widgets.push( widgets.push(
...item.children[index].children.filter( ...item.children[index].children.filter(
(d: LayoutConfig) => !ListChartTypes.includes(d.graph?.type || ""), (d: LayoutConfig) => d.type === WidgetType.Widget && !ListChartTypes.includes(d.graph?.type || ""),
), ),
); );
} }

View File

@ -302,37 +302,36 @@ export default class ListGraph {
) )
.attr("y", -2) .attr("y", -2)
.style("fill", (d: Recordable) => `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}`); .style("fill", (d: Recordable) => `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}`);
nodeEnter const nodeUpdate = nodeEnter.merge(node);
nodeUpdate
.transition() .transition()
.duration(400) .duration(400)
.attr("transform", (d: Recordable) => `translate(${d.y + 5},${d.x})`) .attr("transform", (d: Recordable) => `translate(${d.y + 5},${d.x})`)
.style("opacity", 1); .style("opacity", 1);
nodeEnter nodeUpdate
.append("circle") .append("circle")
.attr("r", appStore.theme === Themes.Dark ? 4 : 3) .attr("r", appStore.theme === Themes.Dark ? 4 : 3)
.style("cursor", "pointer") .style("cursor", "pointer")
.attr("stroke-width", appStore.theme === Themes.Dark ? 3 : 2.5) .attr("stroke-width", appStore.theme === Themes.Dark ? 3 : 2.5)
.attr("fill", (d: Recordable) => .style("fill", (d: Recordable) =>
d._children d._children ? `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}` : "#eee",
? `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}`
: appStore.theme === Themes.Dark
? "#eee"
: "rbga(0,0,0,0)",
) )
.style("stroke", (d: Recordable) => .style("stroke", (d: Recordable) =>
d.data.label === "TRACE_ROOT" ? "" : `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}`, d.data.label === "TRACE_ROOT" ? "" : `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}`,
) )
.on("click", (d: Recordable) => { .on("click", (event: any, d: Recordable) => {
event.stopPropagation();
if (d.data.children.length == 0) return;
this.click(d, this); this.click(d, this);
}); });
node nodeUpdate
.transition() .transition()
.duration(400) .duration(400)
.attr("transform", (d: Recordable) => `translate(${d.y + 3},${d.x})`) .attr("transform", (d: Recordable) => `translate(${d.y + 3},${d.x})`)
.style("opacity", 1) .style("opacity", 1)
.select("circle") .select("circle")
.attr("fill", (d: Recordable) => .style("fill", (d: Recordable) =>
d._children ? `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}` : "", d._children ? `${this.sequentialScale(this.list.indexOf(d.data.serviceCode))}` : "#eee",
); );
// Transition exiting nodes to the parent's new position. // Transition exiting nodes to the parent's new position.

View File

@ -294,7 +294,9 @@ export default class TraceMap {
d._children ? this.sequentialScale(this.list.indexOf(d.data.serviceCode)) : "#fff", d._children ? this.sequentialScale(this.list.indexOf(d.data.serviceCode)) : "#fff",
) )
.attr("cursor", "pointer") .attr("cursor", "pointer")
.on("click", (d: Recordable) => { .on("click", (event: any, d: Recordable) => {
event.stopPropagation();
if (d.data.children.length == 0) return;
click(d); click(d);
}); });
const nodeExit = node const nodeExit = node