mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Handle db update errors better in the installer (#9701)
* Handle db update errors better in the installer * show retry button on error, add exclamation point so we don't do that accidentally
This commit is contained in:
@@ -57,12 +57,15 @@ $db_vars = array(
|
||||
]);
|
||||
|
||||
|
||||
\Artisan::call('migrate', ['--seed' => true, '--force' => true , '--database' => 'setup']);
|
||||
$fp = \Artisan::output();
|
||||
echo "Starting Update...\n";
|
||||
try {
|
||||
$ret = \Artisan::call('migrate', ['--seed' => true, '--force' => true, '--database' => 'setup']);
|
||||
|
||||
if ($fp) {
|
||||
echo $fp;
|
||||
echo \Artisan::output();
|
||||
|
||||
echo $ret == 0 ? "\n\nSuccess!" : "\n\nError!";
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . "\n\nError!";
|
||||
}
|
||||
|
||||
ob_end_flush();
|
||||
|
@@ -318,6 +318,10 @@ echo "</td></tr>";
|
||||
xhr.onprogress = function (e) {
|
||||
output.innerHTML = e.currentTarget.responseText;
|
||||
output.scrollTop = output.scrollHeight - output.clientHeight; // scrolls the output area
|
||||
if (output.innerHTML.indexOf('Error!') !== -1) {
|
||||
// if error word in output, show the retry button
|
||||
$("#retry-btn").css("display", "");
|
||||
}
|
||||
};
|
||||
xhr.timeout = 90000; // if no response for 90s, allow the user to retry
|
||||
xhr.ontimeout = function (e) {
|
||||
|
Reference in New Issue
Block a user