mirror of
https://github.com/CzBiX/qb-web.git
synced 2026-04-14 02:10:31 +08:00
10
src/Api.ts
10
src/Api.ts
@@ -230,6 +230,16 @@ class Api {
|
||||
return this.axios.post('/rss/refreshItem', data).then(Api.handleResponse);
|
||||
}
|
||||
|
||||
public moveRssFeed(path: string, newPath: string) {
|
||||
const params: any = {
|
||||
itemPath: path,
|
||||
destPath: newPath,
|
||||
}
|
||||
|
||||
const data = new URLSearchParams(params)
|
||||
return this.axios.post('/rss/moveItem', data).then(Api.handleResponse);
|
||||
}
|
||||
|
||||
public getRssRules(): Promise<{[key: string]: RssRule}> {
|
||||
return this.axios.get('/rss/rules').then(Api.handleResponse);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,14 @@
|
||||
>
|
||||
<v-icon>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
icon
|
||||
:disabled="!selectNode"
|
||||
@click="renameRssItem"
|
||||
:title="$t('rename')"
|
||||
>
|
||||
<v-icon>mdi-file-move</v-icon>
|
||||
</v-btn>
|
||||
<v-divider vertical />
|
||||
<v-btn
|
||||
icon
|
||||
@@ -379,6 +387,36 @@ export default class RssDialog extends HasTask {
|
||||
this.closeSnackBar();
|
||||
}
|
||||
|
||||
async renameRssItem() {
|
||||
const input = await this.asyncShowDialog({
|
||||
content: {
|
||||
text: tr('name'),
|
||||
type: DialogType.Input,
|
||||
value: this.selectedPath!,
|
||||
},
|
||||
})
|
||||
|
||||
if (!input) {
|
||||
return
|
||||
}
|
||||
|
||||
this.showSnackBar({
|
||||
text: tr('label.moving'),
|
||||
})
|
||||
|
||||
try {
|
||||
await api.moveRssFeed(this.selectedPath!, input);
|
||||
} catch (e) {
|
||||
this.showSnackBar({
|
||||
text: e.response ? e.response.data : e.message,
|
||||
})
|
||||
return
|
||||
}
|
||||
await this.runTask();
|
||||
|
||||
this.closeSnackBar();
|
||||
}
|
||||
|
||||
async deleteRssItem() {
|
||||
const confirm = await this.asyncShowDialog({
|
||||
content: {
|
||||
|
||||
@@ -21,6 +21,7 @@ export default {
|
||||
search: 'Search',
|
||||
refresh: 'Refresh',
|
||||
location: 'Location',
|
||||
rename: 'Rename',
|
||||
|
||||
reannounce: 'Reannounce',
|
||||
recheck: 'Recheck',
|
||||
|
||||
@@ -21,6 +21,7 @@ export default {
|
||||
search: '搜索',
|
||||
refresh: '刷新',
|
||||
location: '位置',
|
||||
rename: '重命名',
|
||||
|
||||
reannounce: '重新通告',
|
||||
recheck: '重新检查',
|
||||
|
||||
Reference in New Issue
Block a user