mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 12:32:31 +01:00
Fixed logs table, added spinner to logs refresh
This commit is contained in:
parent
4eecf3d1ab
commit
0747e53d4f
@ -11,6 +11,10 @@ define(
|
|||||||
template : 'Shared/Toolbar/ButtonTemplate',
|
template : 'Shared/Toolbar/ButtonTemplate',
|
||||||
className: 'btn',
|
className: 'btn',
|
||||||
|
|
||||||
|
ui: {
|
||||||
|
icon: 'i'
|
||||||
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click': 'onClick'
|
'click': 'onClick'
|
||||||
},
|
},
|
||||||
@ -73,7 +77,7 @@ define(
|
|||||||
|
|
||||||
var callback = this.model.get('callback');
|
var callback = this.model.get('callback');
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback.call(this.model.ownerContext);
|
callback.call(this.model.ownerContext, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,8 @@ define(
|
|||||||
'System/Logs/Files/ContentsView',
|
'System/Logs/Files/ContentsView',
|
||||||
'System/Logs/Files/ContentsModel',
|
'System/Logs/Files/ContentsModel',
|
||||||
'Shared/Toolbar/ToolbarLayout',
|
'Shared/Toolbar/ToolbarLayout',
|
||||||
'Shared/LoadingView'
|
'Shared/LoadingView',
|
||||||
|
'jQuery/jquery.spin'
|
||||||
], function (vent,
|
], function (vent,
|
||||||
Marionette,
|
Marionette,
|
||||||
Backgrid,
|
Backgrid,
|
||||||
@ -141,7 +142,8 @@ define(
|
|||||||
|
|
||||||
_refreshLogs: function () {
|
_refreshLogs: function () {
|
||||||
this.contents.close();
|
this.contents.close();
|
||||||
this.collection.fetch();
|
var promise = this.collection.fetch();
|
||||||
|
buttonContext.ui.icon.spinForPromise(promise);
|
||||||
},
|
},
|
||||||
|
|
||||||
_commandComplete: function (options) {
|
_commandComplete: function (options) {
|
||||||
|
@ -10,7 +10,8 @@ define(
|
|||||||
'Shared/Grid/Pager',
|
'Shared/Grid/Pager',
|
||||||
'System/Logs/LogsCollection',
|
'System/Logs/LogsCollection',
|
||||||
'Shared/Toolbar/ToolbarLayout',
|
'Shared/Toolbar/ToolbarLayout',
|
||||||
'Shared/LoadingView'
|
'Shared/LoadingView',
|
||||||
|
'jQuery/jquery.spin'
|
||||||
], function (vent, Marionette, Backgrid, LogTimeCell, LogLevelCell, LogRow, GridPager, LogCollection, ToolbarLayout, LoadingView) {
|
], function (vent, Marionette, Backgrid, LogTimeCell, LogLevelCell, LogRow, GridPager, LogCollection, ToolbarLayout, LoadingView) {
|
||||||
return Marionette.Layout.extend({
|
return Marionette.Layout.extend({
|
||||||
template: 'System/Logs/Table/LogsTableLayoutTemplate',
|
template: 'System/Logs/Table/LogsTableLayoutTemplate',
|
||||||
@ -65,6 +66,7 @@ define(
|
|||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
this.grid.show(new LoadingView());
|
this.grid.show(new LoadingView());
|
||||||
|
this.collection.fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
@ -115,10 +117,10 @@ define(
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
_refreshLogs: function () {
|
_refreshLogs: function (buttonContext) {
|
||||||
this.collection.state.currentPage = 1;
|
this.collection.state.currentPage = 1;
|
||||||
this.collection.fetch({ reset: true });
|
var promise = this.collection.fetch({ reset: true });
|
||||||
this._showTable();
|
buttonContext.ui.icon.spinForPromise(promise);
|
||||||
},
|
},
|
||||||
|
|
||||||
_commandComplete: function (options) {
|
_commandComplete: function (options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user