mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Delete added to indexers
This commit is contained in:
parent
1e61f501dc
commit
0ffb72bca1
@ -19,6 +19,7 @@ public IndexerModule(IIndexerService indexerService)
|
||||
GetResourceAll = GetAll;
|
||||
CreateResource = CreateIndexer;
|
||||
UpdateResource = UpdateIndexer;
|
||||
DeleteResource = DeleteIndexer;
|
||||
}
|
||||
|
||||
private List<IndexerResource> GetAll()
|
||||
@ -80,5 +81,10 @@ private Indexer GetIndexer(IndexerResource indexerResource)
|
||||
|
||||
return indexer;
|
||||
}
|
||||
|
||||
private void DeleteIndexer(int id)
|
||||
{
|
||||
_indexerService.Delete(id);
|
||||
}
|
||||
}
|
||||
}
|
@ -29,6 +29,7 @@ public interface IIndexerService
|
||||
List<Indexer> Schema();
|
||||
Indexer Create(Indexer indexer);
|
||||
Indexer Update(Indexer indexer);
|
||||
void Delete(int id);
|
||||
}
|
||||
|
||||
public class IndexerService : IIndexerService, IHandle<ApplicationStartedEvent>
|
||||
@ -81,7 +82,6 @@ public List<Indexer> Schema()
|
||||
return indexers;
|
||||
}
|
||||
|
||||
|
||||
public Indexer Create(Indexer indexer)
|
||||
{
|
||||
var definition = new IndexerDefinition
|
||||
@ -108,6 +108,11 @@ public Indexer Update(Indexer indexer)
|
||||
return indexer;
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
{
|
||||
_indexerRepository.Delete(id);
|
||||
}
|
||||
|
||||
private Indexer ToIndexer(IndexerDefinition definition)
|
||||
{
|
||||
var indexer = new Indexer();
|
||||
|
11
UI/Settings/Indexers/DeleteTemplate.html
Normal file
11
UI/Settings/Indexers/DeleteTemplate.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Delete Indexer</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to delete '{{name}}'?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal">cancel</button>
|
||||
<button class="btn btn-danger x-confirm-delete">delete</button>
|
||||
</div>
|
19
UI/Settings/Indexers/DeleteView.js
Normal file
19
UI/Settings/Indexers/DeleteView.js
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
define(['app', 'marionette'], function (App, Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Settings/Notifications/DeleteTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-confirm-delete': '_removeIndexer'
|
||||
},
|
||||
|
||||
_removeIndexer: function () {
|
||||
this.model.destroy({
|
||||
wait : true,
|
||||
success: function () {
|
||||
App.modalRegion.closeModal();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
@ -1,10 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
define(['marionette', 'Mixins/AsModelBoundView'], function (Marionette, AsModelBoundView) {
|
||||
define([
|
||||
'app',
|
||||
'marionette',
|
||||
'Settings/Notifications/DeleteView',
|
||||
'Mixins/AsModelBoundView'],
|
||||
function (App, Marionette, DeleteView, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Indexers/ItemTemplate',
|
||||
tagName : 'li'
|
||||
tagName : 'li',
|
||||
|
||||
events: {
|
||||
'click .x-delete': '_deleteIndexer'
|
||||
},
|
||||
|
||||
_deleteIndexer: function () {
|
||||
var view = new DeleteView({ model: this.model});
|
||||
App.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
|
@ -1,9 +1,9 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Remove: {{name}}</h3>
|
||||
<h3>Delete Notification</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to remove '{{name}}'?</p>
|
||||
<p>Are you sure you want to delete '{{name}}'?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal">cancel</button>
|
||||
|
@ -4,10 +4,10 @@ define(['app', 'marionette'], function (App, Marionette) {
|
||||
template: 'Settings/Notifications/DeleteTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-confirm-delete': 'removeNotification'
|
||||
'click .x-confirm-delete': '_removeNotification'
|
||||
},
|
||||
|
||||
removeNotification: function () {
|
||||
_removeNotification: function () {
|
||||
this.model.destroy({
|
||||
wait : true,
|
||||
success: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user