mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Code refactoring
Fixed owncloud password encoder/decoder (#291) Fixed ckeditor in ownCloud iframe (Closes #302) Release commit
This commit is contained in:
parent
7a374ebe03
commit
06274c6a7c
112 changed files with 2667 additions and 1862 deletions
88
dev/Settings/Admin/About.js
Normal file
88
dev/Settings/Admin/About.js
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AboutAdminSetting()
|
||||
{
|
||||
var
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
this.version = ko.observable(Settings.settingsGet('Version'));
|
||||
this.access = ko.observable(!!Settings.settingsGet('CoreAccess'));
|
||||
this.errorDesc = ko.observable('');
|
||||
|
||||
this.coreReal = Data.coreReal;
|
||||
this.coreUpdatable = Data.coreUpdatable;
|
||||
this.coreAccess = Data.coreAccess;
|
||||
this.coreChecking = Data.coreChecking;
|
||||
this.coreUpdating = Data.coreUpdating;
|
||||
this.coreRemoteVersion = Data.coreRemoteVersion;
|
||||
this.coreRemoteRelease = Data.coreRemoteRelease;
|
||||
this.coreVersionCompare = Data.coreVersionCompare;
|
||||
|
||||
this.statusType = ko.computed(function () {
|
||||
|
||||
var
|
||||
sType = '',
|
||||
iVersionCompare = this.coreVersionCompare(),
|
||||
bChecking = this.coreChecking(),
|
||||
bUpdating = this.coreUpdating(),
|
||||
bReal = this.coreReal()
|
||||
;
|
||||
|
||||
if (bChecking)
|
||||
{
|
||||
sType = 'checking';
|
||||
}
|
||||
else if (bUpdating)
|
||||
{
|
||||
sType = 'updating';
|
||||
}
|
||||
else if (bReal && 0 === iVersionCompare)
|
||||
{
|
||||
sType = 'up-to-date';
|
||||
}
|
||||
else if (bReal && -1 === iVersionCompare)
|
||||
{
|
||||
sType = 'available';
|
||||
}
|
||||
else if (!bReal)
|
||||
{
|
||||
sType = 'error';
|
||||
this.errorDesc('Cannot access the repository at the moment.');
|
||||
}
|
||||
|
||||
return sType;
|
||||
|
||||
}, this);
|
||||
}
|
||||
|
||||
AboutAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
if (this.access())
|
||||
{
|
||||
require('App/Admin').reloadCoreData();
|
||||
}
|
||||
};
|
||||
|
||||
AboutAdminSetting.prototype.updateCoreData = function ()
|
||||
{
|
||||
if (!this.coreUpdating())
|
||||
{
|
||||
require('App/Admin').updateCoreData();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = AboutAdminSetting;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue