diff --git a/src/Api.ts b/src/Api.ts
index e02a33a..2dc2edf 100644
--- a/src/Api.ts
+++ b/src/Api.ts
@@ -221,6 +221,15 @@ class Api {
return this.axios.post('/rss/removeItem', data).then(Api.handleResponse);
}
+ public refreshRssFeed(path: string) {
+ const params: any = {
+ itemPath: path,
+ }
+
+ const data = new URLSearchParams(params)
+ return this.axios.post('/rss/refreshItem', data).then(Api.handleResponse);
+ }
+
public getRssRules(): Promise<{[key: string]: RssRule}> {
return this.axios.get('/rss/rules').then(Api.handleResponse);
}
diff --git a/src/components/dialogs/RssDialog.vue b/src/components/dialogs/RssDialog.vue
index d532409..7a1ec07 100644
--- a/src/components/dialogs/RssDialog.vue
+++ b/src/components/dialogs/RssDialog.vue
@@ -34,6 +34,15 @@
>
mdi-delete
+
+
+ mdi-refresh
+
{
+ return p.replace('\\\'', '\'').replace('\\\\', '\\');
+ }).join('\\');
+ }
+
isItemLoading(row: any) {
const item = row.item.item
return item && item.isLoading
@@ -355,7 +374,7 @@ export default class RssDialog extends HasTask {
})
await api.addRssFeed(input);
- this.runTask();
+ await this.runTask();
this.closeSnackBar();
}
@@ -376,23 +395,24 @@ export default class RssDialog extends HasTask {
text: tr('label.deleting'),
})
- const path = toPath(this.selectNode!).map(p => {
- return p.replace('\\\'', '\'').replace('\\\\', '\\');
- }).join('\\');
-
try {
- await api.removeRssFeed(path);
+ await api.removeRssFeed(this.selectedPath!);
} catch (e) {
this.showSnackBar({
text: e.response ? e.response.data : e.message,
})
return
}
- this.runTask();
+ await this.runTask();
this.closeSnackBar();
}
+ async refreshRssItem() {
+ await api.refreshRssFeed(this.selectedPath!);
+ await this.runTask();
+ }
+
async changePreference(key: string, value: any) {
await api.setPreferences({
[key]: value,
diff --git a/src/locale/en.ts b/src/locale/en.ts
index 8c2973b..0d6bda8 100644
--- a/src/locale/en.ts
+++ b/src/locale/en.ts
@@ -19,6 +19,7 @@ export default {
reset: 'Reset',
login: 'Login',
search: 'Search',
+ refresh: 'Refresh',
location: 'Location',
reannounce: 'Reannounce',
diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts
index 71729b3..7e5c6cd 100644
--- a/src/locale/zh-CN.ts
+++ b/src/locale/zh-CN.ts
@@ -19,6 +19,7 @@ export default {
reset: '重置',
login: '登录',
search: '搜索',
+ refresh: '刷新',
location: '位置',
reannounce: '重新通告',