mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-12 16:11:27 +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'),
|
label: $t('ABOUT'),
|
||||||
click() {
|
click() {
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
|
type: 'info',
|
||||||
title: 'PicList',
|
title: 'PicList',
|
||||||
message: 'PicList',
|
message: 'PicList',
|
||||||
detail: `Version: ${pkg.version}\nAuthor: Kuingsmile\nGithub: https://github.com/Kuingsmile/PicList`,
|
detail: `Version: ${pkg.version}\nAuthor: Kuingsmile\nGithub: https://github.com/Kuingsmile/PicList`,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
class="collapse-button"
|
class="collapse-button"
|
||||||
@click="isCollapsed = !isCollapsed"
|
@click="isCollapsed = !isCollapsed"
|
||||||
>
|
>
|
||||||
<component :is="isCollapsed ? ChevronRightIcon : ChevronLeftIcon" :size="20" />
|
<component :is="isCollapsed ? ChevronRightIcon : ChevronLeftIcon" :size="16" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -846,15 +846,6 @@
|
|||||||
|
|
||||||
<!-- Update Preferences -->
|
<!-- Update Preferences -->
|
||||||
<div class="settings-section update-preferences-section">
|
<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">
|
<div class="update-preference-card">
|
||||||
<label class="switch-label">
|
<label class="switch-label">
|
||||||
<input v-model="formOfSetting.showUpdateTip" type="checkbox" class="switch-input" />
|
<input v-model="formOfSetting.showUpdateTip" type="checkbox" class="switch-input" />
|
||||||
@@ -871,15 +862,6 @@
|
|||||||
|
|
||||||
<!-- Release Notes Section -->
|
<!-- Release Notes Section -->
|
||||||
<div class="settings-section 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-card enhanced">
|
||||||
<div class="release-notes-header">
|
<div class="release-notes-header">
|
||||||
<div class="release-notes-title">
|
<div class="release-notes-title">
|
||||||
@@ -905,9 +887,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<span>{{ t('pages.settings.update.loadingReleaseNotes') }}</span>
|
<span>{{ t('pages.settings.update.loadingReleaseNotes') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="releaseNotes" class="release-notes-text">
|
<div v-else-if="releaseNotes" class="notes-body" v-html="renderedReleaseNotes"></div>
|
||||||
<pre class="release-notes-pre">{{ releaseNotes }}</pre>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="releaseNotesError" class="release-notes-error">
|
<div v-else-if="releaseNotesError" class="release-notes-error">
|
||||||
<div class="error-icon">⚠️</div>
|
<div class="error-icon">⚠️</div>
|
||||||
<span>{{ releaseNotesError }}</span>
|
<span>{{ releaseNotesError }}</span>
|
||||||
@@ -1779,6 +1759,7 @@ import {
|
|||||||
Settings,
|
Settings,
|
||||||
Store,
|
Store,
|
||||||
} from 'lucide-vue-next'
|
} from 'lucide-vue-next'
|
||||||
|
import { marked } from 'marked'
|
||||||
import type { IConfig } from 'piclist'
|
import type { IConfig } from 'piclist'
|
||||||
import pkg from 'root/package.json'
|
import pkg from 'root/package.json'
|
||||||
import { computed, onBeforeMount, reactive, ref, toRaw, watch } from 'vue'
|
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> {
|
async function fetchReleaseNotes(forceRefresh = false): Promise<void> {
|
||||||
if (!forceRefresh && releaseNotesLastFetch.value) {
|
if (!forceRefresh && releaseNotesLastFetch.value) {
|
||||||
const timeSinceLastFetch = Date.now() - releaseNotesLastFetch.value.getTime()
|
const timeSinceLastFetch = Date.now() - releaseNotesLastFetch.value.getTime()
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user