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
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', [ return $this->renderPage($response->withStatus(500), 'errors/500', [
'exception' => $exception 'exception' => $exception,
'system_info' => $this->getApplicationService()->GetSystemInfo()
]); ]);
} }
} }

View File

@@ -60,7 +60,7 @@
"paths": { "paths": {
"/system/info": { "/system/info": {
"get": { "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": [ "tags": [
"System" "System"
], ],

View File

@@ -71,7 +71,9 @@ class ApplicationService extends BaseService
return [ return [
'grocy_version' => $this->GetInstalledVersion(), 'grocy_version' => $this->GetInstalledVersion(),
'php_version' => phpversion(), '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> <p>
PHP Version <code>{{ $system_info['php_version'] }}</code><br> 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>
<p> <p>

View File

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