summaryrefslogtreecommitdiffstats
path: root/module/web/app/scripts/models/ServerStatus.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/app/scripts/models/ServerStatus.js')
-rw-r--r--module/web/app/scripts/models/ServerStatus.js47
1 files changed, 0 insertions, 47 deletions
diff --git a/module/web/app/scripts/models/ServerStatus.js b/module/web/app/scripts/models/ServerStatus.js
deleted file mode 100644
index 59739b41e..000000000
--- a/module/web/app/scripts/models/ServerStatus.js
+++ /dev/null
@@ -1,47 +0,0 @@
-define(['jquery', 'backbone', 'underscore'],
- function($, Backbone, _) {
- 'use strict';
-
- return Backbone.Model.extend({
-
- defaults: {
- speed: 0,
- linkstotal: 0,
- linksqueue: 0,
- sizetotal: 0,
- sizequeue: 0,
- notifications: -1,
- paused: false,
- download: false,
- reconnect: false
- },
-
- // Model Constructor
- initialize: function() {
-
- },
-
- fetch: function(options) {
- options || (options = {});
- options.url = 'api/getServerStatus';
-
- return Backbone.Model.prototype.fetch.call(this, options);
- },
-
- toJSON: function(options) {
- var obj = Backbone.Model.prototype.toJSON.call(this, options);
-
- obj.linksdone = obj.linkstotal - obj.linksqueue;
- obj.sizedone = obj.sizetotal - obj.sizequeue;
- if (obj.speed && obj.speed > 0)
- obj.eta = Math.round(obj.sizequeue / obj.speed);
- else if (obj.sizequeue > 0)
- obj.eta = Infinity;
- else
- obj.eta = 0;
-
- return obj;
- }
-
- });
- }); \ No newline at end of file