snappymail/plugins/example/js/ExampleAdminSettings.js
2022-05-31 10:47:14 +02:00

37 lines
615 B
JavaScript

(rl => { if (rl) {
class ExampleAdminSettings
{
constructor()
{
this.php = ko.observable('');
this.loading = ko.observable(false);
}
onBuild()
{
this.loading(true);
rl.pluginRemoteRequest((iError, oData) => {
this.loading(false);
if (iError) {
console.error({
iError: iError,
oData: oData
});
} else {
this.php(oData.Result.PHP || '');
}
}, 'JsonAdminGetData');
}
}
rl.addSettingsViewModelForAdmin(ExampleAdminSettings, 'ExampleAdminSettingsTab',
'SETTINGS_EXAMPLE_ADMIN_EXAMPLE_TAB_PLUGIN/TAB_NAME', 'Example');
}})(window.rl);