mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-05 12:29:54 -06:00
"sync now" button
This commit is contained in:
20
public/javascripts/sync.js
Normal file
20
public/javascripts/sync.js
Normal file
@@ -0,0 +1,20 @@
|
||||
function syncNow() {
|
||||
$.ajax({
|
||||
url: baseApiUrl + 'sync/now',
|
||||
type: 'POST',
|
||||
success: result => {
|
||||
if (result.success) {
|
||||
alert("Sync finished successfully");
|
||||
|
||||
for (const l of result.log)
|
||||
{
|
||||
console.log(l);
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert("Sync failed");
|
||||
}
|
||||
},
|
||||
error: () => alert("Sync failed")
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user