mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 17:26:41 +08:00
refactor: dynamic logging view height calculation and remove redundant LLM model refresh on settings save
This commit is contained in:
@@ -526,9 +526,6 @@ async function loadSystemSettings() {
|
|||||||
}
|
}
|
||||||
SystemSettings.value.Basic.LLM_THINKING_LEVEL = resolveThinkingLevelValue(result.data)
|
SystemSettings.value.Basic.LLM_THINKING_LEVEL = resolveThinkingLevelValue(result.data)
|
||||||
await loadLlmProviders()
|
await loadLlmProviders()
|
||||||
if (SystemSettings.value.Basic.AI_AGENT_ENABLE && canRefreshModels.value) {
|
|
||||||
await refreshLlmModels(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { useTheme } from 'vuetify'
|
import { useTheme } from 'vuetify'
|
||||||
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
|
import { useBackgroundOptimization } from '@/composables/useBackgroundOptimization'
|
||||||
|
import { useAvailableHeight } from '@/composables/useAvailableHeight'
|
||||||
|
|
||||||
type LogEntry = {
|
type LogEntry = {
|
||||||
id: number
|
id: number
|
||||||
@@ -81,6 +82,11 @@ const logColorMap: Record<string, string> = {
|
|||||||
const isDarkTheme = computed(() => theme.global.current.value.dark)
|
const isDarkTheme = computed(() => theme.global.current.value.dark)
|
||||||
const isTransparentTheme = computed(() => theme.name.value === 'transparent')
|
const isTransparentTheme = computed(() => theme.name.value === 'transparent')
|
||||||
const normalizedSearchQuery = computed(() => (searchQuery.value ?? '').trim().toLowerCase())
|
const normalizedSearchQuery = computed(() => (searchQuery.value ?? '').trim().toLowerCase())
|
||||||
|
const { availableHeight } = useAvailableHeight(136, 320)
|
||||||
|
|
||||||
|
const loggingViewStyle = computed(() => ({
|
||||||
|
blockSize: `${availableHeight.value}px`,
|
||||||
|
}))
|
||||||
|
|
||||||
const levelOptions = computed(() => {
|
const levelOptions = computed(() => {
|
||||||
const extraLevels = parsedLogs.value.map(item => item.level).filter(level => level && !DEFAULT_LEVELS.includes(level))
|
const extraLevels = parsedLogs.value.map(item => item.level).filter(level => level && !DEFAULT_LEVELS.includes(level))
|
||||||
@@ -521,7 +527,11 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VProgressLinear v-if="!isStreamPaused" class="logging-live-progress" indeterminate color="primary" height="1" />
|
<VProgressLinear v-if="!isStreamPaused" class="logging-live-progress" indeterminate color="primary" height="1" />
|
||||||
<div class="logging-view" :class="{ 'is-dark-theme': isDarkTheme, 'is-transparent-theme': isTransparentTheme }">
|
<div
|
||||||
|
class="logging-view"
|
||||||
|
:class="{ 'is-dark-theme': isDarkTheme, 'is-transparent-theme': isTransparentTheme }"
|
||||||
|
:style="loggingViewStyle"
|
||||||
|
>
|
||||||
<div class="logging-toolbar px-3">
|
<div class="logging-toolbar px-3">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="searchQuery"
|
v-model="searchQuery"
|
||||||
@@ -628,9 +638,8 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
block-size: min(85vh, 48rem);
|
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
min-block-size: 24rem;
|
min-block-size: 20rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logging-view.is-dark-theme {
|
.logging-view.is-dark-theme {
|
||||||
@@ -924,11 +933,6 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (width <= 960px) {
|
@media (width <= 960px) {
|
||||||
.logging-view {
|
|
||||||
block-size: min(calc(100dvh - 7rem), 48rem);
|
|
||||||
min-block-size: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logging-record {
|
.logging-record {
|
||||||
gap: 0.375rem;
|
gap: 0.375rem;
|
||||||
grid-template-columns: 9.5rem minmax(0, 1fr);
|
grid-template-columns: 9.5rem minmax(0, 1fr);
|
||||||
@@ -942,7 +946,6 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
@media (width <= 640px) {
|
@media (width <= 640px) {
|
||||||
.logging-view {
|
.logging-view {
|
||||||
block-size: calc(100dvh - 6rem);
|
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
min-block-size: 0;
|
min-block-size: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user