mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
refresh feeds
This commit is contained in:
parent
99c99f6923
commit
8b0d62fb15
@ -27,6 +27,7 @@ var routes []Route = []Route{
|
||||
p("/api/folders", FolderListHandler),
|
||||
p("/api/folders/:id", FolderHandler),
|
||||
p("/api/feeds", FeedListHandler),
|
||||
p("/api/feeds/refresh", FeedRefreshHandler),
|
||||
p("/api/feeds/:id", FeedHandler),
|
||||
p("/api/feeds/find", FeedHandler),
|
||||
p("/api/items", ItemListHandler),
|
||||
@ -136,6 +137,15 @@ type UpdateFeed struct {
|
||||
FolderID *int64 `json:"folder_id,omitempty"`
|
||||
}
|
||||
|
||||
func FeedRefreshHandler(rw http.ResponseWriter, req *http.Request) {
|
||||
if req.Method == "POST" {
|
||||
handler(req).fetchAllFeeds()
|
||||
rw.WriteHeader(http.StatusOK)
|
||||
} else {
|
||||
rw.WriteHeader(http.StatusMethodNotAllowed)
|
||||
}
|
||||
}
|
||||
|
||||
func FeedListHandler(rw http.ResponseWriter, req *http.Request) {
|
||||
if req.Method == "GET" {
|
||||
list := db(req).ListFeeds()
|
||||
|
@ -28,6 +28,11 @@
|
||||
Manage Feeds
|
||||
</b-dropdown-item-button>
|
||||
<b-dropdown-divider></b-dropdown-divider>
|
||||
<b-dropdown-item-button @click.stop="fetchAllFeeds()">
|
||||
<span class="icon mr-1">{% inline "rotate-cw.svg" %}</span>
|
||||
Refresh Feeds
|
||||
</b-dropdown-item-button>
|
||||
<b-dropdown-divider></b-dropdown-divider>
|
||||
<b-dropdown-header>Sort by</b-dropdown-header>
|
||||
<b-dropdown-item-button @click.stop="itemSortNewestFirst=true">
|
||||
<span class="icon mr-1" :class="{invisible: !itemSortNewestFirst}">{% inline "check.svg" %}</span>
|
||||
|
1
template/static/images/rotate-cw.svg
Normal file
1
template/static/images/rotate-cw.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>
|
After Width: | Height: | Size: 321 B |
@ -37,6 +37,9 @@
|
||||
list_items: function(id) {
|
||||
return api('get', '/api/feeds/' + id + '/items').then(json)
|
||||
},
|
||||
refresh: function() {
|
||||
return api('post', '/api/feeds/refresh')
|
||||
},
|
||||
},
|
||||
folders: {
|
||||
list: function() {
|
||||
|
@ -497,6 +497,9 @@ var vm = new Vue({
|
||||
incrFont: function(x) {
|
||||
console.log(x, this.settings.size)
|
||||
this.settings.size = +(this.settings.size + (0.1 * x)).toFixed(1)
|
||||
}
|
||||
},
|
||||
fetchAllFeeds: function() {
|
||||
api.feeds.refresh()
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user