Skip to content

Commit

Permalink
Adds the version in the about page
Browse files Browse the repository at this point in the history
  • Loading branch information
mdima committed Jun 8, 2024
1 parent ff33dbc commit 55fc3e5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Based on the original repository: https://github.com/bencorn/traceroute

### Running in Docker
You can use the following image to run Visual Trace Route locally:
michele73/traceroute:1.2.1
michele73/traceroute:1.2.2

Example:
docker run -d -p 8081:80 --name=traceroute --restart=always -v traecroute_logs:/app/logs michele73/traceroute:1.2.1
docker run -d -p 8081:80 --name=traceroute --restart=always -v traecroute_logs:/app/logs michele73/traceroute:1.2.2

The image repository is here: https://hub.docker.com/r/michele73/traceroute

Expand Down
10 changes: 9 additions & 1 deletion TraceRoute/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ public IActionResult Index()
[HttpGet("/about")]
public IActionResult About()
{
ViewData["Message"] = "Your application description page.";
Version? currentVersion = GetType()?.Assembly?.GetName()?.Version;
if (currentVersion != null)
{
ViewData["Version"] = string.Format("{0}.{1}.{2}", currentVersion.Major, currentVersion.Minor, currentVersion.Build);
}
else
{
ViewData["Version"] = "Unknown";
}

return PartialView();
}
Expand Down
2 changes: 1 addition & 1 deletion TraceRoute/Properties/PublishProfiles/Docker Public.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<DockerPublish>true</DockerPublish>
<RegistryUrl>https://registry.hub.docker.com/michele73</RegistryUrl>
<UserName>michele73</UserName>
<PublishImageTag>1.2.1</PublishImageTag>
<PublishImageTag>1.2.2</PublishImageTag>
<PublishProvider>ContainerRegistry</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
Expand Down
1 change: 1 addition & 0 deletions TraceRoute/TraceRoute.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.2.2</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
3 changes: 3 additions & 0 deletions TraceRoute/Views/Home/About.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
<li><a href="https://github.com/mdima/traceroute" target="_blank">GitHub</a> for the source code</li>
<li><a href="https://hub.docker.com/r/michele73/traceroute" target="_blank">Docker Hub</a> for the container repository</li>
</ul>
<p class="mt-3">
Project version: <strong>@ViewData["Version"]</strong>
</p>
</div>

0 comments on commit 55fc3e5

Please sign in to comment.