Skip to content

Commit

Permalink
fix: browser log display (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodePrometheus committed May 21, 2024
1 parent 88dbee3 commit 21fe455
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/views/dashboard/related/log/LogTable/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ limitations under the License. -->
@closed="showDetail = false"
:title="t('logDetail')"
>
<LogDetail :currentLog="currentLog" />
<LogDetail :currentLog="currentLog" :logTemplate="type === 'browser' ? BrowserLogConstants : ServiceLogDetail" />
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { useI18n } from "vue-i18n";
import { ServiceLogConstants, BrowserLogConstants } from "./data";
import { ServiceLogConstants, BrowserLogConstants, ServiceLogDetail } from "./data";
import LogBrowser from "./LogBrowser.vue";
import LogService from "./LogService.vue";
import LogDetail from "./LogDetail.vue";
Expand Down
13 changes: 3 additions & 10 deletions src/views/dashboard/related/log/LogTable/LogBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ limitations under the License. -->
const logItem = ref<any>(null);
function showSelectSpan() {
const items: NodeListOf<any> = document.querySelectorAll(".log-item");
for (const item of items) {
item.style.background = "#fff";
}
logItem.value.style.background = "rgba(0, 0, 0, 0.1)";
emit("select", props.data);
}
</script>
Expand All @@ -62,15 +55,15 @@ limitations under the License. -->
}
.log-item.selected {
background: rgba(0, 0, 0, 0.04);
background: rgb(0 0 0 / 4%);
}
.log-item:not(.level0):hover {
background: rgba(0, 0, 0, 0.04);
background: rgb(0 0 0 / 4%);
}
.log-item:hover {
background: rgba(0, 0, 0, 0.04) !important;
background: rgb(0 0 0 / 4%) !important;
}
.log-item > div {
Expand Down
4 changes: 2 additions & 2 deletions src/views/dashboard/related/log/LogTable/LogDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div class="log-detail">
<div class="mb-10 clear rk-flex" v-for="(item, index) in ServiceLogDetail" :key="index">
<div class="mb-10 clear rk-flex" v-for="(item, index) in logTemplate" :key="index">
<span class="g-sm-4 grey">{{ t(item.value) }}:</span>
<span v-if="['timestamp', 'time'].includes(item.label)" class="g-sm-8 mb-10">
{{ dateFormat(currentLog[item.label]) }}
Expand All @@ -38,11 +38,11 @@ limitations under the License. -->
import { useI18n } from "vue-i18n";
import { dateFormat } from "@/utils/dateFormat";
import { formatJson } from "@/utils/formatJson";
import { ServiceLogDetail } from "./data";
/*global defineProps */
const props = defineProps({
currentLog: { type: Object as PropType<any>, default: () => ({}) },
logTemplate: { type: Object as PropType<any>, default: () => ({}) },
});
const { t } = useI18n();
const logTags = computed(() => {
Expand Down

0 comments on commit 21fe455

Please sign in to comment.