mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-07 18:52:54 +00:00
select span
This commit is contained in:
parent
9f1094ff2d
commit
a4309e3933
@ -34,6 +34,7 @@ interface TraceState {
|
|||||||
conditions: Recordable;
|
conditions: Recordable;
|
||||||
traceSpanLogs: Recordable[];
|
traceSpanLogs: Recordable[];
|
||||||
selectorStore: Recordable;
|
selectorStore: Recordable;
|
||||||
|
selectedSpan: Recordable<Span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const traceStore = defineStore({
|
export const traceStore = defineStore({
|
||||||
@ -45,6 +46,7 @@ export const traceStore = defineStore({
|
|||||||
traceList: [],
|
traceList: [],
|
||||||
traceSpans: [],
|
traceSpans: [],
|
||||||
currentTrace: {},
|
currentTrace: {},
|
||||||
|
selectedSpan: {},
|
||||||
conditions: {
|
conditions: {
|
||||||
queryDuration: useAppStoreWithOut().durationTime,
|
queryDuration: useAppStoreWithOut().durationTime,
|
||||||
traceState: "ALL",
|
traceState: "ALL",
|
||||||
@ -64,6 +66,9 @@ export const traceStore = defineStore({
|
|||||||
setTraceSpans(spans: Span[]) {
|
setTraceSpans(spans: Span[]) {
|
||||||
this.traceSpans = spans;
|
this.traceSpans = spans;
|
||||||
},
|
},
|
||||||
|
setSelectedSpan(span: Span) {
|
||||||
|
this.selectedSpan = span;
|
||||||
|
},
|
||||||
resetState() {
|
resetState() {
|
||||||
this.traceSpans = [];
|
this.traceSpans = [];
|
||||||
this.traceList = [];
|
this.traceList = [];
|
||||||
|
@ -126,7 +126,6 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleSelectSpan(i: Recordable) {
|
function handleSelectSpan(i: Recordable) {
|
||||||
console.log(i);
|
|
||||||
const spans = [];
|
const spans = [];
|
||||||
const refSpans = [];
|
const refSpans = [];
|
||||||
parentSpans.value = [];
|
parentSpans.value = [];
|
||||||
|
@ -47,7 +47,7 @@ limitations under the License. -->
|
|||||||
:key="`key${index}`"
|
:key="`key${index}`"
|
||||||
:type="type"
|
:type="type"
|
||||||
:headerType="headerType"
|
:headerType="headerType"
|
||||||
@select="selectItem"
|
@click="selectItem()"
|
||||||
/>
|
/>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
@ -55,6 +55,7 @@ limitations under the License. -->
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
|
import { useTraceStore } from "@/store/modules/trace";
|
||||||
import type { Span } from "@/types/trace";
|
import type { Span } from "@/types/trace";
|
||||||
import TableItem from "./TableItem.vue";
|
import TableItem from "./TableItem.vue";
|
||||||
import { ProfileConstant, TraceConstant, StatisticsConstant } from "./data";
|
import { ProfileConstant, TraceConstant, StatisticsConstant } from "./data";
|
||||||
@ -69,6 +70,7 @@ limitations under the License. -->
|
|||||||
traceId: { type: String, default: "" },
|
traceId: { type: String, default: "" },
|
||||||
});
|
});
|
||||||
const emits = defineEmits(["select"]);
|
const emits = defineEmits(["select"]);
|
||||||
|
const traceStore = useTraceStore();
|
||||||
const method = ref<number>(300);
|
const method = ref<number>(300);
|
||||||
const componentKey = ref<number>(300);
|
const componentKey = ref<number>(300);
|
||||||
const flag = ref<boolean>(true);
|
const flag = ref<boolean>(true);
|
||||||
@ -103,9 +105,8 @@ limitations under the License. -->
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
function selectItem(span: Span) {
|
function selectItem() {
|
||||||
console.log(span);
|
emits("select", traceStore.selectedSpan);
|
||||||
emits("select", span);
|
|
||||||
}
|
}
|
||||||
function sortStatistics(key: string) {
|
function sortStatistics(key: string) {
|
||||||
const element = props.tableData;
|
const element = props.tableData;
|
||||||
|
@ -133,7 +133,6 @@ limitations under the License. -->
|
|||||||
:data="child"
|
:data="child"
|
||||||
:type="type"
|
:type="type"
|
||||||
:headerType="headerType"
|
:headerType="headerType"
|
||||||
@select="selectedItem(child)"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="showDetail" :destroy-on-close="true" fullscreen @closed="showDetail = false">
|
<el-dialog v-model="showDetail" :destroy-on-close="true" fullscreen @closed="showDetail = false">
|
||||||
@ -148,6 +147,7 @@ limitations under the License. -->
|
|||||||
import SpanDetail from "../D3Graph/SpanDetail.vue";
|
import SpanDetail from "../D3Graph/SpanDetail.vue";
|
||||||
import { dateFormat } from "@/utils/dateFormat";
|
import { dateFormat } from "@/utils/dateFormat";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
import { useTraceStore } from "@/store/modules/trace";
|
||||||
import { Themes } from "@/constants/data";
|
import { Themes } from "@/constants/data";
|
||||||
import { TraceGraphType } from "../constant";
|
import { TraceGraphType } from "../constant";
|
||||||
import { WidgetType } from "@/views/dashboard/data";
|
import { WidgetType } from "@/views/dashboard/data";
|
||||||
@ -163,10 +163,10 @@ limitations under the License. -->
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "TableItem",
|
name: "TableItem",
|
||||||
props,
|
props,
|
||||||
emits: ["select"],
|
|
||||||
components: { SpanDetail },
|
components: { SpanDetail },
|
||||||
setup(props, { emit }) {
|
setup(props) {
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
|
const traceStore = useTraceStore();
|
||||||
const displayChildren = ref<boolean>(true);
|
const displayChildren = ref<boolean>(true);
|
||||||
const showDetail = ref<boolean>(false);
|
const showDetail = ref<boolean>(false);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -223,12 +223,13 @@ limitations under the License. -->
|
|||||||
viewSpanDetail(dom);
|
viewSpanDetail(dom);
|
||||||
}
|
}
|
||||||
function viewSpan(event: Recordable) {
|
function viewSpan(event: Recordable) {
|
||||||
|
showDetail.value = true;
|
||||||
const dom = event.composedPath().find((d: Recordable) => d.className.includes("trace-item"));
|
const dom = event.composedPath().find((d: Recordable) => d.className.includes("trace-item"));
|
||||||
emit("select", props.data);
|
selectedItem(props.data);
|
||||||
viewSpanDetail(dom);
|
viewSpanDetail(dom);
|
||||||
}
|
}
|
||||||
function selectedItem(data: Recordable) {
|
function selectedItem(span: Recordable) {
|
||||||
emit("select", data);
|
traceStore.setSelectedSpan(span);
|
||||||
}
|
}
|
||||||
function viewSpanDetail(dom: HTMLSpanElement) {
|
function viewSpanDetail(dom: HTMLSpanElement) {
|
||||||
showSelectSpan(dom);
|
showSelectSpan(dom);
|
||||||
|
Loading…
Reference in New Issue
Block a user