mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 01:05:49 +01:00
moved all sources to src directory
This commit is contained in:
40
src/public/javascripts/migration.js
Normal file
40
src/public/javascripts/migration.js
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
$(document).ready(() => {
|
||||
server.get('migration').then(result => {
|
||||
const appDbVersion = result.app_db_version;
|
||||
const dbVersion = result.db_version;
|
||||
|
||||
if (appDbVersion === dbVersion) {
|
||||
$("#up-to-date").show();
|
||||
}
|
||||
else {
|
||||
$("#need-to-migrate").show();
|
||||
|
||||
$("#app-db-version").html(appDbVersion);
|
||||
$("#db-version").html(dbVersion);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#run-migration").click(async () => {
|
||||
$("#run-migration").prop("disabled", true);
|
||||
|
||||
$("#migration-result").show();
|
||||
|
||||
const result = await server.post('migration');
|
||||
|
||||
for (const migration of result.migrations) {
|
||||
const row = $('<tr>')
|
||||
.append($('<td>').html(migration.db_version))
|
||||
.append($('<td>').html(migration.name))
|
||||
.append($('<td>').html(migration.success ? 'Yes' : 'No'))
|
||||
.append($('<td>').html(migration.success ? 'N/A' : migration.error));
|
||||
|
||||
if (!migration.success) {
|
||||
row.addClass("danger");
|
||||
}
|
||||
|
||||
$("#migration-table").append(row);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user