mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
#98, working sync setup from server to desktop instance + refactoring of DB initialization
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import server from './services/server.js';
|
||||
import utils from "./services/utils.js";
|
||||
|
||||
function SetupModel() {
|
||||
@@ -56,7 +55,8 @@ function SetupModel() {
|
||||
return;
|
||||
}
|
||||
|
||||
server.post('setup', {
|
||||
// not using server.js because it loads too many dependencies
|
||||
$.post('/api/setup/new-document', {
|
||||
username: username,
|
||||
password: password1
|
||||
}).then(() => {
|
||||
@@ -83,7 +83,17 @@ function SetupModel() {
|
||||
return;
|
||||
}
|
||||
|
||||
showAlert("All OK");
|
||||
// not using server.js because it loads too many dependencies
|
||||
$.post('/api/setup/sync-from-server', {
|
||||
serverAddress: serverAddress,
|
||||
username: username,
|
||||
password: password
|
||||
}).then(() => {
|
||||
window.location.replace("/");
|
||||
}).catch((err) => {
|
||||
alert("Error, see dev console for details.");
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user