Add About settings with build identity and API documentation

This commit is contained in:
eezd committed 2026-10-21 11:47:27 +08:00
1 parent fcd0fdd7a4
commit 9e9ab03c2b
4 files changed
+25 -2

No files matched your search

+1
View File
@@ -21,6 +21,7 @@ const paths = {
user: 'M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z',
outline: 'M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01',
command: 'M18 3a3 3 0 0 0-3 3v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 0 0 0-6z',
info: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 11v6M12 7h.01',
}
export type IconName = keyof typeof paths
defineProps<{ name: IconName; size?: number }>()
+17
View File
@@ -20,8 +20,12 @@ const SECTIONS: { id: SettingsSection; title: string; icon: IconName }[] = [
{ id: 'shares', title: '分享链接', icon: 'link' },
{ id: 'tokens', title: 'API 令牌', icon: 'key' },
{ id: 'trash', title: '回收站', icon: 'trash' },
{ id: 'about', title: '关于', icon: 'info' },
]
const buildVersion = import.meta.env.DEV ? '开发版' : document.querySelector<HTMLMetaElement>('meta[name="rawmark-version"]')?.content
if (!buildVersion) throw new Error('缺少应用构建版本信息')
// 编辑器内置的按键(不在命令注册表中)
const EDITOR_KEYS = [
{ title: '粗体', keys: 'Mod+B' },
@@ -177,6 +181,19 @@ async function changePassword() {
<SharePanel v-else-if="section === 'shares'" :path="null" />
<TokensPanel v-else-if="section === 'tokens'" />
<TrashPanel v-else-if="section === 'trash'" />
<template v-else-if="section === 'about'">
<div class="rm-setting"><h3>RawMark</h3></div>
<p class="rm-share-note">纯 Markdown 笔记编辑器,文件即真源。</p>
<div class="rm-setting">
<span class="rm-setting-label">构建版本</span>
<code>{{ buildVersion }}</code>
</div>
<div class="rm-setting">
<span class="rm-setting-label">API 文档</span>
<a class="rm-btn" href="/api/v1/openapi.json" target="_blank" rel="noopener">查看 OpenAPI 文档</a>
</div>
<p class="rm-share-note">在「API 令牌」中创建令牌后,可通过 REST API 读取或写入笔记。</p>
</template>
</div>
</section>
</div>
+1 -1
View File
@@ -30,7 +30,7 @@ export interface Tab {
conflictRev?: string
}
export type SettingsSection = 'appearance' | 'editor' | 'account' | 'shortcuts' | 'shares' | 'tokens' | 'trash' | 'plugins'
export type SettingsSection = 'appearance' | 'editor' | 'account' | 'shortcuts' | 'shares' | 'tokens' | 'trash' | 'plugins' | 'about'
export interface Toast {
id: number