trilium/src/views/setup.ejs

125 lines
5.4 KiB
Plaintext
Raw Normal View History

2017-12-04 11:29:23 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Setup</title>
</head>
<body>
2018-07-22 20:49:59 +08:00
<div id="setup-dialog" style="width: 500px; margin: auto; display:none;">
<h1>Trilium Notes setup</h1>
2017-12-04 11:29:23 +08:00
<div class="alert alert-warning" id="alert" style="display: none;">
</div>
<div id="setup-type" data-bind="visible: step() == 'setup-type'">
<div class="radio">
<label><input type="radio" name="setup-type" value="new-document" data-bind="checked: setupNewDocument">
I'm a new user and I want to create new Trilium document for my notes</label>
</div>
2018-07-22 20:49:59 +08:00
<div class="radio" data-bind="if: instanceType == 'server'">
<label><input type="radio" name="setup-type" value="sync-from-desktop" data-bind="checked: setupSyncFromDesktop">
2018-07-22 20:49:59 +08:00
I have desktop instance already and I want to setup sync with it</label>
</div>
2018-07-22 20:49:59 +08:00
<div class="radio" data-bind="if: instanceType == 'desktop'">
<label><input type="radio" name="setup-type" value="sync-from-server" data-bind="checked: setupSyncFromServer">
2018-07-22 20:49:59 +08:00
I have server instance up and I want to setup sync with it</label>
</div>
<button type="button" data-bind="disable: !setupTypeSelected(), click: selectSetupType" class="btn btn-primary">Next</button>
</div>
<div data-bind="visible: step() == 'new-document'">
2018-07-22 20:49:59 +08:00
<h2>New document</h2>
<p>You're almost done with the setup. The last thing is to choose username and password using which you'll login to the application.
This password is also used for generating encryption key which encrypts protected notes.</p>
2017-12-04 11:29:23 +08:00
<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control" data-bind="value: username" placeholder="Arbitrary string">
2017-12-04 11:29:23 +08:00
</div>
<div class="form-group">
<label for="password1">Password</label>
<input type="password" class="form-control" data-bind="value: password1" placeholder="Password">
2017-12-04 11:29:23 +08:00
</div>
<div class="form-group">
<label for="password2">Repeat password</label>
<input type="password" class="form-control" data-bind="value: password2" placeholder="Password">
2017-12-04 11:29:23 +08:00
</div>
<button type="button" data-bind="click: back" class="btn btn-default">Back</button>
&nbsp;
<button type="button" data-bind="click: finish" class="btn btn-primary">Finish setup</button>
</div>
<div data-bind="visible: step() == 'sync-from-desktop'">
2018-07-22 20:49:59 +08:00
<h2>Sync from Desktop</h2>
<p>This setup needs to be initiated from the desktop instance, please open it, go to settings in the top right, click on sync tab and then click on Setup sync with server instance.</p>
<button type="button" data-bind="click: back" class="btn btn-default">Back</button>
</div>
<div data-bind="visible: step() == 'sync-from-server'">
2018-07-22 20:49:59 +08:00
<h2>Sync from Server</h2>
<p>Please enter Trilium server address and credentials below. This will download the whole Trilium document from server and setup sync to it. Depending on the document size and your connection speed, this may take a while.</p>
<div class="form-group">
2018-07-25 14:30:41 +08:00
<label for="sync-server-host">Trilium server address</label>
<input type="text" id="syncServerHost" class="form-control" data-bind="value: syncServerHost" placeholder="https://<hostname>:<port>">
</div>
<div class="form-group">
<label for="sync-proxy">Proxy server (optional)</label>
<input type="text" id="sync-proxy" class="form-control" data-bind="value: syncProxy" placeholder="https://<hostname>:<port>">
2018-07-22 20:49:59 +08:00
</div>
<div class="form-group">
<label for="username">Username</label>
2018-07-25 14:30:41 +08:00
<input type="text" id="username" class="form-control" data-bind="value: username" placeholder="Username">
2018-07-22 20:49:59 +08:00
</div>
<div class="form-group">
<label for="password1">Password</label>
2018-07-25 14:30:41 +08:00
<input type="password" id="password1" class="form-control" data-bind="value: password1" placeholder="Password">
2018-07-22 20:49:59 +08:00
</div>
<button type="button" data-bind="click: back" class="btn btn-default">Back</button>
&nbsp;
<button type="button" data-bind="click: finish" class="btn btn-primary">Finish setup</button>
</div>
<div data-bind="visible: step() == 'sync-in-progress'">
<h2>Sync in progress</h2>
<div class="alert alert-success">Sync has been correctly set up. It will take some time for the initial sync to finish. Once it's done, you'll be redirected to the login page.</div>
<div data-bind="if: instanceType == 'desktop'">
Outstanding sync items: <strong id="outstanding-syncs">N/A</strong>
</div>
</div>
2017-12-04 11:29:23 +08:00
</div>
<script type="text/javascript">
const baseApiUrl = 'api/';
const glob = {
sourceId: ''
};
const syncInProgress = <%= syncInProgress ? 'true' : 'false' %>;
2017-12-04 11:29:23 +08:00
</script>
<!-- Required for correct loading of scripts in Electron -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="libraries/jquery.min.js"></script>
<link href="libraries/bootstrap/css/bootstrap.css" rel="stylesheet">
<script src="libraries/bootstrap/js/bootstrap.js"></script>
<script src="/libraries/knockout.min.js"></script>
2018-04-03 10:33:54 +08:00
<script src="javascripts/setup.js" type="module"></script>
2017-12-04 11:29:23 +08:00
</body>
</html>