diff options
Diffstat (limited to 'pyload/web/app/scripts')
-rw-r--r-- | pyload/web/app/scripts/models/Account.js | 8 | ||||
-rw-r--r-- | pyload/web/app/scripts/models/StatusInfo.js (renamed from pyload/web/app/scripts/models/ServerStatus.js) | 5 | ||||
-rw-r--r-- | pyload/web/app/scripts/utils/apitypes.js | 4 | ||||
-rw-r--r-- | pyload/web/app/scripts/views/accounts/accountModal.js | 2 | ||||
-rw-r--r-- | pyload/web/app/scripts/views/headerView.js | 8 |
5 files changed, 15 insertions, 12 deletions
diff --git a/pyload/web/app/scripts/models/Account.js b/pyload/web/app/scripts/models/Account.js index 26241d8e3..b9fc40036 100644 --- a/pyload/web/app/scripts/models/Account.js +++ b/pyload/web/app/scripts/models/Account.js @@ -3,9 +3,10 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt return Backbone.Model.extend({ - idAttribute: 'loginname', + idAttribute: 'aid', defaults: { + aid: null, plugin: null, loginname: null, owner: -1, @@ -53,14 +54,15 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt var refresh = _.has(options, 'refresh') && options.refresh; options = App.apiRequest('getAccountInfo', {plugin: this.get('plugin'), - loginname: this.get('loginname'), refresh: refresh}, options); + aid: this.get('aid'), refresh: refresh}, options); return Backbone.Model.prototype.fetch.call(this, options); }, setPassword: function(password, options) { options = App.apiRequest('updateAccount', - {plugin: this.get('plugin'), loginname: this.get('loginname'), password: password}, options); + {aid: this.get('aid'), + plugin: this.get('plugin'), loginname: this.get('loginname'), password: password}, options); return $.ajax(options); }, diff --git a/pyload/web/app/scripts/models/ServerStatus.js b/pyload/web/app/scripts/models/StatusInfo.js index 59739b41e..8712defa7 100644 --- a/pyload/web/app/scripts/models/ServerStatus.js +++ b/pyload/web/app/scripts/models/StatusInfo.js @@ -13,7 +13,8 @@ define(['jquery', 'backbone', 'underscore'], notifications: -1, paused: false, download: false, - reconnect: false + reconnect: false, + quota: -1 }, // Model Constructor @@ -23,7 +24,7 @@ define(['jquery', 'backbone', 'underscore'], fetch: function(options) { options || (options = {}); - options.url = 'api/getServerStatus'; + options.url = 'api/getStatusInfo'; return Backbone.Model.prototype.fetch.call(this, options); }, diff --git a/pyload/web/app/scripts/utils/apitypes.js b/pyload/web/app/scripts/utils/apitypes.js index fc92425de..88123f7ea 100644 --- a/pyload/web/app/scripts/utils/apitypes.js +++ b/pyload/web/app/scripts/utils/apitypes.js @@ -4,9 +4,9 @@ define([], function() { 'use strict'; return { DownloadState: {'Failed': 3, 'All': 0, 'Unmanaged': 4, 'Finished': 1, 'Unfinished': 2}, - DownloadStatus: {'NotPossible': 13, 'FileMismatch': 15, 'Downloading': 10, 'Missing': 14, 'NA': 0, 'Processing': 17, 'Waiting': 9, 'Decrypting': 16, 'Paused': 4, 'Failed': 7, 'Finished': 5, 'Skipped': 6, 'Unknown': 19, 'Aborted': 12, 'Online': 2, 'TempOffline': 11, 'Offline': 1, 'Custom': 18, 'Starting': 8, 'Queued': 3}, + DownloadStatus: {'NotPossible': 13, 'FileMismatch': 15, 'Downloading': 10, 'Missing': 14, 'NA': 0, 'Processing': 18, 'Waiting': 9, 'Decrypting': 17, 'Paused': 4, 'Failed': 7, 'Finished': 5, 'Skipped': 6, 'Unknown': 20, 'Aborted': 12, 'Online': 2, 'Starting': 8, 'TempOffline': 11, 'Offline': 1, 'Custom': 19, 'Occupied': 16, 'Queued': 3}, FileStatus: {'Remote': 2, 'Ok': 0, 'Missing': 1}, - InputType: {'PluginList': 13, 'Multiple': 11, 'Int': 2, 'NA': 0, 'Time': 7, 'List': 12, 'Bool': 8, 'File': 3, 'Text': 1, 'Table': 14, 'Folder': 4, 'Password': 6, 'Click': 9, 'Select': 10, 'Textbox': 5}, + InputType: {'PluginList': 15, 'Multiple': 13, 'TimeSpan': 8, 'Int': 2, 'ByteSize': 9, 'Time': 7, 'List': 14, 'Textbox': 5, 'Bool': 10, 'File': 3, 'NA': 0, 'Table': 16, 'Folder': 4, 'Password': 6, 'Click': 11, 'Select': 12, 'Text': 1}, Interaction: {'Captcha': 2, 'All': 0, 'Query': 4, 'Notification': 1}, MediaType: {'All': 0, 'Audio': 2, 'Image': 4, 'Executable': 64, 'Other': 1, 'Video': 8, 'Document': 16, 'Archive': 32}, PackageStatus: {'Paused': 1, 'Remote': 3, 'Folder': 2, 'Ok': 0}, diff --git a/pyload/web/app/scripts/views/accounts/accountModal.js b/pyload/web/app/scripts/views/accounts/accountModal.js index 31e05dff6..11eed1355 100644 --- a/pyload/web/app/scripts/views/accounts/accountModal.js +++ b/pyload/web/app/scripts/views/accounts/accountModal.js @@ -59,7 +59,7 @@ define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'hbs!tpl/dial password = this.$('#password').val(), self = this; - $.ajax(App.apiRequest('updateAccount', { + $.ajax(App.apiRequest('createAccount', { plugin: plugin, loginname: login, password: password }, { success: function(data) { App.vent.trigger('account:updated', data); diff --git a/pyload/web/app/scripts/views/headerView.js b/pyload/web/app/scripts/views/headerView.js index d4d07ac39..a12248a7a 100644 --- a/pyload/web/app/scripts/views/headerView.js +++ b/pyload/web/app/scripts/views/headerView.js @@ -1,8 +1,8 @@ -define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', +define(['jquery', 'underscore', 'backbone', 'app', 'models/StatusInfo', 'views/progressView', 'views/notificationView', 'helpers/formatSize', 'hbs!tpl/header/layout', 'hbs!tpl/header/status', 'hbs!tpl/header/progressbar', 'hbs!tpl/header/progressSup', 'hbs!tpl/header/progressSub' , 'flot'], function( - $, _, Backbone, App, ServerStatus, ProgressView, NotificationView, formatSize, template, templateStatus, templateProgress, templateSup, templateSub) { + $, _, Backbone, App, StatusInfo, ProgressView, NotificationView, formatSize, template, templateStatus, templateProgress, templateSup, templateSub) { 'use strict'; // Renders the header with all information return Backbone.Marionette.ItemView.extend({ @@ -47,7 +47,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', this.model = App.user; - this.status = new ServerStatus(); + this.status = new StatusInfo(); this.listenTo(this.status, 'change', this.update); this.listenTo(App.progressList, 'add', function(model) { @@ -194,7 +194,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', var data = JSON.parse(evt.data); if (data === null) return; - if (data['@class'] === 'ServerStatus') { + if (data['@class'] === 'StatusInfo') { this.status.set(data); // There tasks at the server, but not in queue: so fetch them |