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 { .trace-line {
position: relative; position: relative;
width: 2px; width: 2px;
height: 900px; height: 100%;
background-color: #e8e8e8; background-color: #e8e8e8;
cursor: ew-resize; cursor: ew-resize;

View File

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

View File

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

View File

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