show feeds/folders

This commit is contained in:
Nazar Kanaev 2020-07-01 20:28:36 +01:00
parent e7bfc3b0a3
commit c7a94ea890
3 changed files with 19 additions and 12 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
yarr
*.db

View File

@ -20,6 +20,11 @@
create: function(data) {
return api('post', '/api/feeds', data)
},
},
folders: {
list: function() {
return api('get', '/api/folders')
},
}
}
})()

View File

@ -8,23 +8,24 @@ var FILTERS = [
var vm = new Vue({
el: '#app',
created: function() {
var vm = this
Promise
.all([api.folders.list(), api.feeds.list()])
.then(function(values) {
vm.folders = values[0]
vm.feeds = values[1]
})
},
data: function() {
return {
'filters': FILTERS,
'filterSelected': 'all',
'folders': [
{'id': 1, 'title': 'Tech', 'is_expanded': false},
{'id': 2, 'title': 'News', 'is_expanded': true},
],
'feeds': [
{'id': '1', 'title': 'news.ycombinator.com', 'folder_id': 1},
{'id': '2', 'title': 'daringfireball', 'folder_id': 1},
{'id': '3', 'title': 'BBC', 'folder_id': 2},
{'id': '4', 'title': 'The Guardian', 'folder_id': 2},
{'id': '5', 'title': 'Random Stuff', 'folder_id': null},
],
'folders': [],
'feeds': [],
'feedSelected': null,
'items': [
'items': [],
'x': [
{'id': '123', 'title': 'Apple Pulls Pocket Casts and Castro From Chinese App Store', 'status': 'unread', 'feed_id': 2, 'date': 1592250298},
{'id': '456', 'title': 'On Apple Announcing the ARM Mac Transition at WWDC This Month', 'status': 'starred', 'feed_id': 2, 'date': 1592250298},
{'id': '789', 'title': 'Marques Brownlee: Reflecting on the Color of My Skin', 'status': 'read', 'feed_id': 2, 'date': 1592250298},