mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
This commit is contained in:
parent
afad45137e
commit
4cc2207513
846 changed files with 99453 additions and 2123 deletions
105
dev/Admin/Packages.js
Normal file
105
dev/Admin/Packages.js
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminPackages()
|
||||
{
|
||||
var oData = RL.data();
|
||||
|
||||
this.packagesError = ko.observable('');
|
||||
|
||||
this.packages = oData.packages;
|
||||
this.packagesLoading = oData.packagesLoading;
|
||||
this.packagesReal = oData.packagesReal;
|
||||
this.packagesMainUpdatable = oData.packagesMainUpdatable;
|
||||
|
||||
this.packagesCurrent = ko.computed(function () {
|
||||
return _.filter(this.packages(), function (oItem) {
|
||||
return oItem && '' !== oItem['installed'] && !oItem['compare'];
|
||||
});
|
||||
}, this);
|
||||
|
||||
this.packagesAvailableForUpdate = ko.computed(function () {
|
||||
return _.filter(this.packages(), function (oItem) {
|
||||
return oItem && '' !== oItem['installed'] && !!oItem['compare'];
|
||||
});
|
||||
}, this);
|
||||
|
||||
this.packagesAvailableForInstallation = ko.computed(function () {
|
||||
return _.filter(this.packages(), function (oItem) {
|
||||
return oItem && '' === oItem['installed'];
|
||||
});
|
||||
}, this);
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return oData.packagesLoading() ? 'visible' : 'hidden';
|
||||
}, this);
|
||||
}
|
||||
|
||||
Utils.addSettingsViewModel(AdminPackages, 'AdminSettingsPackages', 'Packages', 'packages');
|
||||
|
||||
AdminPackages.prototype.onShow = function ()
|
||||
{
|
||||
this.packagesError('');
|
||||
};
|
||||
|
||||
AdminPackages.prototype.onBuild = function ()
|
||||
{
|
||||
RL.reloadPackagesList();
|
||||
};
|
||||
|
||||
AdminPackages.prototype.requestHelper = function (oPackage, bInstall)
|
||||
{
|
||||
var self = this;
|
||||
return function (sResult, oData) {
|
||||
|
||||
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
|
||||
{
|
||||
if (oData && oData.ErrorCode)
|
||||
{
|
||||
self.packagesError(Utils.getNotification(oData.ErrorCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
self.packagesError(Utils.getNotification(
|
||||
bInstall ? Enums.Notification.CantInstallPackage : Enums.Notification.CantDeletePackage));
|
||||
}
|
||||
}
|
||||
|
||||
_.each(RL.data().packages(), function (oItem) {
|
||||
if (oItem && oPackage && oItem['loading']() && oPackage['file'] === oItem['file'])
|
||||
{
|
||||
oPackage['loading'](false);
|
||||
oItem['loading'](false);
|
||||
}
|
||||
});
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result['Reload'])
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
RL.reloadPackagesList();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
AdminPackages.prototype.deletePackage = function (oPackage)
|
||||
{
|
||||
if (oPackage)
|
||||
{
|
||||
oPackage['loading'](true);
|
||||
RL.remote().packageDelete(this.requestHelper(oPackage, false), oPackage);
|
||||
}
|
||||
};
|
||||
|
||||
AdminPackages.prototype.installPackage = function (oPackage)
|
||||
{
|
||||
if (oPackage)
|
||||
{
|
||||
oPackage['loading'](true);
|
||||
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue