|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import SettingsActions from "../actions/SettingsActions";
|
|
|
|
|
import FipamoAdminAPI from "../../libraries/FipamoAdminAPI";
|
|
|
|
|
import FipamoUtilityAPI from "../../libraries/FipamoUtilityAPI";
|
|
|
|
|
import * as DataEvent from "../../../src/com/events/DataEvent";
|
|
|
|
|
import Mailer from "../actions/Mailer";
|
|
|
|
|
import Notifications from "../ui/Notifications";
|
|
|
|
@ -88,10 +89,12 @@ export default class SettingsIndex {
|
|
|
|
|
for (i = 0, length = mailBtn.length; i < length; i++) {
|
|
|
|
|
mailBtn[i].addEventListener("click", (e) => this.handleMailOptions(e));
|
|
|
|
|
}
|
|
|
|
|
//handle backup
|
|
|
|
|
//handle backup from settings [disabled]
|
|
|
|
|
/*
|
|
|
|
|
document
|
|
|
|
|
.getElementById("create-backup")
|
|
|
|
|
.addEventListener("click", (e) => this.handleBackup(e));
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
document
|
|
|
|
@ -165,7 +168,8 @@ export default class SettingsIndex {
|
|
|
|
|
}
|
|
|
|
|
handleImageUpload(type, files) {
|
|
|
|
|
notify.alert("Uploading Image... ", null);
|
|
|
|
|
this.admin
|
|
|
|
|
let utils = new FipamoAdminAPI();
|
|
|
|
|
utils
|
|
|
|
|
.imageUpload(type, files)
|
|
|
|
|
.then((r) => {
|
|
|
|
|
if (r.type == DataEvent.AVATAR_UPLOADED) {
|
|
|
|
@ -199,24 +203,6 @@ export default class SettingsIndex {
|
|
|
|
|
notify.alert(err, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
handleBackup(e) {
|
|
|
|
|
if (this.processing) return;
|
|
|
|
|
let self = this;
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
notify.alert("Creating backup", null);
|
|
|
|
|
this.processing = true;
|
|
|
|
|
this.admin
|
|
|
|
|
.handleBackup(e.target.id, e.target.files)
|
|
|
|
|
.then((r) => {
|
|
|
|
|
self.processing = false;
|
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
self.processing = false;
|
|
|
|
|
notify.alert(err, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleReindex(e) {
|
|
|
|
|
if (this.processing) return;
|
|
|
|
|