mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 14:45:25 +00:00
fix: update trace detail
This commit is contained in:
parent
6e170e987a
commit
c23e24293b
@ -103,6 +103,7 @@ export const traceStore = defineStore({
|
|||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
this.getTraceSpans({ traceId: res.data.data.data.traces[0].traceIds[0] });
|
||||||
this.traceList = res.data.data.data.traces.map((d: Trace) => {
|
this.traceList = res.data.data.data.traces.map((d: Trace) => {
|
||||||
d.traceIds = d.traceIds.map((id: string) => {
|
d.traceIds = d.traceIds.map((id: string) => {
|
||||||
return { value: id, label: id };
|
return { value: id, label: id };
|
||||||
|
@ -18,7 +18,7 @@ limitations under the License. -->
|
|||||||
<span class="grey mr-5">{{ t("instance") }}:</span>
|
<span class="grey mr-5">{{ t("instance") }}:</span>
|
||||||
<Selector
|
<Selector
|
||||||
size="small"
|
size="small"
|
||||||
v-model="state.instance"
|
:value="state.instance"
|
||||||
:options="traceStore.instances"
|
:options="traceStore.instances"
|
||||||
placeholder="Select a instance"
|
placeholder="Select a instance"
|
||||||
@change="changeField('instance', $event)"
|
@change="changeField('instance', $event)"
|
||||||
@ -28,7 +28,7 @@ limitations under the License. -->
|
|||||||
<span class="grey mr-5">{{ t("endpoint") }}:</span>
|
<span class="grey mr-5">{{ t("endpoint") }}:</span>
|
||||||
<Selector
|
<Selector
|
||||||
size="small"
|
size="small"
|
||||||
v-model="state.endpoint"
|
:value="state.endpoint"
|
||||||
:options="traceStore.endpoints"
|
:options="traceStore.endpoints"
|
||||||
placeholder="Select a endpoint"
|
placeholder="Select a endpoint"
|
||||||
@change="changeField('endpoint', $event)"
|
@change="changeField('endpoint', $event)"
|
||||||
@ -38,7 +38,7 @@ limitations under the License. -->
|
|||||||
<span class="grey mr-5">{{ t("status") }}:</span>
|
<span class="grey mr-5">{{ t("status") }}:</span>
|
||||||
<Selector
|
<Selector
|
||||||
size="small"
|
size="small"
|
||||||
v-model="state.status"
|
:value="state.status"
|
||||||
:options="Status"
|
:options="Status"
|
||||||
placeholder="Select a status"
|
placeholder="Select a status"
|
||||||
@change="changeField('status', $event)"
|
@change="changeField('status', $event)"
|
||||||
|
@ -25,7 +25,7 @@ limitations under the License. -->
|
|||||||
<div class="selectors">
|
<div class="selectors">
|
||||||
<Selector
|
<Selector
|
||||||
size="small"
|
size="small"
|
||||||
v-model="traceStore.conditions.queryOrder"
|
:value="traceStore.conditions.queryOrder"
|
||||||
:options="QueryOrders"
|
:options="QueryOrders"
|
||||||
placeholder="Select a option"
|
placeholder="Select a option"
|
||||||
@change="changeSort"
|
@change="changeSort"
|
||||||
|
@ -29,7 +29,11 @@ limitations under the License. -->
|
|||||||
<div class="mb-5 blue sm">
|
<div class="mb-5 blue sm">
|
||||||
<Selector
|
<Selector
|
||||||
size="small"
|
size="small"
|
||||||
v-model="traceId"
|
:value="
|
||||||
|
traceStore.currentTrace.traceIds &&
|
||||||
|
traceStore.currentTrace.traceIds[0] &&
|
||||||
|
traceStore.currentTrace.traceIds[0].value
|
||||||
|
"
|
||||||
:options="traceStore.currentTrace.traceIds"
|
:options="traceStore.currentTrace.traceIds"
|
||||||
@change="changeTraceId"
|
@change="changeTraceId"
|
||||||
class="trace-detail-ids"
|
class="trace-detail-ids"
|
||||||
@ -44,9 +48,9 @@ limitations under the License. -->
|
|||||||
<div class="flex-h item">
|
<div class="flex-h item">
|
||||||
<div>
|
<div>
|
||||||
<div class="tag mr-5">{{ t("start") }}</div>
|
<div class="tag mr-5">{{ t("start") }}</div>
|
||||||
<span class="mr-15 sm">{{
|
<span class="mr-15 sm">
|
||||||
dateFormat(parseInt(traceStore.currentTrace.start))
|
{{ dateFormat(parseInt(traceStore.currentTrace.start)) }}
|
||||||
}}</span>
|
</span>
|
||||||
<div class="tag mr-5">{{ t("duration") }}</div>
|
<div class="tag mr-5">{{ t("duration") }}</div>
|
||||||
<span class="mr-15 sm">{{ traceStore.currentTrace.duration }} ms</span>
|
<span class="mr-15 sm">{{ traceStore.currentTrace.duration }} ms</span>
|
||||||
<div class="tag mr-5">{{ t("spans") }}</div>
|
<div class="tag mr-5">{{ t("spans") }}</div>
|
||||||
@ -91,9 +95,10 @@ limitations under the License. -->
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { ref } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useTraceStore } from "@/store/modules/trace";
|
import { useTraceStore } from "@/store/modules/trace";
|
||||||
|
import { Option } from "@/types/app";
|
||||||
import copy from "@/utils/copy";
|
import copy from "@/utils/copy";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -102,7 +107,11 @@ const traceId = ref<string>("");
|
|||||||
const displayMode = ref<string>("list");
|
const displayMode = ref<string>("list");
|
||||||
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
|
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
|
||||||
dayjs(date).format(pattern);
|
dayjs(date).format(pattern);
|
||||||
|
onMounted(() => {
|
||||||
|
if (traceStore.currentTrace.traceIds && traceStore.currentTrace.traceIds[0]) {
|
||||||
|
traceId.value = traceStore.currentTrace.traceIds[0].value;
|
||||||
|
}
|
||||||
|
});
|
||||||
function handleClick(ids: string[]) {
|
function handleClick(ids: string[]) {
|
||||||
let copyValue = null;
|
let copyValue = null;
|
||||||
if (ids.length === 1) {
|
if (ids.length === 1) {
|
||||||
@ -113,9 +122,9 @@ function handleClick(ids: string[]) {
|
|||||||
copy(copyValue);
|
copy(copyValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeTraceId(i: string) {
|
function changeTraceId(opt: Option[]) {
|
||||||
traceId.value = i;
|
traceId.value = opt[0].value;
|
||||||
traceStore.getTraceSpans({ traceId: i });
|
traceStore.getTraceSpans({ traceId: opt[0].value });
|
||||||
}
|
}
|
||||||
|
|
||||||
// function searchTraceLogs() {
|
// function searchTraceLogs() {
|
||||||
@ -160,7 +169,7 @@ function changeTraceId(i: string) {
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin: 0 10px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trace-log-btn {
|
.trace-log-btn {
|
||||||
|
Loading…
Reference in New Issue
Block a user