mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Resolve Issue #104
This commit is contained in:
parent
d2550c3139
commit
fd293b723b
4 changed files with 36 additions and 26 deletions
|
|
@ -85,11 +85,11 @@ class RemoteAdminFetch extends AbstractFetchRemote {
|
|||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {string} sName
|
||||
* @param {string} sId
|
||||
*/
|
||||
plugin(fCallback, sName) {
|
||||
plugin(fCallback, sId) {
|
||||
this.defaultRequest(fCallback, 'AdminPluginLoad', {
|
||||
Name: sName
|
||||
Id: sId
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -125,12 +125,12 @@ class RemoteAdminFetch extends AbstractFetchRemote {
|
|||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {string} sName
|
||||
* @param {string} sId
|
||||
* @param {boolean} bDisabled
|
||||
*/
|
||||
pluginDisable(fCallback, sName, bDisabled) {
|
||||
pluginDisable(fCallback, sId, bDisabled) {
|
||||
this.defaultRequest(fCallback, 'AdminPluginDisable', {
|
||||
Name: sName,
|
||||
Id: sId,
|
||||
Disabled: bDisabled ? 1 : 0
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export class PackagesAdminSettings {
|
|||
// configurePlugin
|
||||
let el = event.target.closestWithin('.package-configure', oDom),
|
||||
data = el ? ko.dataFor(el) : 0;
|
||||
data && Remote.plugin((iError, data) => iError || showScreenPopup(PluginPopupView, [data.Result]), data.name)
|
||||
data && Remote.plugin((iError, data) => iError || showScreenPopup(PluginPopupView, [data.Result]), data.id)
|
||||
// disablePlugin
|
||||
el = event.target.closestWithin('.package-active', oDom);
|
||||
data = el ? ko.dataFor(el) : 0;
|
||||
|
|
@ -94,10 +94,11 @@ export class PackagesAdminSettings {
|
|||
}
|
||||
|
||||
disablePlugin(plugin) {
|
||||
let b = !plugin.enabled();
|
||||
plugin.enabled(b);
|
||||
let b = plugin.enabled();
|
||||
plugin.enabled(!b);
|
||||
Remote.pluginDisable((iError, data) => {
|
||||
if (iError) {
|
||||
plugin.enabled(b);
|
||||
this.packagesError(
|
||||
(Notification.UnsupportedPluginPackage === iError && data && data.ErrorMessage)
|
||||
? data.ErrorMessage
|
||||
|
|
@ -105,7 +106,7 @@ export class PackagesAdminSettings {
|
|||
);
|
||||
}
|
||||
// PackageAdminStore.fetch();
|
||||
}, plugin.name, !b);
|
||||
}, plugin.id, b);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class PluginPopupView extends AbstractViewPopup {
|
|||
|
||||
this.addObservables({
|
||||
saveError: '',
|
||||
id: '',
|
||||
name: '',
|
||||
readme: ''
|
||||
});
|
||||
|
|
@ -36,15 +37,17 @@ class PluginPopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
saveCommand() {
|
||||
const list = {};
|
||||
list.Name = this.name();
|
||||
const list = {
|
||||
Id: this.id(),
|
||||
Settings: {}
|
||||
};
|
||||
|
||||
this.configures.forEach(oItem => {
|
||||
let value = oItem.value();
|
||||
if (false === value || true === value) {
|
||||
value = value ? '1' : '0';
|
||||
value = value ? 1 : 0;
|
||||
}
|
||||
list['_' + oItem.Name] = value;
|
||||
list.Settings[oItem.Name] = value;
|
||||
});
|
||||
|
||||
this.saveError('');
|
||||
|
|
@ -56,11 +59,13 @@ class PluginPopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
onShow(oPlugin) {
|
||||
this.id('');
|
||||
this.name('');
|
||||
this.readme('');
|
||||
this.configures([]);
|
||||
|
||||
if (oPlugin) {
|
||||
this.id(oPlugin.Id);
|
||||
this.name(oPlugin.Name);
|
||||
this.readme(oPlugin.Readme);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue