Files
RawMark/web/src/app/NoteBanner.vue
T
eezd 02d904056c feat(web): add Vue workspace with file tree, tabs, autosave and live sync
- Login and first-run setup screens
- File tree with inline create/rename, context menu, drag-and-drop
  move and trash with undo; all operations update the UI first and roll
  back on failure
- Tabs keep a CodeMirror state each; edits autosave after 500 ms with
  If-Match revisions, unsent edits persist in IndexedDB, and conflicts
  or remote deletions surface as banners with explicit choices
- WebSocket events sync external edits, moves and deletions into open
  tabs; reconnects trigger a full resync
- Pasted or dropped images show instantly and upload to note.assets/
- Responsive layout with a swipe-in sidebar drawer on phones
- Switch to TypeScript 6: vue-tsc does not support TypeScript 7 yet
2026-10-16 18:37:14 +08:00

23 lines
968 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { computed } from 'vue'
import { activeTab, keepLocalVersion, retrySave, useServerVersion } from './workspace'
const tab = computed(activeTab)
</script>
<template>
<div v-if="tab?.status === 'conflict'" class="rm-banner warn">
<span>这篇笔记已在其他地方被修改,与你的修改冲突。</span>
<button class="rm-btn" @click="useServerVersion(tab.path)">载入服务器版本</button>
<button class="rm-btn" @click="keepLocalVersion(tab.path)">保留我的修改</button>
</div>
<div v-else-if="tab?.status === 'deleted'" class="rm-banner warn">
<span>这篇笔记已在其他地方被删除或移动。</span>
<button class="rm-btn" @click="keepLocalVersion(tab.path)">重新保存</button>
</div>
<div v-else-if="tab?.saveError" class="rm-banner error">
<span>{{ tab.saveError }}</span>
<button class="rm-btn" @click="retrySave(tab.path)">立即重试</button>
</div>
</template>