mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 00:37:33 +00:00
add trace
This commit is contained in:
parent
9c34589f9a
commit
0db3e23aa5
@ -19,10 +19,20 @@ limitations under the License. -->
|
|||||||
<div class="tools" @click="associateMetrics">
|
<div class="tools" @click="associateMetrics">
|
||||||
{{ t("associateMetrics") }}
|
{{ t("associateMetrics") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="tools">
|
<div class="tools" @click="viewTrace">
|
||||||
{{ t("viewTrace") }}
|
{{ t("viewTrace") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<el-drawer
|
||||||
|
v-model="showTrace"
|
||||||
|
:title="t('trace')"
|
||||||
|
size="100%"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
:before-close="() => (showTrace = false)"
|
||||||
|
:append-to-body="true"
|
||||||
|
>
|
||||||
|
<Trace :data="traceOptions" />
|
||||||
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -40,6 +50,7 @@ import { useI18n } from "vue-i18n";
|
|||||||
import { EventParams } from "@/types/app";
|
import { EventParams } from "@/types/app";
|
||||||
import { useECharts } from "@/hooks/useEcharts";
|
import { useECharts } from "@/hooks/useEcharts";
|
||||||
import { addResizeListener, removeResizeListener } from "@/utils/event";
|
import { addResizeListener, removeResizeListener } from "@/utils/event";
|
||||||
|
import Trace from "@/views/dashboard/controls/Trace.vue";
|
||||||
|
|
||||||
/*global Nullable, defineProps, defineEmits*/
|
/*global Nullable, defineProps, defineEmits*/
|
||||||
const emits = defineEmits(["select"]);
|
const emits = defineEmits(["select"]);
|
||||||
@ -51,6 +62,10 @@ const { setOptions, resize, getInstance } = useECharts(
|
|||||||
chartRef as Ref<HTMLDivElement>
|
chartRef as Ref<HTMLDivElement>
|
||||||
);
|
);
|
||||||
const currentParams = ref<Nullable<EventParams>>(null);
|
const currentParams = ref<Nullable<EventParams>>(null);
|
||||||
|
const showTrace = ref<boolean>(false);
|
||||||
|
const traceOptions = ref<{ type: string; filters?: unknown }>({
|
||||||
|
type: "Trace",
|
||||||
|
});
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
height: { type: String, default: "100%" },
|
height: { type: String, default: "100%" },
|
||||||
width: { type: String, default: "100%" },
|
width: { type: String, default: "100%" },
|
||||||
@ -140,6 +155,16 @@ function updateOptions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function viewTrace() {
|
||||||
|
console.log(currentParams.value);
|
||||||
|
const item = {};
|
||||||
|
traceOptions.value = {
|
||||||
|
...traceOptions.value,
|
||||||
|
filters: item,
|
||||||
|
};
|
||||||
|
showTrace.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
function eventAssociate() {
|
function eventAssociate() {
|
||||||
if (!props.filters) {
|
if (!props.filters) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user