mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
Can add indexer (in UI)
This commit is contained in:
parent
6351011cce
commit
ea929974f3
8 changed files with 168 additions and 4 deletions
|
@ -1,8 +1,32 @@
|
|||
'use strict';
|
||||
define(['app', 'Settings/Indexers/ItemView'], function () {
|
||||
define(['app',
|
||||
'Settings/Indexers/ItemView',
|
||||
'Settings/Indexers/EditView'],
|
||||
function () {
|
||||
NzbDrone.Settings.Indexers.CollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView : NzbDrone.Settings.Indexers.ItemView,
|
||||
itemViewContainer : '#x-indexers',
|
||||
template : 'Settings/Indexers/CollectionTemplate'
|
||||
template : 'Settings/Indexers/CollectionTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-add': 'openSchemaModal'
|
||||
},
|
||||
|
||||
openSchemaModal: function () {
|
||||
//TODO: Is there a better way to deal with changing URLs?
|
||||
var schema = new NzbDrone.Settings.Indexers.Collection();
|
||||
schema.url = '/api/indexer/schema';
|
||||
schema.fetch({
|
||||
success: function (collection) {
|
||||
collection.url = '/api/indexer';
|
||||
var model = _.first(collection.models);
|
||||
model.set('id', undefined);
|
||||
model.set('name', '');
|
||||
|
||||
var view = new NzbDrone.Settings.Indexers.EditView({ model: model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue