mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 23:14:34 -04:00
fixes for smtp testing on setup
This commit is contained in:
parent
8ad5d14659
commit
458e207fe3
@ -176,7 +176,7 @@ class SetupController extends Controller
|
|||||||
if (count($response_array) == 0) {
|
if (count($response_array) == 0) {
|
||||||
return response([], 200);
|
return response([], 200);
|
||||||
} else {
|
} else {
|
||||||
return response()->json($response_array, 200);
|
return response()->json(['message' => $response_array[0]], 400);
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
info(['message' => $e->getMessage(), 'action' => 'SetupController::checkMail()']);
|
info(['message' => $e->getMessage(), 'action' => 'SetupController::checkMail()']);
|
||||||
|
@ -221,10 +221,9 @@ class SystemHealth
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Mail::to(config('mail.from.address'))
|
Mail::to(config('mail.from.address'))->send(new TestMailServer('Email Server Works!', config('mail.from.address')));
|
||||||
->send(new TestMailServer('Email Server Works!', config('mail.from.address')));
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return $e->getMessage();
|
return [$e->getMessage()];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
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
@ -15,6 +15,6 @@
|
|||||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12",
|
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12",
|
||||||
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=5c35d28cf0a3286e7c45",
|
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=5c35d28cf0a3286e7c45",
|
||||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=fa54bb4229aba6b0817c",
|
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=fa54bb4229aba6b0817c",
|
||||||
"/js/setup/setup.js": "/js/setup/setup.js?id=f42b2dee6575623822c2",
|
"/js/setup/setup.js": "/js/setup/setup.js?id=34b53878aeaca14a2b33",
|
||||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
|
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
|
||||||
}
|
}
|
||||||
|
17
resources/js/setup/setup.js
vendored
17
resources/js/setup/setup.js
vendored
@ -32,7 +32,9 @@ class Setup {
|
|||||||
|
|
||||||
Axios.post('/setup/check_db', data)
|
Axios.post('/setup/check_db', data)
|
||||||
.then((response) => this.handleSuccess(this.checkDbAlert))
|
.then((response) => this.handleSuccess(this.checkDbAlert))
|
||||||
.catch((e) => this.handleFailure(this.checkDbAlert, e.response.data.message));
|
.catch((e) =>
|
||||||
|
this.handleFailure(this.checkDbAlert, e.response.data.message)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSmtpCheck() {
|
handleSmtpCheck() {
|
||||||
@ -51,9 +53,14 @@ class Setup {
|
|||||||
.value,
|
.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.checkSmtpButton.disabled = true;
|
||||||
|
|
||||||
Axios.post('/setup/check_mail', data)
|
Axios.post('/setup/check_mail', data)
|
||||||
.then((response) => this.handleSuccess(this.checkSmtpAlert))
|
.then((response) => this.handleSuccess(this.checkSmtpAlert))
|
||||||
.catch((e) => this.handleFailure(this.checkSmtpAlert));
|
.catch((e) =>
|
||||||
|
this.handleFailure(this.checkSmtpAlert, e.response.data.message)
|
||||||
|
)
|
||||||
|
.finally(() => (this.checkSmtpButton.disabled = false));
|
||||||
}
|
}
|
||||||
|
|
||||||
handleTestPdfCheck() {
|
handleTestPdfCheck() {
|
||||||
@ -71,7 +78,7 @@ class Setup {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
this.handleFailure(this.checkPdfAlert)
|
this.handleFailure(this.checkPdfAlert);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +90,9 @@ class Setup {
|
|||||||
|
|
||||||
handleFailure(element, message = null) {
|
handleFailure(element, message = null) {
|
||||||
element.classList.remove('alert-success');
|
element.classList.remove('alert-success');
|
||||||
element.innerText = message ? message : "Oops, looks like something isn't correct!";
|
element.innerText = message
|
||||||
|
? message
|
||||||
|
: "Oops, looks like something isn't correct!";
|
||||||
element.classList.add('alert-failure');
|
element.classList.add('alert-failure');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user