mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-09 09:46:44 +08:00
fix: bind subscribe status tooltip to full state
This commit is contained in:
@@ -726,24 +726,30 @@ function handleCardClick() {
|
|||||||
<div class="subscribe-card-mobile-body">
|
<div class="subscribe-card-mobile-body">
|
||||||
<div class="subscribe-card-mobile-footer">
|
<div class="subscribe-card-mobile-footer">
|
||||||
<div class="subscribe-card-mobile-meta">
|
<div class="subscribe-card-mobile-meta">
|
||||||
<div
|
<VTooltip
|
||||||
class="subscribe-card-mobile-state"
|
:text="executionStateDisplay?.error"
|
||||||
:style="{ color: `rgb(var(--v-theme-${compactStateDisplay.color}))` }"
|
:disabled="!executionStateDisplay?.error"
|
||||||
:title="executionStateDisplay?.error || compactStateDisplay.label"
|
location="top"
|
||||||
:aria-label="compactStateDisplay.label"
|
|
||||||
>
|
>
|
||||||
<VIcon
|
<template #activator="{ props: tooltipProps }">
|
||||||
:icon="compactStateDisplay.icon"
|
<div
|
||||||
:data-subscribe-state-icon="compactStateDisplay.icon"
|
v-bind="tooltipProps"
|
||||||
size="16"
|
class="subscribe-card-mobile-state"
|
||||||
/>
|
:style="{ color: `rgb(var(--v-theme-${compactStateDisplay.color}))` }"
|
||||||
<span v-if="compactStateText" class="subscribe-card-mobile-progress-text">
|
:title="executionStateDisplay?.error || compactStateDisplay.label"
|
||||||
{{ compactStateText }}
|
:aria-label="compactStateDisplay.label"
|
||||||
</span>
|
>
|
||||||
<VTooltip v-if="executionStateDisplay?.error" activator="parent" location="top">
|
<VIcon
|
||||||
{{ executionStateDisplay.error }}
|
:icon="compactStateDisplay.icon"
|
||||||
</VTooltip>
|
:data-subscribe-state-icon="compactStateDisplay.icon"
|
||||||
</div>
|
size="16"
|
||||||
|
/>
|
||||||
|
<span v-if="compactStateText" class="subscribe-card-mobile-progress-text">
|
||||||
|
{{ compactStateText }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VTooltip>
|
||||||
|
|
||||||
<IconBtn v-if="!props.sortable" class="subscribe-card-mobile-menu" size="small" @click.stop>
|
<IconBtn v-if="!props.sortable" class="subscribe-card-mobile-menu" size="small" @click.stop>
|
||||||
<VIcon icon="mdi-dots-horizontal" size="18" />
|
<VIcon icon="mdi-dots-horizontal" size="18" />
|
||||||
@@ -862,20 +868,28 @@ function handleCardClick() {
|
|||||||
</div>
|
</div>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<!-- 右下角元数据:暂停 / 待定时替换"x 天前"为状态文案 -->
|
<!-- 右下角元数据:暂停 / 待定时替换"x 天前"为状态文案 -->
|
||||||
<VCardText
|
<VTooltip
|
||||||
v-if="rightBottomStateDisplay"
|
v-if="rightBottomStateDisplay"
|
||||||
class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300 text-xs"
|
:text="executionStateDisplay?.error"
|
||||||
:style="
|
:disabled="!executionStateDisplay?.error"
|
||||||
executionStateDisplay ? { color: `rgb(var(--v-theme-${executionStateDisplay.color}))` } : undefined
|
location="top"
|
||||||
"
|
|
||||||
:title="executionStateDisplay?.error || rightBottomStateDisplay.label"
|
|
||||||
>
|
>
|
||||||
<VIcon :icon="rightBottomStateDisplay.icon" class="me-1" />
|
<template #activator="{ props: tooltipProps }">
|
||||||
{{ rightBottomStateDisplay.label }}
|
<VCardText
|
||||||
<VTooltip v-if="executionStateDisplay?.error" activator="parent" location="top">
|
v-bind="tooltipProps"
|
||||||
{{ executionStateDisplay.error }}
|
class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300 text-xs"
|
||||||
</VTooltip>
|
:style="
|
||||||
</VCardText>
|
executionStateDisplay
|
||||||
|
? { color: `rgb(var(--v-theme-${executionStateDisplay.color}))` }
|
||||||
|
: undefined
|
||||||
|
"
|
||||||
|
:title="executionStateDisplay?.error || rightBottomStateDisplay.label"
|
||||||
|
>
|
||||||
|
<VIcon :icon="rightBottomStateDisplay.icon" class="me-1" />
|
||||||
|
{{ rightBottomStateDisplay.label }}
|
||||||
|
</VCardText>
|
||||||
|
</template>
|
||||||
|
</VTooltip>
|
||||||
<VCardText
|
<VCardText
|
||||||
v-else-if="lastUpdateText"
|
v-else-if="lastUpdateText"
|
||||||
class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300 text-xs"
|
class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300 text-xs"
|
||||||
|
|||||||
@@ -364,7 +364,10 @@ describe('SubscribeCard display and progress', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(screen.getByText('等待站点额度')).toBeInTheDocument()
|
expect(screen.getByText('等待站点额度')).toBeInTheDocument()
|
||||||
expect(screen.getByTitle('站点 9 冷却中')).toBeInTheDocument()
|
const status = screen.getByTitle('站点 9 冷却中')
|
||||||
|
expect(status).toBeInTheDocument()
|
||||||
|
await fireEvent.mouseEnter(status)
|
||||||
|
await waitFor(() => expect(screen.getByRole('tooltip')).toHaveTextContent('站点 9 冷却中'))
|
||||||
})
|
})
|
||||||
|
|
||||||
it.each([480, 1024])('shows a skipped execution as a non-error terminal state at %ipx', async width => {
|
it.each([480, 1024])('shows a skipped execution as a non-error terminal state at %ipx', async width => {
|
||||||
|
|||||||
Reference in New Issue
Block a user