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