fix: css details (#391)

This commit is contained in:
Starry 2024-04-17 09:53:43 +08:00 committed by GitHub
parent 731d652a7d
commit 13b2693f29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 2 deletions

View File

@ -183,7 +183,7 @@ limitations under the License. -->
.trace-line {
position: relative;
width: 2px;
height: 900px;
height: 100%;
background-color: #e8e8e8;
cursor: ew-resize;

View File

@ -25,11 +25,14 @@ limitations under the License. -->
<script lang="ts" setup>
import { onMounted, ref, onUnmounted, watch, toRaw } from "vue";
import { useDemandLogStore } from "@/store/modules/demand-log";
import { useAppStoreWithOut } from "@/store/modules/app";
import { Themes } from "@/constants/data";
/*global Nullable */
const demandLogStore = useDemandLogStore();
const monacoInstance = ref();
const logContent = ref<Nullable<HTMLDivElement>>(null);
const appStore = useAppStoreWithOut();
onMounted(() => {
init();
@ -50,6 +53,7 @@ limitations under the License. -->
wordWrap: true,
minimap: { enabled: false },
readonly: true,
theme: getTheme(),
});
toRaw(monacoInstance.value).updateOptions({ readOnly: true });
editorLayout();
@ -64,6 +68,9 @@ limitations under the License. -->
width: width,
});
}
function getTheme() {
return appStore.theme === Themes.Dark ? "vs-dark" : "vs";
}
onUnmounted(() => {
if (!toRaw(monacoInstance.value)) {
return;
@ -72,6 +79,12 @@ limitations under the License. -->
monacoInstance.value = null;
demandLogStore.setLogs("");
});
watch(
() => appStore.theme,
() => {
toRaw(monacoInstance.value).updateOptions({ theme: getTheme() });
},
);
watch(
() => demandLogStore.logs,
() => {

View File

@ -164,7 +164,8 @@ limitations under the License. -->
}
.trace-t-wrapper {
overflow: hidden;
overflow-x: hidden;
overflow-y: scroll;
border-right: 1px solid var(--sw-trace-list-border);
}

View File

@ -75,6 +75,7 @@ limitations under the License. -->
if (!traceGraph.value) {
return;
}
d3.selectAll(".d3-tip").remove();
if (props.type === "List") {
tree.value = new ListGraph(traceGraph.value, handleSelectSpan);
tree.value.init({ label: "TRACE_ROOT", children: segmentId.value }, props.data, fixSpansSize.value);