mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
✨ Feature(custom): release not now use markdown render, also optimize UI dispaly of update page
This commit is contained in:
@@ -99,6 +99,7 @@ const buildMainPageMenu = (win: BrowserWindow) => {
|
||||
label: $t('ABOUT'),
|
||||
click() {
|
||||
dialog.showMessageBox({
|
||||
type: 'info',
|
||||
title: 'PicList',
|
||||
message: 'PicList',
|
||||
detail: `Version: ${pkg.version}\nAuthor: Kuingsmile\nGithub: https://github.com/Kuingsmile/PicList`,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
class="collapse-button"
|
||||
@click="isCollapsed = !isCollapsed"
|
||||
>
|
||||
<component :is="isCollapsed ? ChevronRightIcon : ChevronLeftIcon" :size="20" />
|
||||
<component :is="isCollapsed ? ChevronRightIcon : ChevronLeftIcon" :size="16" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -846,15 +846,6 @@
|
||||
|
||||
<!-- Update Preferences -->
|
||||
<div class="settings-section update-preferences-section">
|
||||
<div class="section-header-with-icon">
|
||||
<div class="section-icon-wrapper update small-icon">
|
||||
<Settings :size="15" />
|
||||
</div>
|
||||
<div>
|
||||
<h2>{{ t('pages.settings.update.updatePreferences') }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="update-preference-card">
|
||||
<label class="switch-label">
|
||||
<input v-model="formOfSetting.showUpdateTip" type="checkbox" class="switch-input" />
|
||||
@@ -871,15 +862,6 @@
|
||||
|
||||
<!-- Release Notes Section -->
|
||||
<div class="settings-section release-notes-section">
|
||||
<div class="section-header-with-icon">
|
||||
<div class="section-icon-wrapper notes small-icon">
|
||||
<FileText :size="15" />
|
||||
</div>
|
||||
<div>
|
||||
<h2>{{ t('pages.settings.update.releaseNotes') }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="release-notes-card enhanced">
|
||||
<div class="release-notes-header">
|
||||
<div class="release-notes-title">
|
||||
@@ -905,9 +887,7 @@
|
||||
</div>
|
||||
<span>{{ t('pages.settings.update.loadingReleaseNotes') }}</span>
|
||||
</div>
|
||||
<div v-else-if="releaseNotes" class="release-notes-text">
|
||||
<pre class="release-notes-pre">{{ releaseNotes }}</pre>
|
||||
</div>
|
||||
<div v-else-if="releaseNotes" class="notes-body" v-html="renderedReleaseNotes"></div>
|
||||
<div v-else-if="releaseNotesError" class="release-notes-error">
|
||||
<div class="error-icon">⚠️</div>
|
||||
<span>{{ releaseNotesError }}</span>
|
||||
@@ -1779,6 +1759,7 @@ import {
|
||||
Settings,
|
||||
Store,
|
||||
} from 'lucide-vue-next'
|
||||
import { marked } from 'marked'
|
||||
import type { IConfig } from 'piclist'
|
||||
import pkg from 'root/package.json'
|
||||
import { computed, onBeforeMount, reactive, ref, toRaw, watch } from 'vue'
|
||||
@@ -2267,6 +2248,10 @@ function formatLastFetchTime(date: Date): string {
|
||||
}
|
||||
}
|
||||
|
||||
const renderedReleaseNotes = computed(() => {
|
||||
return marked(releaseNotes.value, { breaks: true, gfm: true })
|
||||
})
|
||||
|
||||
async function fetchReleaseNotes(forceRefresh = false): Promise<void> {
|
||||
if (!forceRefresh && releaseNotesLastFetch.value) {
|
||||
const timeSinceLastFetch = Date.now() - releaseNotesLastFetch.value.getTime()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user