mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-01 07:42:52 +00:00
revert logs on trace widget (#170)
This commit is contained in:
parent
2bf90d6a6d
commit
9f57e35119
@ -154,6 +154,7 @@ const msg = {
|
||||
query: "Query",
|
||||
postgreSQL: "PostgreSQL",
|
||||
endpointTips: "The table shows up to 20 pieces of endpoints.",
|
||||
apisix: "APISIX",
|
||||
seconds: "Seconds",
|
||||
hourTip: "Select Hour",
|
||||
minuteTip: "Select Minute",
|
||||
|
@ -154,6 +154,7 @@ const msg = {
|
||||
query: "Consulta",
|
||||
postgreSQL: "PostgreSQL",
|
||||
endpointTips: "Aquí, la tabla muestra hasta 20 punto final.",
|
||||
apisix: "APISIX",
|
||||
seconds: "Segundos",
|
||||
hourTip: "Seleccione Hora",
|
||||
minuteTip: "Seleccione Minuto",
|
||||
|
@ -151,6 +151,7 @@ const msg = {
|
||||
query: "查询",
|
||||
postgreSQL: "PostgreSQL",
|
||||
endpointTips: "这里最多展示20条endpoints。",
|
||||
apisix: "APISIX",
|
||||
seconds: "秒",
|
||||
hourTip: "选择小时",
|
||||
minuteTip: "选择分钟",
|
||||
|
@ -30,7 +30,7 @@ export default [
|
||||
path: "/apisix",
|
||||
name: "APISIX",
|
||||
meta: {
|
||||
title: "APISIX",
|
||||
title: "apisix",
|
||||
layer: "APISIX",
|
||||
},
|
||||
},
|
||||
|
1
src/types/components.d.ts
vendored
1
src/types/components.d.ts
vendored
@ -9,6 +9,7 @@ declare module '@vue/runtime-core' {
|
||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
||||
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
||||
|
@ -362,14 +362,6 @@ watch(
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.trace-list .trace-node rect {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
fill: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-c-text {
|
||||
white-space: pre;
|
||||
overflow: auto;
|
||||
|
@ -81,34 +81,75 @@ limitations under the License. -->
|
||||
{{ t("relatedTraceLogs") }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-model="showRelatedLogs"
|
||||
:destroy-on-close="true"
|
||||
fullscreen
|
||||
@closed="showRelatedLogs = false"
|
||||
>
|
||||
<el-pagination
|
||||
v-model:currentPage="pageNum"
|
||||
v-model:page-size="pageSize"
|
||||
:small="true"
|
||||
layout="prev, pager, next"
|
||||
:pager-count="5"
|
||||
:total="total"
|
||||
@current-change="turnPage"
|
||||
/>
|
||||
<LogTable
|
||||
:tableData="traceStore.traceSpanLogs || []"
|
||||
:type="`service`"
|
||||
:noLink="true"
|
||||
>
|
||||
<div class="log-tips" v-if="!traceStore.traceSpanLogs.length">
|
||||
{{ t("noData") }}
|
||||
</div>
|
||||
</LogTable>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { inject } from "vue";
|
||||
import { ref, computed } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import type { PropType } from "vue";
|
||||
import copy from "@/utils/copy";
|
||||
import getDashboard from "@/hooks/useDashboardsSession";
|
||||
import { LayoutConfig } from "@/types/dashboard";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { dateFormat } from "@/utils/dateFormat";
|
||||
import { useTraceStore } from "@/store/modules/trace";
|
||||
import LogTable from "@/views/dashboard/related/log/LogTable/Index.vue";
|
||||
|
||||
/*global defineProps, Recordable */
|
||||
const options: Recordable<LayoutConfig> = inject("options") || {};
|
||||
/*global defineProps */
|
||||
const props = defineProps({
|
||||
currentSpan: { type: Object as PropType<any>, default: () => ({}) },
|
||||
});
|
||||
const { t } = useI18n();
|
||||
const traceStore = useTraceStore();
|
||||
const pageNum = ref<number>(1);
|
||||
const showRelatedLogs = ref<boolean>(false);
|
||||
const pageSize = 10;
|
||||
const total = computed(() =>
|
||||
traceStore.traceList.length === pageSize
|
||||
? pageSize * pageNum.value + 1
|
||||
: pageSize * pageNum.value
|
||||
);
|
||||
async function getTaceLogs() {
|
||||
const { associationWidget } = getDashboard();
|
||||
associationWidget(
|
||||
(options.id as any) || "",
|
||||
{
|
||||
sourceId: options?.id || "",
|
||||
traceId: props.currentSpan.traceId,
|
||||
segmentId: props.currentSpan.segmentId,
|
||||
spanId: props.currentSpan.spanId,
|
||||
showRelatedLogs.value = true;
|
||||
const res = await traceStore.getSpanLogs({
|
||||
condition: {
|
||||
relatedTrace: {
|
||||
traceId: props.currentSpan.traceId,
|
||||
segmentId: props.currentSpan.segmentId,
|
||||
spanId: props.currentSpan.spanId,
|
||||
},
|
||||
paging: { pageNum: pageNum.value, pageSize },
|
||||
},
|
||||
"Log"
|
||||
);
|
||||
});
|
||||
if (res.errors) {
|
||||
ElMessage.error(res.errors);
|
||||
}
|
||||
}
|
||||
function turnPage(p: number) {
|
||||
pageNum.value = p;
|
||||
getTaceLogs();
|
||||
}
|
||||
function showCurrentSpanDetail(text: string) {
|
||||
copy(text);
|
||||
|
@ -141,6 +141,7 @@ export default class ListGraph {
|
||||
.append("g")
|
||||
.attr("transform", `translate(${source.y0},${source.x0})`)
|
||||
.attr("class", "trace-node")
|
||||
.attr("style", "cursor: pointer")
|
||||
.style("opacity", 0)
|
||||
.on("mouseover", function (event: any, d: Trace) {
|
||||
t.tip.show(d, this);
|
||||
|
Loading…
Reference in New Issue
Block a user