mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
fix: view logs on trace widget
This commit is contained in:
parent
b2ab93926d
commit
8816f8147f
@ -25,16 +25,16 @@ limitations under the License. -->
|
||||
</div>
|
||||
</el-popover>
|
||||
<div class="header">
|
||||
<Filter :needQuery="needQuery" :data="data" />
|
||||
<Filter :needQuery="needQuery" :data="data" @get="getService" />
|
||||
</div>
|
||||
<div class="trace flex-h">
|
||||
<TraceList />
|
||||
<TraceDetail />
|
||||
<TraceDetail :serviceId="serviceId" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { provide } from "vue";
|
||||
import { provide, ref } from "vue";
|
||||
import type { PropType } from "vue";
|
||||
import Filter from "../related/trace/Filter.vue";
|
||||
import TraceList from "../related/trace/TraceList.vue";
|
||||
@ -42,7 +42,7 @@ limitations under the License. -->
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
|
||||
/*global defineProps */
|
||||
/* global defineProps */
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object as PropType<any>,
|
||||
@ -52,11 +52,15 @@ limitations under the License. -->
|
||||
needQuery: { type: Boolean, default: true },
|
||||
});
|
||||
provide("options", props.data);
|
||||
const serviceId = ref<string>("");
|
||||
const { t } = useI18n();
|
||||
const dashboardStore = useDashboardStore();
|
||||
function removeWidget() {
|
||||
dashboardStore.removeControls(props.data);
|
||||
}
|
||||
function getService(id: string) {
|
||||
serviceId.value = id;
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.trace-wrapper {
|
||||
|
@ -199,7 +199,11 @@ limitations under the License. -->
|
||||
ElMessage.error(resp.errors);
|
||||
return;
|
||||
}
|
||||
state.service = logStore.services[0];
|
||||
if (props.data.filters && props.data.filters.id) {
|
||||
state.service = logStore.services.find((item: { id: string }) => item.id === props.data.filters?.id);
|
||||
} else {
|
||||
state.service = logStore.services[0];
|
||||
}
|
||||
getInstances(state.service.id);
|
||||
getEndpoints(state.service.id);
|
||||
}
|
||||
|
@ -102,12 +102,17 @@ limitations under the License. -->
|
||||
import { dateFormat } from "@/utils/dateFormat";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
|
||||
const props = {
|
||||
serviceId: { type: String, default: "" },
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
name: "TraceDetail",
|
||||
components: {
|
||||
...graphs,
|
||||
},
|
||||
setup() {
|
||||
props,
|
||||
setup(props) {
|
||||
const appStore = useAppStoreWithOut();
|
||||
/*global Recordable */
|
||||
const options: Recordable<LayoutConfig> = inject("options") || {};
|
||||
@ -138,6 +143,7 @@ limitations under the License. -->
|
||||
{
|
||||
sourceId: options?.id || "",
|
||||
traceId: traceId.value || traceStore.currentTrace.traceIds[0].value,
|
||||
id: props.serviceId || undefined,
|
||||
},
|
||||
"Log",
|
||||
);
|
||||
|
@ -90,7 +90,8 @@ limitations under the License. -->
|
||||
import { EntityType, QueryOrders, Status } from "../../data";
|
||||
import type { LayoutConfig } from "@/types/dashboard";
|
||||
|
||||
/*global defineProps, Recordable */
|
||||
/*global defineProps, defineEmits, Recordable */
|
||||
const emits = defineEmits(["get"]);
|
||||
const props = defineProps({
|
||||
needQuery: { type: Boolean, default: true },
|
||||
data: {
|
||||
@ -150,6 +151,8 @@ limitations under the License. -->
|
||||
return;
|
||||
}
|
||||
state.service = getCurrentNode(traceStore.services) || traceStore.services[0];
|
||||
emits("get", state.service.id);
|
||||
|
||||
getEndpoints(state.service.id);
|
||||
getInstances(state.service.id);
|
||||
}
|
||||
@ -232,6 +235,7 @@ limitations under the License. -->
|
||||
if (type === "service") {
|
||||
getEndpoints(state.service.id);
|
||||
getInstances(state.service.id);
|
||||
emits("get", state.service.id);
|
||||
}
|
||||
}
|
||||
function updateTags(data: { tagsMap: Array<Option>; tagsList: string[] }) {
|
||||
|
Loading…
Reference in New Issue
Block a user