summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/models
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-10-03 19:21:05 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-10-03 19:21:05 +0200
commita8d3e8341eee6af4c778f512d7f8584c476d49fe (patch)
tree777681f695f64488c4aa5e869cf937112077befc /pyload/web/app/scripts/models
parentsmall bug fixes (diff)
downloadpyload-a8d3e8341eee6af4c778f512d7f8584c476d49fe.tar.xz
basically working web setup
Diffstat (limited to 'pyload/web/app/scripts/models')
-rw-r--r--pyload/web/app/scripts/models/Setup.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/models/Setup.js b/pyload/web/app/scripts/models/Setup.js
index 82a2978db..424edf452 100644
--- a/pyload/web/app/scripts/models/Setup.js
+++ b/pyload/web/app/scripts/models/Setup.js
@@ -4,10 +4,30 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'],
return Backbone.Model.extend({
+ url: App.apiUrl('setup'),
defaults: {
lang: 'en',
+ system: null,
+ deps: null,
user: null,
password: null
+ },
+
+ fetch: function(options) {
+ options || (options = {});
+ options.url = App.apiUrl('setup');
+ return Backbone.Model.prototype.fetch.call(this, options);
+ },
+
+ // will get a 409 on success
+ submit: function(options) {
+ options || (options = {});
+ options.url = App.apiUrl('setup_done');
+ options.data = {
+ user: this.get('user'),
+ password: this.get('password')
+ };
+ return Backbone.Model.prototype.fetch.call(this, options);
}
});