mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 21:19:19 +00:00
show loading status
This commit is contained in:
parent
44b5a6a67f
commit
d913872e76
@ -65,7 +65,7 @@ func StaticHandler(rw http.ResponseWriter, req *http.Request) {
|
||||
|
||||
func StatusHandler(rw http.ResponseWriter, req *http.Request) {
|
||||
writeJSON(rw, map[string]interface{}{
|
||||
"running": *handler(req).queueSize > 0,
|
||||
"running": *handler(req).queueSize,
|
||||
"stats": db(req).FeedStats(),
|
||||
})
|
||||
}
|
||||
|
@ -13,8 +13,10 @@
|
||||
<div class="vh-100 position-relative overflow-auto border-right flex-shrink-0" :style="{width: feedListWidth+'px'}">
|
||||
<drag :width="feedListWidth" @resize="resizeFeedList"></drag>
|
||||
<div class="px-2 toolbar d-flex align-items-center mb-3">
|
||||
<span class="icon mx-2">{% inline "anchor.svg" %}</span>
|
||||
<div class="flex-grow-1 noselect"> </div>
|
||||
<div class="icon mx-2" :class="{loading: loading.feeds}">{% inline "anchor.svg" %}</div>
|
||||
<div class="text-truncate cursor-default flex-grow-1 noselect">
|
||||
<span v-if="loading.feeds">Refreshing ({{loading.feeds}} left)</span>
|
||||
</div>
|
||||
<b-dropdown right no-caret lazy="true" variant="link" class="settings-dropdown" toggle-class="toolbar-item px-2">
|
||||
<template v-slot:button-content class="toolbar-item">
|
||||
<span class="icon">{% inline "more-horizontal.svg" %}</span>
|
||||
|
@ -142,6 +142,7 @@ var vm = new Vue({
|
||||
'itemListWidth': null,
|
||||
'settings': 'create',
|
||||
'loading': {
|
||||
'feeds': false,
|
||||
'newfeed': false,
|
||||
'items': false,
|
||||
},
|
||||
@ -272,6 +273,7 @@ var vm = new Vue({
|
||||
methods: {
|
||||
refreshStats: function() {
|
||||
api.status().then(function(data) {
|
||||
vm.loading.feeds = data.running
|
||||
if (data.running) {
|
||||
setTimeout(vm.refreshStats.bind(vm), 2000)
|
||||
}
|
||||
@ -490,7 +492,7 @@ var vm = new Vue({
|
||||
this.theme.size = +(this.theme.size + (0.1 * x)).toFixed(1)
|
||||
},
|
||||
fetchAllFeeds: function() {
|
||||
api.feeds.refresh()
|
||||
api.feeds.refresh().then(this.refreshStats.bind(this))
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user