mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Merge pull request #4162 from beganovich/v2-fix-setup-buttons
(v5) Setup fixes & improvements
This commit is contained in:
commit
1e10f0297b
@ -137,6 +137,7 @@ class SetupController extends Controller
|
||||
/**
|
||||
* Return status based on check of database connection.
|
||||
*
|
||||
* @param CheckDatabaseRequest $request
|
||||
* @return Response
|
||||
*/
|
||||
public function checkDB(CheckDatabaseRequest $request): Response
|
||||
@ -147,7 +148,7 @@ class SetupController extends Controller
|
||||
return response([], 200);
|
||||
}
|
||||
|
||||
return response([], 400);
|
||||
return response($status, 400);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,6 +167,7 @@ class SystemHealth
|
||||
} catch (\Exception $e) {
|
||||
$result[] = [config('database.connections.'.config('database.default').'.database') => false];
|
||||
$result['success'] = false;
|
||||
$result['message'] = $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
foreach (MultiDB::$dbs as $db) {
|
||||
|
2
public/js/setup/setup.js
vendored
2
public/js/setup/setup.js
vendored
File diff suppressed because one or more lines are too long
@ -16,6 +16,6 @@
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=1c5d76fb5f98bd49f6c8",
|
||||
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=bf87649ca30c9a3fba59",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=df93e290245c26694fdb",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=c4cd098778bf824a3470",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=9561e6b4d2cc26f85d17",
|
||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
|
||||
}
|
||||
|
6
resources/js/setup/setup.js
vendored
6
resources/js/setup/setup.js
vendored
@ -32,7 +32,7 @@ class Setup {
|
||||
|
||||
Axios.post('/setup/check_db', data)
|
||||
.then((response) => this.handleSuccess(this.checkDbAlert))
|
||||
.catch((e) => this.handleFailure(this.checkDbAlert));
|
||||
.catch((e) => this.handleFailure(this.checkDbAlert, e.response.data.message));
|
||||
}
|
||||
|
||||
handleSmtpCheck() {
|
||||
@ -73,9 +73,9 @@ class Setup {
|
||||
element.classList.add('alert-success');
|
||||
}
|
||||
|
||||
handleFailure(element) {
|
||||
handleFailure(element, message = null) {
|
||||
element.classList.remove('alert-success');
|
||||
element.innerText = "Oops, looks like something isn't correct!";
|
||||
element.innerText = message ? message : "Oops, looks like something isn't correct!";
|
||||
element.classList.add('alert-failure');
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||
<button type="button" class="button button-primary py-2 px-3 text-xs" id="test-pdf">
|
||||
<button type="button" class="button button-primary bg-blue-600 py-2 px-3 text-xs" id="test-pdf">
|
||||
{{ ctrans('texts.test_pdf') }}
|
||||
</button>
|
||||
</dt>
|
||||
|
@ -67,7 +67,7 @@ FLUSH PRIVILEGES;
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||
<button type="button" class="button button-primary py-2 px-3 text-xs" id="test-db-connection">
|
||||
<button type="button" class="button button-primary bg-blue-600 py-2 px-3 text-xs" id="test-db-connection">
|
||||
{{ ctrans('texts.test_connection') }}
|
||||
</button>
|
||||
</dt>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||
<button type="button" class="button button-primary py-2 px-3 text-xs" id="test-smtp-connection">
|
||||
<button type="button" class="button button-primary bg-blue-600 py-2 px-3 text-xs" id="test-smtp-connection">
|
||||
{{ ctrans('texts.send_test_email') }}
|
||||
</button>
|
||||
</dt>
|
||||
|
@ -66,7 +66,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="button button-primary w-1/2 my-4">{{ ctrans('texts.submit') }}</button>
|
||||
<button type="submit" class="button button-primary bg-blue-600 w-1/2 my-4">{{ ctrans('texts.submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
Loading…
Reference in New Issue
Block a user