rename info service to toast service

This commit is contained in:
zadam
2019-10-20 10:00:18 +02:00
parent 1903c59163
commit 78f5b7b288
26 changed files with 92 additions and 92 deletions

View File

@@ -1,5 +1,5 @@
import server from "../../services/server.js";
import infoService from "../../services/info.js";
import toastService from "../../services/toast.js";
export default class AdvancedOptions {
constructor() {
@@ -13,26 +13,26 @@ export default class AdvancedOptions {
this.$forceFullSyncButton.click(async () => {
await server.post('sync/force-full-sync');
infoService.showMessage("Full sync triggered");
toastService.showMessage("Full sync triggered");
});
this.$fillSyncRowsButton.click(async () => {
await server.post('sync/fill-sync-rows');
infoService.showMessage("Sync rows filled successfully");
toastService.showMessage("Sync rows filled successfully");
});
this.$anonymizeButton.click(async () => {
await server.post('anonymization/anonymize');
infoService.showMessage("Created anonymized database");
toastService.showMessage("Created anonymized database");
});
this.$cleanupSoftDeletedButton.click(async () => {
if (confirm("Do you really want to clean up soft-deleted items?")) {
await server.post('cleanup/cleanup-soft-deleted-items');
infoService.showMessage("Soft deleted items have been cleaned up");
toastService.showMessage("Soft deleted items have been cleaned up");
}
});
@@ -40,14 +40,14 @@ export default class AdvancedOptions {
if (confirm("Do you really want to clean up unused images?")) {
await server.post('cleanup/cleanup-unused-images');
infoService.showMessage("Unused images have been cleaned up");
toastService.showMessage("Unused images have been cleaned up");
}
});
this.$vacuumDatabaseButton.click(async () => {
await server.post('cleanup/vacuum-database');
infoService.showMessage("Database has been vacuumed");
toastService.showMessage("Database has been vacuumed");
});
}
}

View File

@@ -1,6 +1,6 @@
import server from "../../services/server.js";
import protectedSessionHolder from "../../services/protected_session_holder.js";
import infoService from "../../services/info.js";
import toastService from "../../services/toast.js";
export default class ChangePasswordOptions {
constructor() {
@@ -39,7 +39,7 @@ export default class ChangePasswordOptions {
protectedSessionHolder.resetProtectedSession();
}
else {
infoService.showError(result.message);
toastService.showError(result.message);
}
});

View File

@@ -1,6 +1,6 @@
import optionsService from "../../services/options.js";
import server from "../../services/server.js";
import infoService from "../../services/info.js";
import toastService from "../../services/toast.js";
export default class ProtectedSessionOptions {
constructor() {
@@ -12,14 +12,14 @@ export default class ProtectedSessionOptions {
this.$spellCheckEnabled.change(() => {
const opts = { 'spellCheckEnabled': this.$spellCheckEnabled.is(":checked") ? "true" : "false" };
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
return false;
});
this.$spellCheckLanguageCode.change(() => {
const opts = { 'spellCheckLanguageCode': this.$spellCheckLanguageCode.val() };
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
return false;
});
@@ -30,7 +30,7 @@ export default class ProtectedSessionOptions {
server.put('options', { 'protectedSessionTimeout': protectedSessionTimeout }).then(() => {
optionsService.reloadOptions();
infoService.showMessage("Options change have been saved.");
toastService.showMessage("Options change have been saved.");
});
return false;
@@ -38,7 +38,7 @@ export default class ProtectedSessionOptions {
this.$noteRevisionsTimeInterval.change(() => {
const opts = { 'noteRevisionSnapshotTimeInterval': this.$noteRevisionsTimeInterval.val() };
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
return false;
});

View File

@@ -1,5 +1,5 @@
import server from "../../services/server.js";
import infoService from "../../services/info.js";
import toastService from "../../services/toast.js";
export default class SyncOptions {
constructor() {
@@ -15,10 +15,10 @@ export default class SyncOptions {
const result = await server.post('sync/test');
if (result.success) {
infoService.showMessage(result.message);
toastService.showMessage(result.message);
}
else {
infoService.showError("Sync server handshake failed, error: " + result.message);
toastService.showError("Sync server handshake failed, error: " + result.message);
}
});
}
@@ -36,7 +36,7 @@ export default class SyncOptions {
'syncProxy': this.$syncProxy.val()
};
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
return false;
}