Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix browser log display #396

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -35,7 +35,7 @@
import { BrowserLogConstants } from "./data";
import { dateFormat } from "@/utils/dateFormat";

/*global defineProps, defineEmits, NodeListOf */

Check warning on line 38 in src/views/dashboard/related/log/LogTable/LogBrowser.vue

View workflow job for this annotation

GitHub Actions / npm (16.x)

'NodeListOf' is defined but never used

Check warning on line 38 in src/views/dashboard/related/log/LogTable/LogBrowser.vue

View workflow job for this annotation

GitHub Actions / npm (18.x)

'NodeListOf' is defined but never used

Check warning on line 38 in src/views/dashboard/related/log/LogTable/LogBrowser.vue

View workflow job for this annotation

GitHub Actions / npm (20.x)

'NodeListOf' is defined but never used
const props = defineProps({
data: { type: Object as any, default: () => ({}) },
});
Expand All @@ -44,13 +44,6 @@
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 @@
}

.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
Loading