Changeset 244583
- Timestamp:
- 05/06/2011 10:24:00 PM (14 years ago)
- Children:
- 581349
- Parents:
- 0b8216
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/ui/web/js/deluge-all/details/PeersTab.js
r0b8216 r244583 1 1 /*! 2 2 * Deluge.details.PeersTab.js 3 * 3 * 4 4 * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> 5 5 * … … 33 33 (function() { 34 34 function flagRenderer(value) { 35 if (!value) return ''; 35 if (!value.replace(' ', '').replace(' ', '')){ 36 return ''; 37 } 36 38 return String.format('<img src="flag/{0}" />', value); 37 39 } … … 46 48 47 49 Deluge.details.PeersTab = Ext.extend(Ext.grid.GridPanel, { 48 50 49 51 // fast way to figure out if we have a peer already. 50 52 peers: {}, 51 53 52 54 constructor: function(config) { 53 55 config = Ext.apply({ … … 96 98 renderer: fspeed, 97 99 dataIndex: 'up_speed' 98 }], 100 }], 99 101 stripeRows: true, 100 102 deferredRender:false, … … 103 105 Deluge.details.PeersTab.superclass.constructor.call(this, config); 104 106 }, 105 107 106 108 clear: function() { 107 109 this.getStore().removeAll(); 108 110 this.peers = {}; 109 111 }, 110 112 111 113 update: function(torrentId) { 112 114 deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Peers, { … … 115 117 }); 116 118 }, 117 119 118 120 onRequestComplete: function(torrent, options) { 119 121 if (!torrent) return; … … 126 128 Ext.each(torrent.peers, function(peer) { 127 129 if (this.peers[peer.ip]) { 130 var record = store.getById(peer.ip); 131 record.beginEdit(); 132 for (var k in peer) { 133 if (record.get(k) != peer[k]) { 134 record.set(k, peer[k]); 135 } 136 } 137 record.endEdit(); 128 138 } else { 129 139 this.peers[peer.ip] = 1;
Note:
See TracChangeset
for help on using the changeset viewer.