Skip to content

Commit

Permalink
feat: 添加更新记录、GitHub 仓库链接
Browse files Browse the repository at this point in the history
  • Loading branch information
typed-sigterm committed Jun 25, 2024
1 parent ac634ba commit 0dc6658
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 17 deletions.
29 changes: 29 additions & 0 deletions components/changelog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts" setup>
import ChangelogMd from '~/CHANGELOG.md'
</script>

<template>
<ChangelogMd />
</template>

<style lang="postcss" scoped>
:deep() {
h1 {
display: none;
}
h1 + h2 {
margin-block-start: 0;
}
h2::before { /* 版本号 */
content: 'v';
}
h3 { /* “新功能”“bug 修复”等 */
all: unset;
}
ul {
margin-top: 4px;
margin-bottom: 4px;
}
}
</style>
29 changes: 29 additions & 0 deletions components/info-modal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts" setup>
defineProps<{
/** 弹窗标题 */
title: string
}>()
defineSlots<{
/** 触发弹窗的操作,发出 `click` 事件时打开弹窗 */
default: () => any
/** 弹窗内容 */
modal: () => any
}>()
const show = defineModel<boolean>('show')
</script>

<template>
<slot />

<NModal
v-model:show="show"
class="w-[600px] h-[90vh]"
preset="card"
:title
>
<NScrollbar class="w-full h-full">
<slot name="modal" />
</NScrollbar>
</NModal>
</template>
4 changes: 2 additions & 2 deletions components/licenses.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import Licenses from '~/3rd-party-licenses.md'
import LicensesMd from '~/3rd-party-licenses.md'
</script>

<template>
<Licenses />
<LicensesMd />
</template>

<style lang="postcss" scoped>
Expand Down
47 changes: 33 additions & 14 deletions components/settings/footer.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
<script lang="ts" setup>
import IconGitHub from '~icons/ant-design/github-filled'
const loadLicenses = ref(false)
const showLicenses = ref(false)
const loadChangelog = ref(false)
const showChangelog = ref(false)
</script>

<template>
<div class="flex items-center" style="color: #86909c;">
ExCaller {{ VERSION }}
<img class="inline w-4 mx-2" src="/logo.webp">
<NButton text @click="loadLicenses = showLicenses = true">
开放源代码许可
</NButton>
</div>

<NModal
v-model:show="showLicenses"
class="w-fit h-[90vh]"
preset="card"
title="ExCaller 开放源代码许可"
>
<NScrollbar class="w-[600px] h-full">
<LazyLicenses v-if="loadLicenses" class="h-0" />
</NScrollbar>
</NModal>
<InfoModal v-model:show="showLicenses" title="ExCaller 开放源代码许可">
<NButton class="mr-2" text @click="loadLicenses = showLicenses = true">
开放源代码许可
</NButton>
<template #modal>
<LazyLicenses v-if="loadLicenses" class="h-0" />
</template>
</InfoModal>

<InfoModal v-model:show="showChangelog" title="ExCaller 更新记录">
<NButton class="mr-2" text @click="loadChangelog = showChangelog = true">
更新记录
</NButton>
<template #modal>
<LazyChangelog v-if="loadChangelog" class="h-0" />
</template>
</InfoModal>

<a href="https://github.com/typed-sigterm/ex-caller" target="_blank">
<IconGitHub />
</a>
</div>
</template>

<style scoped>
a:link, a:visited {
color: initial
}
</style>
2 changes: 1 addition & 1 deletion utils/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { DialogFilter } from '@tauri-apps/plugin-dialog'
import { save } from '@tauri-apps/plugin-dialog'
import type { BaseDirectory } from '@tauri-apps/plugin-fs'
import { exists, mkdir, readFile, remove, writeFile } from '@tauri-apps/plugin-fs'
import { appDataDir, desktopDir, resolve } from '@tauri-apps/api/path'
import { desktopDir, resolve } from '@tauri-apps/api/path'
import { promiseTimeout } from '@vueuse/core'

export interface SaveFileOptions {
Expand Down

0 comments on commit 0dc6658

Please sign in to comment.