merged "Sync local document" into "Test sync"

This commit is contained in:
azivner
2018-09-10 20:05:10 +02:00
parent b4a566df9e
commit e4381d10e8
7 changed files with 70 additions and 68 deletions

View File

@@ -223,7 +223,6 @@ addTabHandler((function() {
const $syncServerTimeout = $("#sync-server-timeout");
const $syncProxy = $("#sync-proxy");
const $testSyncButton = $("#test-sync-button");
const $syncToServerButton = $("#sync-to-server-button");
function optionsLoaded(options) {
$syncServerHost.val(options['syncServerHost']);
@@ -244,25 +243,14 @@ addTabHandler((function() {
$testSyncButton.click(async () => {
const result = await server.post('sync/test');
if (result.connection === "Success") {
infoService.showMessage("Sync server handshake has been successful");
if (result.success) {
infoService.showMessage(result.message);
}
else {
infoService.showError("Sync server handshake failed, error: " + result.error);
}
});
$syncToServerButton.click(async () => {
const resp = await server.post("setup/sync-to-server");
if (resp.success) {
infoService.showMessage("Sync has been established to the server instance. It will take some time to finish.");
}
else {
infoService.showError('Sync setup failed: ' + resp.error);
}
});
return {
optionsLoaded
};