mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
web: fix starting/stopping daemons
Just a simple change from listview to gridview here.
This commit is contained in:
parent
42b8af25aa
commit
881bcee160
1 changed files with 6 additions and 5 deletions
|
@ -347,15 +347,16 @@ Ext.define('Deluge.ConnectionManager', {
|
|||
|
||||
// private
|
||||
onStopClick: function(button, e) {
|
||||
var connection = this.grid.getSelectedRecords()[0];
|
||||
if (!connection) return;
|
||||
var sm = this.grid.getSelectionModel(),
|
||||
selected = sm.getLastSelected();
|
||||
if (!selected) return;
|
||||
|
||||
if (connection.get('status') == 'Offline') {
|
||||
if (selected.get('status') == 'Offline') {
|
||||
// This means we need to start the daemon
|
||||
deluge.client.web.start_daemon(connection.get('port'));
|
||||
deluge.client.web.start_daemon(selected.get('port'));
|
||||
} else {
|
||||
// This means we need to stop the daemon
|
||||
deluge.client.web.stop_daemon(connection.id, {
|
||||
deluge.client.web.stop_daemon(selected.getId(), {
|
||||
success: function(result) {
|
||||
if (!result[0]) {
|
||||
Ext.MessageBox.show({
|
||||
|
|
Loading…
Add table
Reference in a new issue