Skip to content

Commit

Permalink
Version and DB engine display in admin page. Closes #270 (hopefully).
Browse files Browse the repository at this point in the history
  • Loading branch information
impworks committed Jan 13, 2024
1 parent 41a0ea5 commit cf97739
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ jobs:
context: .
push: true
tags: impworks/bonsai:latest
build-args: |
BUILD_COMMIT=${{ github.sha }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ RUN ln -s /usr/bin/ffmpeg /app/External/ffmpeg/ffmpeg && \
ln -s /usr/bin/ffprobe /app/External/ffmpeg/ffprobe && \
chmod +x /app/Bonsai

ARG BUILD_COMMIT
ENV ASPNETCORE_ENVIRONMENT=Production
ENV BuildCommit=$BUILD_COMMIT
EXPOSE 80
ENTRYPOINT ["/app/Bonsai"]
16 changes: 15 additions & 1 deletion src/Bonsai/Areas/Admin/Views/DynamicConfig/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using Bonsai.Code.Services.Config
@using Bonsai.Data.Models
@using Impworks.Utils.Format
@using Impworks.Utils.Strings
@inject BonsaiConfigService ConfigService
@model Bonsai.Areas.Admin.ViewModels.DynamicConfig.UpdateDynamicConfigVM
@{
ViewBag.Title = "Настройки";
Layout = "~/Areas/Admin/Views/Layout.cshtml";

var config = ConfigService.GetStaticConfig();
}

<h1>@ViewBag.Title</h1>
Expand Down Expand Up @@ -84,6 +88,16 @@
</div>
</div>
</div>

<div class="form-group row">
<div class="col-sm-3">Версия</div>
<div class="col-sm-9 text-muted">
<small>
Сборка: @(StringHelper.Coalesce(config.BuildCommit, "Неизвестно"))<br />
База данных: @(config.ConnectionStrings.UseEmbeddedDatabase ? "SQLite" : "PostgreSQL")
</small>
</div>
</div>

@if (!ViewData.ModelState.IsValid)
{
Expand Down
1 change: 1 addition & 0 deletions src/Bonsai/Code/Services/Config/StaticConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class StaticConfig
public WebServerConfig WebServer { get; set; }
public DemoModeConfig DemoMode { get; set; }
public AuthConfig Auth { get; set; }
public string BuildCommit { get; set; }
}

/// <summary>
Expand Down

0 comments on commit cf97739

Please sign in to comment.