Basic way of showing installation is done is implemented

merge-requests/2/head
Mike Koch 9 years ago
parent 9d2283ecf7
commit bda53ff143

@ -69,31 +69,33 @@ function printRow($version) {
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Installation Progress</div> <div class="panel-heading">Installation Progress</div>
<table class="table table-striped" style="table-layout:fixed;"> <div id="install-information">
<thead> <table class="table table-striped" style="table-layout:fixed;">
<tr> <thead>
<th>Version</th> <tr>
<th>Status</th> <th>Version</th>
</tr> <th>Status</th>
</thead> </tr>
<tbody> </thead>
<tbody>
<?php echoInitialVersionRows($startingVersion); ?> <?php echoInitialVersionRows($startingVersion); ?>
</tbody> </tbody>
</table> </table>
<table class="table table-striped" style="table-layout: fixed"> <table class="table table-striped" style="table-layout: fixed">
<thead> <thead>
<tr> <tr>
<th>Task</th> <th>Task</th>
<th>Status</th> <th>Status</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr id="row-banmigrate"> <tr id="row-banmigrate">
<td>Migrate IP / Email Bans</td> <td>Migrate IP / Email Bans</td>
<td><i id="spinner-banmigrate" class="fa fa-spinner"></i> <span id="span-banmigrate">Waiting...</span></td> <td><i id="spinner-banmigrate" class="fa fa-spinner"></i> <span id="span-banmigrate">Waiting...</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -136,7 +136,7 @@ function appendToInstallConsole(text) {
function processUpdates(startingVersion) { function processUpdates(startingVersion) {
if (startingVersion < 1) { if (startingVersion < 1) {
startVersionUpgrade('p140'); startVersionUpgrade('p140');
executeUpdate(1000, 'p140'); executeUpdate(1, 'p140');
} else if (startingVersion < 140) { } else if (startingVersion < 140) {
startVersionUpgrade('140'); startVersionUpgrade('140');
executeUpdate(140, '140'); executeUpdate(140, '140');
@ -194,7 +194,7 @@ function migrateIpEmailBans(version, cssclass) {
markUpdateAsAttention(version); markUpdateAsAttention(version);
prepareAttentionPanel(getContentForMigratePrompt(parsedData.users)); prepareAttentionPanel(getContentForMigratePrompt(parsedData.users));
} else { } else {
markUpdateAsSuccess(version); migrateComplete();
} }
//if ask user, markUpdateAsAttention and append to Attention! div //if ask user, markUpdateAsAttention and append to Attention! div
//otherwise, mark success and move to completion script. //otherwise, mark success and move to completion script.
@ -206,6 +206,11 @@ function migrateIpEmailBans(version, cssclass) {
}); });
} }
function installationFinished() {
var html = '<p>Hey! We finished!</p>';
$('#install-information').html(html);
}
function getContentForMigratePrompt(users) { function getContentForMigratePrompt(users) {
var beginningText = '<h2>Migrating IP / E-mail Bans</h2><p>Mods for HESK has detected that you have added IP address ' + var beginningText = '<h2>Migrating IP / E-mail Bans</h2><p>Mods for HESK has detected that you have added IP address ' +
'and/or email bans using Mods for HESK. As part of the upgrade process, Mods for HESK will migrate these bans ' + 'and/or email bans using Mods for HESK. As part of the upgrade process, Mods for HESK will migrate these bans ' +
@ -218,7 +223,7 @@ function getContentForMigratePrompt(users) {
}); });
selectMarkup += '</select></div></div><br>'; selectMarkup += '</select></div></div><br>';
var submitMarkup = '<div class="row"><div class="col-md-9 col-md-offset-3 col-xs-12"><button onclick="runMigration()" class="btn btn-default">Migrate</button> ' + var submitMarkup = '<div class="row"><div class="col-md-9 col-md-offset-3 col-xs-12"><button onclick="runMigration()" class="btn btn-default">Migrate</button> ' +
'<a href="javascript:void(0)" onclick="dontMigrate()" class="btn btn-danger">Don\'t Migrate</a> </div></div>'; '<a href="javascript:void(0)" onclick="migrateComplete()" class="btn btn-danger">Don\'t Migrate</a> </div></div>';
return beginningText + selectMarkup + submitMarkup; return beginningText + selectMarkup + submitMarkup;
} }
@ -239,8 +244,7 @@ function runMigration() {
url: 'ajax/task-ajax.php', url: 'ajax/task-ajax.php',
data: { task: 'migrate-bans', user: userId }, data: { task: 'migrate-bans', user: userId },
success: function(data) { success: function(data) {
markUpdateAsSuccess('banmigrate'); migrateComplete();
//TODO cover entire install area with success message.
}, },
error: function(data) { error: function(data) {
appendToInstallConsole('ERROR: ' + data.responseText); appendToInstallConsole('ERROR: ' + data.responseText);
@ -249,4 +253,10 @@ function runMigration() {
}) })
} }
function migrateComplete() {
$('#attention-row').hide();
markUpdateAsSuccess('banmigrate');
installationFinished();
}
jQuery(document).ready(loadJquery); jQuery(document).ready(loadJquery);

Loading…
Cancel
Save