mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
UI Cleanup - Updated System, Tags and Wanted subtrees.
This commit is contained in:
parent
d6079a701c
commit
32fc68b9df
46 changed files with 1008 additions and 643 deletions
|
@ -3,43 +3,62 @@ var LogsModel = require('./LogsModel');
|
|||
var AsFilteredCollection = require('../../Mixins/AsFilteredCollection');
|
||||
var AsPersistedStateCollection = require('../../Mixins/AsPersistedStateCollection');
|
||||
|
||||
module.exports = (function(){
|
||||
var collection = PagableCollection.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/log',
|
||||
model : LogsModel,
|
||||
tableName : 'logs',
|
||||
state : {
|
||||
pageSize : 50,
|
||||
sortKey : 'time',
|
||||
order : 1
|
||||
},
|
||||
queryParams : {
|
||||
totalPages : null,
|
||||
totalRecords : null,
|
||||
pageSize : 'pageSize',
|
||||
sortKey : 'sortKey',
|
||||
order : 'sortDir',
|
||||
directions : {
|
||||
"-1" : 'asc',
|
||||
"1" : 'desc'
|
||||
}
|
||||
},
|
||||
filterModes : {
|
||||
"all" : [null, null],
|
||||
"info" : ['level', 'Info'],
|
||||
"warn" : ['level', 'Warn'],
|
||||
"error" : ['level', 'Error']
|
||||
},
|
||||
parseState : function(resp, queryParams, state){
|
||||
return {totalRecords : resp.totalRecords};
|
||||
},
|
||||
parseRecords : function(resp){
|
||||
if(resp) {
|
||||
return resp.records;
|
||||
}
|
||||
return resp;
|
||||
var collection = PagableCollection.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/log',
|
||||
model : LogsModel,
|
||||
tableName : 'logs',
|
||||
|
||||
state : {
|
||||
pageSize : 50,
|
||||
sortKey : 'time',
|
||||
order : 1
|
||||
},
|
||||
|
||||
queryParams : {
|
||||
totalPages : null,
|
||||
totalRecords : null,
|
||||
pageSize : 'pageSize',
|
||||
sortKey : 'sortKey',
|
||||
order : 'sortDir',
|
||||
directions : {
|
||||
'-1' : 'asc',
|
||||
'1' : 'desc'
|
||||
}
|
||||
});
|
||||
collection = AsFilteredCollection.apply(collection);
|
||||
return AsPersistedStateCollection.apply(collection);
|
||||
}).call(this);
|
||||
},
|
||||
|
||||
// Filter Modes
|
||||
filterModes : {
|
||||
"all" : [
|
||||
null,
|
||||
null
|
||||
],
|
||||
"info" : [
|
||||
'level',
|
||||
'Info'
|
||||
],
|
||||
"warn" : [
|
||||
'level',
|
||||
'Warn'
|
||||
],
|
||||
"error" : [
|
||||
'level',
|
||||
'Error'
|
||||
]
|
||||
},
|
||||
|
||||
parseState : function(resp, queryParams, state) {
|
||||
return { totalRecords : resp.totalRecords };
|
||||
},
|
||||
|
||||
parseRecords : function(resp) {
|
||||
if (resp) {
|
||||
return resp.records;
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
});
|
||||
|
||||
collection = AsFilteredCollection.apply(collection);
|
||||
|
||||
module.exports = AsPersistedStateCollection.apply(collection);
|
Loading…
Add table
Add a link
Reference in a new issue