diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-20 17:39:54 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-20 17:39:54 +0100 |
commit | 21047cccdb45249f76b32413c21e013d15f0bf41 (patch) | |
tree | 963875366a64de5e41d0139569f7b5dad12399ae /module/web/static/js/models/ServerStatus.js | |
parent | added models and collections for progress (diff) | |
download | pyload-21047cccdb45249f76b32413c21e013d15f0bf41.tar.xz |
removed pie charts
Diffstat (limited to 'module/web/static/js/models/ServerStatus.js')
-rw-r--r-- | module/web/static/js/models/ServerStatus.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/module/web/static/js/models/ServerStatus.js b/module/web/static/js/models/ServerStatus.js index f89282d8d..35257fcb1 100644 --- a/module/web/static/js/models/ServerStatus.js +++ b/module/web/static/js/models/ServerStatus.js @@ -1,4 +1,5 @@ -define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) { +define(['jquery', 'backbone', 'underscore', 'collections/ProgressList'], + function($, Backbone, _, ProgressList) { return Backbone.Model.extend({ @@ -14,6 +15,25 @@ define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) { // Model Constructor initialize: function() { + }, + + fetch: function() { + options || (options = {}); + options.url = 'api/getServerStatus'; + + return Backbone.Model.prototype.fetch.call(this, options); + }, + + parse: function(resp, xhr) { + // Package is loaded from tree collection + if (_.has(resp, 'root')) { + resp.root.files = new FileList(_.values(resp.files)); + // circular dependencies needs to be avoided + var PackageList = require('collections/PackageList'); + resp.root.packs = new PackageList(_.values(resp.packages)); + return resp.root; + } + return Backbone.model.prototype.fetch.call(this, resp, xhr); } }); |