2014-08-20 23:03:12 +08:00
|
|
|
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
|
|
|
|
2014-09-05 06:49:03 +08:00
|
|
|
(function () {
|
2014-08-25 23:49:01 +08:00
|
|
|
|
|
|
|
'use strict';
|
2014-08-20 23:03:12 +08:00
|
|
|
|
|
|
|
var
|
2014-08-25 23:49:01 +08:00
|
|
|
_ = require('_'),
|
|
|
|
ko = require('ko'),
|
2014-08-25 15:10:51 +08:00
|
|
|
|
2014-09-06 05:44:29 +08:00
|
|
|
AbstractData = require('Storage/AbstractData')
|
2014-08-20 23:03:12 +08:00
|
|
|
;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @constructor
|
|
|
|
* @extends AbstractData
|
|
|
|
*/
|
2014-09-06 05:44:29 +08:00
|
|
|
function DataAdminStorage()
|
2014-08-20 23:03:12 +08:00
|
|
|
{
|
|
|
|
AbstractData.call(this);
|
|
|
|
|
|
|
|
this.domains = ko.observableArray([]);
|
2014-10-04 19:58:01 +08:00
|
|
|
this.domains.loading = ko.observable(false).extend({'throttle': 100});
|
2014-08-20 23:03:12 +08:00
|
|
|
|
|
|
|
this.plugins = ko.observableArray([]);
|
2014-10-04 19:58:01 +08:00
|
|
|
this.plugins.loading = ko.observable(false).extend({'throttle': 100});
|
2014-08-20 23:03:12 +08:00
|
|
|
|
|
|
|
this.packagesReal = ko.observable(true);
|
|
|
|
this.packagesMainUpdatable = ko.observable(true);
|
|
|
|
this.packages = ko.observableArray([]);
|
2014-10-04 19:58:01 +08:00
|
|
|
this.packages.loading = ko.observable(false).extend({'throttle': 100});
|
2014-08-20 23:03:12 +08:00
|
|
|
|
|
|
|
this.coreReal = ko.observable(true);
|
2014-12-02 01:34:21 +08:00
|
|
|
this.coreChannel = ko.observable('stable');
|
|
|
|
this.coreType = ko.observable('stable');
|
2014-08-20 23:03:12 +08:00
|
|
|
this.coreUpdatable = ko.observable(true);
|
|
|
|
this.coreAccess = ko.observable(true);
|
|
|
|
this.coreChecking = ko.observable(false).extend({'throttle': 100});
|
|
|
|
this.coreUpdating = ko.observable(false).extend({'throttle': 100});
|
|
|
|
this.coreRemoteVersion = ko.observable('');
|
|
|
|
this.coreRemoteRelease = ko.observable('');
|
|
|
|
this.coreVersionCompare = ko.observable(-2);
|
|
|
|
|
|
|
|
this.licensing = ko.observable(false);
|
|
|
|
this.licensingProcess = ko.observable(false);
|
|
|
|
this.licenseValid = ko.observable(false);
|
|
|
|
this.licenseExpired = ko.observable(0);
|
|
|
|
this.licenseError = ko.observable('');
|
|
|
|
|
|
|
|
this.licenseTrigger = ko.observable(false);
|
|
|
|
|
|
|
|
this.adminManLoading = ko.computed(function () {
|
2014-10-04 20:07:12 +08:00
|
|
|
return '000' !== [this.domains.loading() ? '1' : '0', this.plugins.loading() ? '1' : '0', this.packages.loading() ? '1' : '0'].join('');
|
2014-08-20 23:03:12 +08:00
|
|
|
}, this);
|
|
|
|
|
|
|
|
this.adminManLoadingVisibility = ko.computed(function () {
|
|
|
|
return this.adminManLoading() ? 'visible' : 'hidden';
|
|
|
|
}, this).extend({'rateLimit': 300});
|
|
|
|
}
|
|
|
|
|
2014-09-06 05:44:29 +08:00
|
|
|
_.extend(DataAdminStorage.prototype, AbstractData.prototype);
|
2014-08-20 23:03:12 +08:00
|
|
|
|
2014-09-06 05:44:29 +08:00
|
|
|
DataAdminStorage.prototype.populateDataOnStart = function()
|
2014-08-20 23:03:12 +08:00
|
|
|
{
|
|
|
|
AbstractData.prototype.populateDataOnStart.call(this);
|
|
|
|
};
|
|
|
|
|
2014-09-06 05:44:29 +08:00
|
|
|
module.exports = new DataAdminStorage();
|
2014-08-20 23:03:12 +08:00
|
|
|
|
2014-09-05 06:49:03 +08:00
|
|
|
}());
|