fix: отображение текущей версии и changelog в настройках
All checks were successful
Release / release (push) Successful in 2m0s
All checks were successful
Release / release (push) Successful in 2m0s
- appVersion через script setup — Vite корректно заменяет __APP_VERSION__ (прямое использование в шаблоне давало _ctx.__APP_VERSION__ = undefined) - Раскрывающийся блок «Что нового» с release notes из Gitea Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
58aba3b07b
commit
2f5aa9557e
1 changed files with 97 additions and 1 deletions
|
|
@ -16,6 +16,8 @@ const settingsStore = useSettingsStore()
|
|||
|
||||
const editingAccount = ref<AccountConfig | null>(null)
|
||||
const updaterStore = useUpdaterStore()
|
||||
const changelogOpen = ref(false)
|
||||
const appVersion = __APP_VERSION__
|
||||
|
||||
const swipeOptions: { value: SwipeAction; label: string }[] = (
|
||||
['delete', 'toggleRead', 'toggleFlag', 'none'] as SwipeAction[]
|
||||
|
|
@ -197,7 +199,7 @@ function folderDisplayName(path: string): string {
|
|||
<div class="row update-main-row">
|
||||
<span class="col-label">Версия</span>
|
||||
<div class="col-value update-version-line">
|
||||
<span class="ver-chip">v{{ __APP_VERSION__ }}</span>
|
||||
<span class="ver-chip">v{{ appVersion }}</span>
|
||||
<Transition name="status-fade" mode="out-in">
|
||||
<span v-if="updaterStore.upToDate && !updaterStore.available" key="ok" class="status-chip status-ok">
|
||||
✓ актуальная
|
||||
|
|
@ -229,6 +231,22 @@ function folderDisplayName(path: string): string {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Что нового -->
|
||||
<div v-if="updaterStore.available && updaterStore.notes" class="row changelog-row">
|
||||
<span class="col-label"></span>
|
||||
<div class="col-value changelog-wrap">
|
||||
<button class="changelog-toggle" @click="changelogOpen = !changelogOpen">
|
||||
<span>Что нового</span>
|
||||
<span class="changelog-arrow" :class="{ open: changelogOpen }">›</span>
|
||||
</button>
|
||||
<Transition name="changelog">
|
||||
<div v-if="changelogOpen" class="changelog-body">
|
||||
<pre class="changelog-text">{{ updaterStore.notes }}</pre>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Прогресс загрузки -->
|
||||
<div v-if="updaterStore.downloading" class="row">
|
||||
<span class="col-label"></span>
|
||||
|
|
@ -814,4 +832,82 @@ function folderDisplayName(path: string): string {
|
|||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* ── Changelog ───────────────────────────────────────────────────────────── */
|
||||
|
||||
.changelog-row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.changelog-wrap {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
width: 100%;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.changelog-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 9px 14px;
|
||||
padding-left: calc(62px + 14px);
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: color var(--transition-fast);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.changelog-toggle:hover {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.changelog-arrow {
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
transition: transform 0.2s ease;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.changelog-arrow.open {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.changelog-body {
|
||||
padding: 0 14px 10px calc(62px + 14px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.changelog-text {
|
||||
font-size: 11px;
|
||||
font-family: var(--font-mono);
|
||||
color: var(--text-muted);
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(255,255,255,0.12) transparent;
|
||||
}
|
||||
|
||||
.changelog-enter-active,
|
||||
.changelog-leave-active {
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.changelog-enter-from,
|
||||
.changelog-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue