mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-30 20:38:27 +01:00
Modernize version display in UI (#16862)
Modernize version display in UI
This commit is contained in:
@@ -90,6 +90,13 @@ public sealed class SetupServer : IDisposable
|
|||||||
var fileTemplate = await File.ReadAllTextAsync(Path.Combine(AppContext.BaseDirectory, "ServerSetupApp", "index.mstemplate.html")).ConfigureAwait(false);
|
var fileTemplate = await File.ReadAllTextAsync(Path.Combine(AppContext.BaseDirectory, "ServerSetupApp", "index.mstemplate.html")).ConfigureAwait(false);
|
||||||
_startupUiRenderer = (await ParserOptionsBuilder.New()
|
_startupUiRenderer = (await ParserOptionsBuilder.New()
|
||||||
.WithTemplate(fileTemplate)
|
.WithTemplate(fileTemplate)
|
||||||
|
.WithFormatter(
|
||||||
|
(Version version, int arg) =>
|
||||||
|
{
|
||||||
|
// version type does not for some stupid reason implement IFormattable which morestachio relies on for ToString support therefor we need to do it manually.
|
||||||
|
return version.ToString(arg);
|
||||||
|
},
|
||||||
|
"ToString")
|
||||||
.WithFormatter(
|
.WithFormatter(
|
||||||
(StartupLogTopic logEntry, IEnumerable<StartupLogTopic> children) =>
|
(StartupLogTopic logEntry, IEnumerable<StartupLogTopic> children) =>
|
||||||
{
|
{
|
||||||
@@ -237,6 +244,7 @@ public sealed class SetupServer : IDisposable
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var version = typeof(Emby.Server.Implementations.ApplicationHost).Assembly.GetName().Version!;
|
||||||
app.Run(async (context) =>
|
app.Run(async (context) =>
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = (int)HttpStatusCode.ServiceUnavailable;
|
context.Response.StatusCode = (int)HttpStatusCode.ServiceUnavailable;
|
||||||
@@ -250,7 +258,7 @@ public sealed class SetupServer : IDisposable
|
|||||||
{
|
{
|
||||||
{ "isInReportingMode", _isUnhealthy },
|
{ "isInReportingMode", _isUnhealthy },
|
||||||
{ "retryValue", retryAfterValue },
|
{ "retryValue", retryAfterValue },
|
||||||
{ "version", typeof(Emby.Server.Implementations.ApplicationHost).Assembly.GetName().Version! },
|
{ "version", version },
|
||||||
{ "logs", startupLogEntries },
|
{ "logs", startupLogEntries },
|
||||||
{ "networkManagerReady", networkManager is not null },
|
{ "networkManagerReady", networkManager is not null },
|
||||||
{ "localNetworkRequest", networkManager is not null && context.Connection.RemoteIpAddress is not null && networkManager.IsInLocalNetwork(context.Connection.RemoteIpAddress) }
|
{ "localNetworkRequest", networkManager is not null && context.Connection.RemoteIpAddress is not null && networkManager.IsInLocalNetwork(context.Connection.RemoteIpAddress) }
|
||||||
|
|||||||
@@ -173,9 +173,9 @@
|
|||||||
<header class="flex-row">
|
<header class="flex-row">
|
||||||
|
|
||||||
{{^IF isInReportingMode}}
|
{{^IF isInReportingMode}}
|
||||||
<p>Jellyfin Server {{version}} still starting. Please wait.</p>
|
<p>Jellyfin Server {{version.ToString(2)}} still starting. Please wait.</p>
|
||||||
{{#ELSE}}
|
{{#ELSE}}
|
||||||
<p>Jellyfin Server has encountered an error and was not able to start.</p>
|
<p>Jellyfin Server {{version.ToString(2)}} has encountered an error and was not able to start.</p>
|
||||||
{{/ELSE}}
|
{{/ELSE}}
|
||||||
{{/IF}}
|
{{/IF}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user