System.Logs view can now be filtered by severity.

This commit is contained in:
Taloth Saldono 2014-02-01 23:09:22 +01:00
parent af4c351428
commit 9df0ad0bf7
7 changed files with 116 additions and 25 deletions

View file

@ -4,9 +4,10 @@ define(
[
'backbone.pageable',
'System/Logs/LogsModel',
'Mixins/AsFilteredCollection',
'Mixins/AsPersistedStateCollection'
],
function (PagableCollection, LogsModel, AsPersistedStateCollection) {
function (PagableCollection, LogsModel, AsFilteredCollection, AsPersistedStateCollection) {
var collection = PagableCollection.extend({
url : window.NzbDrone.ApiRoot + '/log',
model: LogsModel,
@ -30,6 +31,14 @@ define(
}
},
// Filter Modes
filterModes: {
'all' : [null, null],
'info' : ['level', 'Info'],
'warn' : ['level', 'Warn'],
'error' : ['level', 'Error']
},
parseState: function (resp, queryParams, state) {
return {totalRecords: resp.totalRecords};
},
@ -43,5 +52,7 @@ define(
}
});
return AsPersistedStateCollection.call(collection);
collection = AsFilteredCollection.apply(collection);
return AsPersistedStateCollection.apply(collection);
});