mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
New: show indicator when testing indexers, connections and download clients
This commit is contained in:
@@ -16,9 +16,10 @@ define([
|
||||
template: 'Settings/Notifications/Edit/NotificationEditViewTemplate',
|
||||
|
||||
ui: {
|
||||
onDownloadToggle: '.x-on-download',
|
||||
onUpgradeSection: '.x-on-upgrade'
|
||||
},
|
||||
onDownloadToggle : '.x-on-download',
|
||||
onUpgradeSection : '.x-on-upgrade',
|
||||
indicator : '.x-indicator'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-save' : '_save',
|
||||
@@ -39,6 +40,8 @@ define([
|
||||
},
|
||||
|
||||
_save: function () {
|
||||
this.ui.indicator.show();
|
||||
|
||||
var self = this;
|
||||
var promise = this.model.save();
|
||||
|
||||
@@ -47,10 +50,16 @@ define([
|
||||
self.targetCollection.add(self.model, { merge: true });
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
});
|
||||
|
||||
promise.fail(function () {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_saveAndAdd: function () {
|
||||
this.ui.indicator.show();
|
||||
|
||||
var self = this;
|
||||
var promise = this.model.save();
|
||||
|
||||
@@ -60,6 +69,10 @@ define([
|
||||
|
||||
require('Settings/Notifications/Add/NotificationSchemaModal').open(self.targetCollection);
|
||||
});
|
||||
|
||||
promise.fail(function () {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -83,7 +96,13 @@ define([
|
||||
},
|
||||
|
||||
_test: function () {
|
||||
this.model.test();
|
||||
var self = this;
|
||||
|
||||
this.ui.indicator.show();
|
||||
|
||||
this.model.test().always(function () {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
},
|
||||
|
||||
_onDownloadChanged: function () {
|
||||
|
Reference in New Issue
Block a user