Fix installer

This commit is contained in:
James Cole
2023-04-15 10:14:14 +02:00
parent 82f89ef614
commit 3c20fd7533
4 changed files with 59 additions and 45 deletions

View File

@@ -23,10 +23,12 @@ $(function () {
"use strict";
//var status = $('#status-box');
// set HTML to "migrating...":
startRunningCommands();
console.log('Starting...');
startRunningCommands(0);
});
function startRunningCommands() {
function startRunningCommands(index) {
console.log('Now in startRunningCommands with index' + index);
if (0 === index) {
$('#status-box').html('<span class="fa fa-spin fa-spinner"></span> Running first command...');
}
@@ -34,7 +36,8 @@ function startRunningCommands() {
}
function runCommand(index) {
$.post(runCommandUrl, {_token: token, index: index}).done(function (data) {
console.log('Now in runCommand(' + index + '): ' + runCommandUrl);
$.post(runCommandUrl, {_token: token, index: parseInt(index)}).done(function (data) {
if (data.error === false) {
// increase index
index++;
@@ -59,7 +62,7 @@ function runCommand(index) {
}
function startMigration() {
console.log('Now in startMigration');
$.post(migrateUrl, {_token: token}).done(function (data) {
if (data.error === false) {
// move to decrypt routine.
@@ -74,6 +77,7 @@ function startMigration() {
}
function startDecryption() {
console.log('Now in startDecryption');
$('#status-box').html('<span class="fa fa-spin fa-spinner"></span> Setting up DB #2...');
$.post(decryptUrl, {_token: token}).done(function (data) {
if (data.error === false) {
@@ -151,4 +155,4 @@ function displaySoftFail(message) {
$('#status-box').html('<span class="fa fa-warning"></span> ' + message + '<br /><br />Please read the ' +
'<a href="https://docs.firefly-iii.org/">' +
'documentation</a> about this, and upgrade by hand.');
}
}