summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/models/Package.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js/models/Package.js')
-rw-r--r--module/web/static/js/models/Package.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/web/static/js/models/Package.js b/module/web/static/js/models/Package.js
index 24f04519e..c5eb3eaac 100644
--- a/module/web/static/js/models/Package.js
+++ b/module/web/static/js/models/Package.js
@@ -54,6 +54,16 @@ define(['jquery', 'backbone', 'underscore', 'collections/FileList', 'require'],
return Backbone.Model.prototype.destroy.call(this, options);
},
+ restart: function(options) {
+ options || (options = {});
+ var self = this;
+ options.url = 'api/restartPackage/' + this.get('pid');
+ options.success = function() {
+ self.fetch();
+ };
+ return $.ajax(options);
+ },
+
parse: function(resp) {
// Package is loaded from tree collection
if (_.has(resp, 'root')) {
@@ -75,11 +85,6 @@ define(['jquery', 'backbone', 'underscore', 'collections/FileList', 'require'],
return Backbone.model.prototype.parse.call(this, resp);
},
- // Package data is complete when it contains collection for containing files or packs
- isLoaded: function() {
- return this.has('files');
- },
-
// Any time a model attribute is set, this method is called
validate: function(attrs) {