fixL: log viewer alignment problem
This commit is contained in:
@@ -42,6 +42,8 @@ const total = ref(0)
|
|||||||
let searchTimer: ReturnType<typeof setTimeout> | null = null
|
let searchTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
let durationTimer: ReturnType<typeof setInterval> | null = null
|
let durationTimer: ReturnType<typeof setInterval> | null = null
|
||||||
|
|
||||||
|
const isRefreshing = ref(false)
|
||||||
|
|
||||||
// 全屏查看
|
// 全屏查看
|
||||||
const showFullscreen = ref(false)
|
const showFullscreen = ref(false)
|
||||||
|
|
||||||
@@ -62,6 +64,7 @@ const decompressedOutput = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function loadLogs() {
|
async function loadLogs() {
|
||||||
|
isRefreshing.value = true
|
||||||
try {
|
try {
|
||||||
const params: { page: number; page_size: number; task_id?: string; task_name?: string; status?: string } = {
|
const params: { page: number; page_size: number; task_id?: string; task_name?: string; status?: string } = {
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
@@ -81,6 +84,8 @@ async function loadLogs() {
|
|||||||
total.value = response.total
|
total.value = response.total
|
||||||
} catch {
|
} catch {
|
||||||
toast.error('加载日志失败')
|
toast.error('加载日志失败')
|
||||||
|
} finally {
|
||||||
|
isRefreshing.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,8 +343,8 @@ watch(() => route.query, (newQuery) => {
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<Button variant="outline" size="icon" class="h-9 w-9 shrink-0" @click="loadLogs" title="刷新">
|
<Button variant="outline" size="icon" class="h-9 w-9 shrink-0" @click="loadLogs" title="刷新" :disabled="isRefreshing">
|
||||||
<RefreshCw class="h-4 w-4" />
|
<RefreshCw class="h-4 w-4" :class="{ 'animate-spin': isRefreshing }" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline"
|
<Button variant="outline"
|
||||||
class="h-9 px-4 shrink-0 text-sm text-destructive hover:bg-destructive/10 hover:text-destructive border-destructive/20"
|
class="h-9 px-4 shrink-0 text-sm text-destructive hover:bg-destructive/10 hover:text-destructive border-destructive/20"
|
||||||
@@ -616,3 +621,16 @@ watch(() => route.query, (newQuery) => {
|
|||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
:deep(.log-pre code) {
|
||||||
|
display: block;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.log-pre span) {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -112,11 +112,22 @@ onUnmounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ref="scrollContainer" class="flex-1 overflow-auto bg-black/5 dark:bg-white/5" @scroll="handleScroll">
|
<div ref="scrollContainer" class="flex-1 overflow-auto bg-black/5 dark:bg-white/5" @scroll="handleScroll">
|
||||||
<div class="p-3 sm:p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed">
|
<div class="p-3 sm:p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed"><Ansi>{{ content }}</Ansi></div>
|
||||||
<Ansi>{{ content }}</Ansi>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
:deep(code) {
|
||||||
|
display: block;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(span) {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user