mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-16 07:19:00 +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
|
// private
|
||||||
onStopClick: function(button, e) {
|
onStopClick: function(button, e) {
|
||||||
var connection = this.grid.getSelectedRecords()[0];
|
var sm = this.grid.getSelectionModel(),
|
||||||
if (!connection) return;
|
selected = sm.getLastSelected();
|
||||||
|
if (!selected) return;
|
||||||
|
|
||||||
if (connection.get('status') == 'Offline') {
|
if (selected.get('status') == 'Offline') {
|
||||||
// This means we need to start the daemon
|
// 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 {
|
} else {
|
||||||
// This means we need to stop the daemon
|
// 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) {
|
success: function(result) {
|
||||||
if (!result[0]) {
|
if (!result[0]) {
|
||||||
Ext.MessageBox.show({
|
Ext.MessageBox.show({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue