Include OS and client information in easy error info copy/paste and on the about dialog

This commit is contained in:
Bernd Bestel 2021-09-20 20:16:41 +02:00
parent b9fff4954a
commit c06bb7784a
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
5 changed files with 14 additions and 4 deletions

View File

@ -77,7 +77,8 @@ class ExceptionController extends BaseApiController
}
return $this->renderPage($response->withStatus(500), 'errors/500', [
'exception' => $exception
'exception' => $exception,
'system_info' => $this->getApplicationService()->GetSystemInfo()
]);
}
}

View File

@ -60,7 +60,7 @@
"paths": {
"/system/info": {
"get": {
"summary": "Returns information about the installed grocy, PHP and SQLite version",
"summary": "Returns information about the installed grocy version, PHP runtime and OS",
"tags": [
"System"
],

View File

@ -71,7 +71,9 @@ class ApplicationService extends BaseService
return [
'grocy_version' => $this->GetInstalledVersion(),
'php_version' => phpversion(),
'sqlite_version' => $sqliteVersion
'sqlite_version' => $sqliteVersion,
'os' => php_uname('s') . ' ' . php_uname('r') . ' ' . php_uname('v') . ' ' . php_uname('m'),
'client' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknown'
];
}

View File

@ -35,7 +35,9 @@
<p>
PHP Version <code>{{ $system_info['php_version'] }}</code><br>
SQLite Version <code>{{ $system_info['sqlite_version'] }}</code>
SQLite Version <code>{{ $system_info['sqlite_version'] }}</code><br>
OS <code>{{ $system_info['os'] }}</code><br>
Client <code>{{ $system_info['client'] }}</code>
</p>
<p>

View File

@ -32,6 +32,11 @@ Error message:
Stack trace:
```
{!! $exception->getTraceAsString() !!}
```
System info:
```
{!! json_encode($system_info, JSON_PRETTY_PRINT) !!}
```
</textarea>
</div>