mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 05:59:21 +03:00
es5 -> es2015 (last stage)
Signature plugin fixes Add view decorator A large number of fixes
This commit is contained in:
parent
e88c193334
commit
17669b7be0
153 changed files with 21193 additions and 21115 deletions
71
dev/Settings/Admin/Prem/Licensing.js
Normal file
71
dev/Settings/Admin/Prem/Licensing.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
|
||||
import ko from 'ko';
|
||||
|
||||
import {settingsGet} from 'Storage/Settings';
|
||||
import {showScreenPopup} from 'Knoin/Knoin';
|
||||
|
||||
import LicenseStore from 'Stores/Admin/License';
|
||||
|
||||
import {getApp} from 'Helper/Apps/Admin';
|
||||
|
||||
class LicensingPremAdminSettings
|
||||
{
|
||||
constructor() {
|
||||
this.licensing = LicenseStore.licensing;
|
||||
this.licensingProcess = LicenseStore.licensingProcess;
|
||||
this.licenseValid = LicenseStore.licenseValid;
|
||||
this.licenseExpired = LicenseStore.licenseExpired;
|
||||
this.licenseError = LicenseStore.licenseError;
|
||||
this.licenseTrigger = LicenseStore.licenseTrigger;
|
||||
|
||||
this.adminDomain = ko.observable('');
|
||||
this.subscriptionEnabled = ko.observable(!!settingsGet('SubscriptionEnabled'));
|
||||
|
||||
this.licenseTrigger.subscribe(() => {
|
||||
if (this.subscriptionEnabled())
|
||||
{
|
||||
getApp().reloadLicensing(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
if (this.subscriptionEnabled())
|
||||
{
|
||||
getApp().reloadLicensing(false);
|
||||
}
|
||||
}
|
||||
|
||||
onShow() {
|
||||
this.adminDomain(settingsGet('AdminDomain'));
|
||||
}
|
||||
|
||||
showActivationForm() {
|
||||
showScreenPopup(require('View/Popup/Activate'));
|
||||
}
|
||||
|
||||
showTrialForm() {
|
||||
showScreenPopup(require('View/Popup/Activate'), [true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
licenseIsUnlim() {
|
||||
return 1898625600 === this.licenseExpired() || 1898625700 === this.licenseExpired(); // eslint-disable-line no-magic-numbers
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
licenseExpiredMomentValue() {
|
||||
const
|
||||
moment = require('moment'),
|
||||
time = this.licenseExpired(),
|
||||
momentUnix = moment.unix(time);
|
||||
|
||||
return this.licenseIsUnlim() ? 'Never' : (time && (momentUnix.format('LL') + ' (' + momentUnix.from(moment()) + ')'));
|
||||
}
|
||||
}
|
||||
|
||||
export {LicensingPremAdminSettings, LicensingPremAdminSettings as default};
|
||||
Loading…
Add table
Add a link
Reference in a new issue