|
|
@ -21,6 +21,7 @@ let copyResetTimer: ReturnType<typeof setTimeout> | undefined |
|
|
|
|
|
|
|
|
const { user, refresh } = useAuthSession() |
|
|
const { user, refresh } = useAuthSession() |
|
|
const { fetchData } = useClientApi() |
|
|
const { fetchData } = useClientApi() |
|
|
|
|
|
const toast = useToast() |
|
|
|
|
|
|
|
|
const filteredItems = computed(() => { |
|
|
const filteredItems = computed(() => { |
|
|
if (selectedFeedId.value === null) { |
|
|
if (selectedFeedId.value === null) { |
|
|
@ -77,11 +78,13 @@ async function addFeed() { |
|
|
await fetchData('/api/me/rss/feeds', { method: 'POST', body: { feedUrl: feedUrl.value } }) |
|
|
await fetchData('/api/me/rss/feeds', { method: 'POST', body: { feedUrl: feedUrl.value } }) |
|
|
feedUrl.value = '' |
|
|
feedUrl.value = '' |
|
|
await load() |
|
|
await load() |
|
|
|
|
|
toast.add({ title: '已添加订阅', color: 'success' }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function syncAll() { |
|
|
async function syncAll() { |
|
|
await fetchData('/api/me/rss/sync', { method: 'POST', body: {} }) |
|
|
await fetchData('/api/me/rss/sync', { method: 'POST', body: {} }) |
|
|
await load() |
|
|
await load() |
|
|
|
|
|
toast.add({ title: '同步完成', color: 'success' }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function removeFeed(id: number) { |
|
|
async function removeFeed(id: number) { |
|
|
@ -90,11 +93,13 @@ async function removeFeed(id: number) { |
|
|
selectedFeedId.value = null |
|
|
selectedFeedId.value = null |
|
|
} |
|
|
} |
|
|
await load() |
|
|
await load() |
|
|
|
|
|
toast.add({ title: '已删除订阅', color: 'success' }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function setItemVis(id: number, visibility: string) { |
|
|
async function setItemVis(id: number, visibility: string) { |
|
|
await fetchData(`/api/me/rss/items/${id}`, { method: 'PATCH', body: { visibility } }) |
|
|
await fetchData(`/api/me/rss/items/${id}`, { method: 'PATCH', body: { visibility } }) |
|
|
await load() |
|
|
await load() |
|
|
|
|
|
toast.add({ title: '可见性已更新', color: 'success' }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function copyUnlistedLink(it: Item) { |
|
|
async function copyUnlistedLink(it: Item) { |
|
|
|