mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-10 10:26:46 +00:00
rearrange the details module to make it more managable
This commit is contained in:
parent
4b711883cb
commit
6adada01e4
@ -1,43 +1,103 @@
|
|||||||
Deluge.Details = new Ext.TabPanel({
|
Deluge.Details = {}
|
||||||
region: 'south',
|
|
||||||
split: true,
|
|
||||||
height: 200,
|
|
||||||
minSize: 100,
|
|
||||||
collapsible: true,
|
|
||||||
title: 'Details',
|
|
||||||
margins: '0 5 5 5',
|
|
||||||
activeTab: 0,
|
|
||||||
items: [{
|
|
||||||
id: 'status',
|
|
||||||
title: 'Status'
|
|
||||||
},{
|
|
||||||
id: 'details',
|
|
||||||
title: 'Details'
|
|
||||||
},{
|
|
||||||
id: 'files',
|
|
||||||
title: 'Files'
|
|
||||||
},{
|
|
||||||
id: 'peers',
|
|
||||||
title: 'Peers'
|
|
||||||
},{
|
|
||||||
id: 'options',
|
|
||||||
title: 'Options'
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
|
|
||||||
Deluge.Details.StatusProgressBar = new Ext.ProgressBar({
|
Deluge.Details.Status = {
|
||||||
text: "0% Stopped",
|
onRender: function(panel) {
|
||||||
id: "pbar-status",
|
this.panel = panel;
|
||||||
cls: 'deluge-status-progressbar'
|
this.progressBar = new Ext.ProgressBar({
|
||||||
});
|
text: "0% Stopped",
|
||||||
Deluge.Details.Status = Deluge.Details.items.get('status');
|
id: "pbar-status",
|
||||||
Deluge.Details.Status.add(Deluge.Details.StatusProgressBar);
|
cls: 'deluge-status-progressbar'
|
||||||
Deluge.Details.Status.add({
|
});
|
||||||
id: 'status-details',
|
this.panel.add(this.progressBar);
|
||||||
cls: 'deluge-status',
|
this.panel.add({
|
||||||
border: false
|
id: 'status-details',
|
||||||
});
|
cls: 'deluge-status',
|
||||||
|
border: false,
|
||||||
Deluge.Details.update = function(torrentId) {
|
listeners: {'render': Deluge.Details.Status.onStatusRender}
|
||||||
Deluge.Details.getActiveTab().update(torrent);
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onStatusRender: function(panel) {
|
||||||
|
this.status = panel;
|
||||||
|
this.status.load({
|
||||||
|
url: "/render/tab_statistics.html",
|
||||||
|
text: _("Loading") + "...",
|
||||||
|
callback: this.onStatusLoaded
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onStatusLoaded: function() {
|
||||||
|
alert("loaded");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Deluge.Details.Details = {
|
||||||
|
onRender: function(panel) {
|
||||||
|
this.panel = panel.load({
|
||||||
|
url: "/render/tab_details.html"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$extend(Deluge.Details, {
|
||||||
|
|
||||||
|
update: function(torrentId) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
Panel: new Ext.TabPanel({
|
||||||
|
region: 'south',
|
||||||
|
split: true,
|
||||||
|
height: 200,
|
||||||
|
minSize: 100,
|
||||||
|
collapsible: true,
|
||||||
|
margins: '0 5 5 5',
|
||||||
|
activeTab: 0,
|
||||||
|
items: [{
|
||||||
|
id: 'status',
|
||||||
|
title: _('Status'),
|
||||||
|
listeners: {'render': Deluge.Details.Status.onRender}
|
||||||
|
},{
|
||||||
|
id: 'details',
|
||||||
|
title: _('Details'),
|
||||||
|
listeners: {'render': Deluge.Details.Details.onRender}
|
||||||
|
},{
|
||||||
|
id: 'files',
|
||||||
|
title: _('Files')
|
||||||
|
},{
|
||||||
|
id: 'peers',
|
||||||
|
title: _('Peers')
|
||||||
|
},{
|
||||||
|
id: 'options',
|
||||||
|
title: _('Options')
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
/*Deluge.Details.Status = {
|
||||||
|
onShow: function(panel) {
|
||||||
|
this.panel = panel;
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize: function() {
|
||||||
|
this.Panel = Deluge.Details.Panel.items.get('status');
|
||||||
|
this.ProgressBar = new Ext.ProgressBar({
|
||||||
|
text: "0% Stopped",
|
||||||
|
id: "pbar-status",
|
||||||
|
cls: 'deluge-status-progressbar'
|
||||||
|
});
|
||||||
|
this.Panel.add(this.ProgressBar);
|
||||||
|
|
||||||
|
|
||||||
|
this.Panel.add({
|
||||||
|
id: 'status-details',
|
||||||
|
cls: 'deluge-status',
|
||||||
|
border: false
|
||||||
|
});
|
||||||
|
|
||||||
|
//this.Details = Deluge.Details.Status.Panel.items.get("status-details").load({
|
||||||
|
// url: "/render/tab_statistics.html"
|
||||||
|
//});
|
||||||
|
|
||||||
|
}
|
||||||
|
}*/
|
@ -7,7 +7,7 @@ Deluge.Ui = {
|
|||||||
title: 'Deluge',
|
title: 'Deluge',
|
||||||
layout: 'border',
|
layout: 'border',
|
||||||
tbar: Deluge.ToolBar,
|
tbar: Deluge.ToolBar,
|
||||||
items: [Deluge.SideBar, Deluge.Details, Deluge.Torrents],
|
items: [Deluge.SideBar, Deluge.Details.Panel, Deluge.Torrents],
|
||||||
bbar: Deluge.StatusBar
|
bbar: Deluge.StatusBar
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -18,10 +18,7 @@ Deluge.Ui = {
|
|||||||
|
|
||||||
Deluge.Login.Window.show();
|
Deluge.Login.Window.show();
|
||||||
Deluge.Client = new JSON.RPC('/json');
|
Deluge.Client = new JSON.RPC('/json');
|
||||||
|
Deluge.Details.initialize();
|
||||||
Deluge.Details.Status.items.get("status-details").load({
|
|
||||||
url: "/render/tab_statistics.html"
|
|
||||||
});
|
|
||||||
|
|
||||||
Deluge.SideBar = this.MainPanel.items.get('sidebar');
|
Deluge.SideBar = this.MainPanel.items.get('sidebar');
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user