Removed pre-release special version handling

This commit is contained in:
Bernd Bestel 2023-05-24 20:32:48 +02:00
parent 8c033ff6c8
commit 70bb014c9f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
6 changed files with 11 additions and 20 deletions

View File

@ -120,7 +120,6 @@ class BaseController
$versionInfo = $this->getApplicationService()->GetInstalledVersion();
$this->View->set('version', $versionInfo->Version);
$this->View->set('releaseDate', $versionInfo->ReleaseDate);
$localizationService = $this->getLocalizationService();
$this->View->set('__t', function (string $text, ...$placeholderValues) use ($localizationService) {

View File

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

View File

@ -12,7 +12,8 @@ class SystemController extends BaseController
public function About(Request $request, Response $response, array $args)
{
return $this->renderPage($response, 'about', [
'system_info' => $this->getApplicationService()->GetSystemInfo(),
'systemInfo' => $this->getApplicationService()->GetSystemInfo(),
'versionInfo' => $this->getApplicationService()->GetInstalledVersion(),
'changelog' => $this->getApplicationService()->GetChangelog()
]);
}

View File

@ -53,15 +53,6 @@ class ApplicationService extends BaseService
if ($this->InstalledVersion == null)
{
$this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json'));
if (GROCY_MODE === 'prerelease')
{
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
$commitDate = trim(exec('git log --date=iso --pretty="%cd" -n1 HEAD'));
$this->InstalledVersion->Version = "pre-release-$commitHash";
$this->InstalledVersion->ReleaseDate = substr($commitDate, 0, 19);
}
}
return $this->InstalledVersion;

View File

@ -27,16 +27,16 @@
<div class="tab-pane show active"
id="system-info">
<p>
Version <code>{{ $version }}</code><br>
{{ $__t('Released on') }} <code>{{ $releaseDate }}</code> <time class="timeago timeago-contextual"
datetime="{{ $releaseDate }}"></time>
Version <code>{{ $versionInfo->Version }}</code><br>
{{ $__t('Released on') }} <code>{{ $versionInfo->ReleaseDate }}</code> <time class="timeago timeago-contextual"
datetime="{{ $versionInfo->ReleaseDate }}"></time>
</p>
<p>
PHP Version <code>{{ $system_info['php_version'] }}</code><br>
SQLite Version <code>{{ $system_info['sqlite_version'] }}</code><br>
OS <code>{{ $system_info['os'] }}</code><br>
Client <code>{{ $system_info['client'] }}</code>
PHP Version <code>{{ $systemInfo['php_version'] }}</code><br>
SQLite Version <code>{{ $systemInfo['sqlite_version'] }}</code><br>
OS <code>{{ $systemInfo['os'] }}</code><br>
Client <code>{{ $systemInfo['client'] }}</code>
</p>
<p>

View File

@ -36,7 +36,7 @@ Stack trace:
System info:
```
{!! json_encode($system_info, JSON_PRETTY_PRINT) !!}
{!! json_encode($systemInfo, JSON_PRETTY_PRINT) !!}
```
</textarea>
</div>