mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-06-29 17:47:35 +00:00
update
This commit is contained in:
parent
0eafac510f
commit
ba2b457768
@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { defineStore } from "pinia";
|
||||
import type { Option } from "@/types/app";
|
||||
import type {
|
||||
AsyncProfilingTask,
|
||||
AsyncProfileTaskCreationRequest,
|
||||
|
@ -54,3 +54,15 @@ type AsyncProfilerTaskLog = {
|
||||
operationType: string;
|
||||
operationTime: number;
|
||||
};
|
||||
|
||||
export type StackElement = {
|
||||
id: string;
|
||||
originId: string;
|
||||
name: string;
|
||||
parentId: string;
|
||||
codeSignature: string;
|
||||
total: number;
|
||||
self: number;
|
||||
value: number;
|
||||
children?: StackElement[];
|
||||
};
|
||||
|
1
src/types/profile.d.ts
vendored
1
src/types/profile.d.ts
vendored
@ -43,6 +43,7 @@ export interface TaskListItem {
|
||||
logs: TaskLog[];
|
||||
errorInstanceIds: string[];
|
||||
successInstanceIds: string[];
|
||||
serviceInstanceIds: string[];
|
||||
}
|
||||
export interface SegmentSpan {
|
||||
spanId: string;
|
||||
|
@ -15,7 +15,7 @@ limitations under the License. -->
|
||||
<template>
|
||||
<div class="flex-h header">
|
||||
<div class="title">Async Profiling</div>
|
||||
<el-button class="mr-20" size="small" @click="() => (newTask = true)">
|
||||
<el-button class="mr-20" size="small" type="primary" @click="() => (newTask = true)">
|
||||
{{ t("newTask") }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
@ -89,9 +89,9 @@ limitations under the License. -->
|
||||
ElMessage.error(res.errors);
|
||||
return;
|
||||
}
|
||||
const { tip } = res.data;
|
||||
if (tip) {
|
||||
ElMessage.error(tip);
|
||||
const { errorReason } = res.data;
|
||||
if (errorReason) {
|
||||
ElMessage.error(errorReason);
|
||||
return;
|
||||
}
|
||||
emits("close");
|
||||
|
@ -27,12 +27,12 @@ limitations under the License. -->
|
||||
@click="changeTask(i)"
|
||||
:key="index"
|
||||
:class="{
|
||||
selected: asyncProfilingStore.selectedTask && asyncProfilingStore.selectedTask.id === i.id,
|
||||
selected: asyncProfilingStore.selectedTask.id === i.id,
|
||||
}"
|
||||
>
|
||||
<td class="profile-td">
|
||||
<div class="ell">
|
||||
<span>{{ i.endpointName }}</span>
|
||||
<span>{{ i.id }}</span>
|
||||
<a class="profile-btn r" @click="viewTaskDetail($event, i)">
|
||||
<Icon iconName="view" size="middle" />
|
||||
</a>
|
||||
@ -52,7 +52,7 @@ limitations under the License. -->
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="showDetail" :destroy-on-close="true" fullscreen @closed="showDetail = false">
|
||||
<div class="profile-detail flex-v" v-if="asyncProfilingStore.selectedTask">
|
||||
<div class="profile-detail flex-v" v-if="asyncProfilingStore.selectedTask.id">
|
||||
<div>
|
||||
<h5 class="mb-10">{{ t("task") }}.</h5>
|
||||
<div class="mb-10 clear item">
|
||||
@ -65,7 +65,7 @@ limitations under the License. -->
|
||||
</div>
|
||||
<div class="mb-10 clear item">
|
||||
<span class="g-sm-4 grey">{{ t("instances") }}:</span>
|
||||
<span class="g-sm-8 wba">{{ asyncProfilingStore.selectedTask.serviceInstanceIds.join(", ") }}</span>
|
||||
<span class="g-sm-8 wba">{{ instances.map((d) => d.label).join(", ") }}</span>
|
||||
</div>
|
||||
<div class="mb-10 clear item">
|
||||
<span class="g-sm-4 grey">{{ t("execArgs") }}:</span>
|
||||
@ -137,13 +137,14 @@ limitations under the License. -->
|
||||
import type { TaskLog, TaskListItem } from "@/types/profile";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { dateFormat } from "@/utils/dateFormat";
|
||||
import type { Instance } from "@/types/selector";
|
||||
import type { Instance, Service } from "@/types/selector";
|
||||
|
||||
const { t } = useI18n();
|
||||
const asyncProfilingStore = useAsyncProfilingStore();
|
||||
const selectorStore = useSelectorStore();
|
||||
const showDetail = ref<boolean>(false);
|
||||
const service = ref<string>("");
|
||||
const instances = ref<Instance[]>([]);
|
||||
const instanceLogs = ref<TaskLog | any>({});
|
||||
const errorInstances = ref<Instance[]>([]);
|
||||
const successInstances = ref<Instance[]>([]);
|
||||
@ -155,6 +156,9 @@ limitations under the License. -->
|
||||
async function fetchTasks() {
|
||||
const res = await asyncProfilingStore.getTaskList();
|
||||
if (res.errors) {
|
||||
return ElMessage.error(res.errors);
|
||||
}
|
||||
if (res.data.errorReason) {
|
||||
ElMessage.error(res.errors);
|
||||
}
|
||||
}
|
||||
@ -167,7 +171,10 @@ limitations under the License. -->
|
||||
e.stopPropagation();
|
||||
showDetail.value = true;
|
||||
asyncProfilingStore.setSelectedTask(item);
|
||||
service.value = (selectorStore.services.filter((s: any) => s.id === item.serviceId)[0] || {}).label;
|
||||
service.value = (selectorStore.services.filter((s: Service) => s.id === item.serviceId)[0] || {}).label;
|
||||
instances.value = asyncProfilingStore.instances.filter((d: Instance) =>
|
||||
item.serviceInstanceIds.includes(d.id || ""),
|
||||
);
|
||||
const res = await asyncProfilingStore.getTaskLogs({ taskId: item.id });
|
||||
|
||||
if (res.errors) {
|
||||
|
Loading…
Reference in New Issue
Block a user