From ed3e8184136ef5cee424a5cc80b107751a3d2a6d Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Mon, 15 Jun 2020 21:30:39 -0500 Subject: [PATCH] db in one refactor --- resources/lang/en/install.php | 2 +- resources/views/install/database.blade.php | 58 ++++++++++++++++++++ resources/views/install/migrate.blade.php | 63 ---------------------- resources/views/layouts/install.blade.php | 15 ++---- 4 files changed, 63 insertions(+), 75 deletions(-) delete mode 100644 resources/views/install/migrate.blade.php diff --git a/resources/lang/en/install.php b/resources/lang/en/install.php index 7c2b2a74f0..723d62e0d3 100644 --- a/resources/lang/en/install.php +++ b/resources/lang/en/install.php @@ -19,7 +19,7 @@ return [ 'database' => [ 'title' => 'Configure Database', 'status' => 'Status', - 'test' => 'Test', + 'test' => 'Check Connection', 'host' => 'Host', 'port' => 'Port', 'socket' => 'Unix-Socket', diff --git a/resources/views/install/database.blade.php b/resources/views/install/database.blade.php index d140cdd72d..40d92621d7 100644 --- a/resources/views/install/database.blade.php +++ b/resources/views/install/database.blade.php @@ -63,6 +63,19 @@ +
+
+ + +
+
+
+
+ +
+
@endsection @section('scripts') @@ -90,5 +103,50 @@ }, }); }); + + function run_migrations() { + var output = document.getElementById("db-update"); + var xhr = new XMLHttpRequest(); + xhr.open("GET", "{{ route('install.action.migrate') }}", true); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr.withCredentials = true; + 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", ""); + $('#error-box').append($('
@lang('install.migrate.error')
')) + } + }; + xhr.timeout = 240000; // if no response for 4m, allow the user to retry + xhr.ontimeout = function (e) { + $("#retry-btn").css("display", ""); + $('#error-box').append($('
@lang('install.migrate.timeout')
')) + }; + xhr.onreadystatechange = function () { + if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { + checkStepStatus(); + } + }; + xhr.send(); + } @endsection + +@section('style') + +@endsection diff --git a/resources/views/install/migrate.blade.php b/resources/views/install/migrate.blade.php deleted file mode 100644 index 03288ecb75..0000000000 --- a/resources/views/install/migrate.blade.php +++ /dev/null @@ -1,63 +0,0 @@ -@extends('layouts.install') - -@section('title', trans('install.migrate.title')) - -@section('content') -
-
- - -
-
-
-
- -
-
-@endsection - -@section('scripts') - -@endsection - -@section('style') - -@endsection diff --git a/resources/views/layouts/install.blade.php b/resources/views/layouts/install.blade.php index 3603f8f4bc..da8839eb1a 100644 --- a/resources/views/layouts/install.blade.php +++ b/resources/views/layouts/install.blade.php @@ -38,18 +38,11 @@ #progress-icons { background: linear-gradient(to bottom, #EEEEEE 50%, white 50%) } - .btn-circle { - background-color: #70A9A1; - border-color: #66A39B; - } - .btn-circle:hover { - background-color: #548C85; - border-color: #4D807A; - } + .btn-circle.disabled { opacity: 1; - background-color: #A6C9C5; - border-color: #9AC1BC; + background-color: #62bcca; + border-color: #64c0ce; } .install-progress { @@ -89,7 +82,7 @@