Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build HealthCheck UI docker image

on:
push :
branches:
- 'ExRam'

env:
DotNetVersion: '6.0.100'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET Core ${{ env.DotNetVersion }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DotNetVersion }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Determine semantic version
uses: dotnet/nbgv@master
id: nbgv
with:
setAllVars: true

- name: Set versions
run: |
echo "version1=${{steps.nbgv.outputs.VersionMajor}}" >> $GITHUB_ENV
echo "version2=${{steps.nbgv.outputs.VersionMajor}}.${{steps.nbgv.outputs.VersionMinor}}" >> $GITHUB_ENV
echo "version3=${{steps.nbgv.outputs.VersionMajor}}.${{steps.nbgv.outputs.VersionMinor}}.${{steps.nbgv.outputs.BuildNumber}}" >> $GITHUB_ENV
echo "version4=${{steps.nbgv.outputs.VersionMajor}}.${{steps.nbgv.outputs.VersionMinor}}.${{steps.nbgv.outputs.BuildNumber}}${{steps.nbgv.outputs.PrereleaseVersion}}" >> $GITHUB_ENV
echo "version5=${{steps.nbgv.outputs.VersionMajor}}.${{steps.nbgv.outputs.VersionMinor}}.${{steps.nbgv.outputs.BuildNumber}}${{steps.nbgv.outputs.PrereleaseVersion}}.${{steps.nbgv.outputs.VersionHeight}}" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PACKAGES_TOKEN }}

- name: Build Dockerfile
uses: docker/build-push-action@v2
with:
push: true
file: build/docker-images/HealthChecks.UI.Image/Dockerfile
build-args: |
version=${{ env.version4 }}
versionHeight=${{steps.nbgv.outputs.VersionHeight}}
tags: |
ghcr.io/exram/aspnetcore.diagnostics.healthchecks.ui:${{ env.version1 }}
ghcr.io/exram/aspnetcore.diagnostics.healthchecks.ui:${{ env.version2 }}
ghcr.io/exram/aspnetcore.diagnostics.healthchecks.ui:${{ env.version3 }}
ghcr.io/exram/aspnetcore.diagnostics.healthchecks.ui:${{ env.version4 }}
ghcr.io/exram/aspnetcore.diagnostics.healthchecks.ui:${{ env.version5 }}

- name: Bump version and push tag
uses: mathieudutour/[email protected]
with:
custom_tag: AspNetCore.Diagnostics.HealthChecks.UI-Docker-${{ env.version5 }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<PackageReference Update="Microsoft.Extensions.Http" Version="6.0.0"/>
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="6.0.0"/>
<PackageReference Update="Microsoft.Extensions.Logging.Console" Version="6.0.0"/>
<PackageReference Update="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.2.9"/>
<PackageReference Update="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.3.0"/>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0"/>
<PackageReference Update="MongoDB.Driver" Version="2.13.2"/>
<PackageReference Update="MySqlConnector" Version="2.0.0"/>
Expand Down
4 changes: 2 additions & 2 deletions build/docker-images/HealthChecks.UI.Image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0.101-bullseye-slim AS sdk-with-node

ENV NODE_VERSION 8.11.1
ENV NODE_DOWNLOAD_SHA 0e20787e2eda4cc31336d8327556ebc7417e8ee0a6ba0de96a09b0ec2b841f60
ENV NODE_VERSION 14.17.0
ENV NODE_DOWNLOAD_SHA 3d06eabc73ec8626337bff370474306eac1c3c21122f677720d154c556ceafaf
RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public void Configure(EntityTypeBuilder<HealthCheckExecutionEntry> builder)
builder.Property(le => le.Status)
.IsRequired(true);

builder.Property(le => le.Data)
.IsRequired(false);

builder.Property(le => le.Description)
.IsRequired(false);

Expand Down
2 changes: 2 additions & 0 deletions src/HealthChecks.UI.Core/Data/HealthCheckExecutionEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public class HealthCheckExecutionEntry
public TimeSpan Duration { get; set; }

public List<string> Tags { get; set; }

public string Data { get; set; }
}
}
2 changes: 2 additions & 0 deletions src/HealthChecks.UI/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*]
indent_size = 4
2 changes: 2 additions & 0 deletions src/HealthChecks.UI/Core/Extensions/HealthReportExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using HealthChecks.UI.Core;
using HealthChecks.UI.Core.Data;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -18,6 +19,7 @@ public static List<HealthCheckExecutionEntry> ToExecutionEntries(this UIHealthRe
Status = item.Value.Status,
Description = item.Value.Description,
Duration = item.Value.Duration,
Data = JsonConvert.SerializeObject(item.Value.Data),
Tags = item.Value.Tags?.ToList() ?? null
};
}).ToList();
Expand Down
6 changes: 6 additions & 0 deletions src/HealthChecks.UI/assets/healthchecksui.css
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ h4 {
justify-content: center;
}

.hc-liveness-detail__data {
display: block;
padding: 0.5rem;
background-color: var(--midGrayColor);
}

.hc-liveness-detail .hc-status {
font-size: 0.75rem;
}
Expand Down
23 changes: 23 additions & 0 deletions src/HealthChecks.UI/client/components/LivenessData.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, {FunctionComponent, useEffect, useState} from 'react';
import {Check} from '../typings/models';

interface LivenessDataProps {
healthcheck: Check;
}

const LivenessData: FunctionComponent<LivenessDataProps> = props => {
if (props.healthcheck === null) return null;

const [data, setData] = useState(null)
useEffect(() => {
setData(JSON.parse(props.healthcheck.data))
}, [props])

return (
<div className="hc-liveness-detail__data">
{data && (<pre>{JSON.stringify(data, null, 2)}</pre>)}
</div>
);
};

export {LivenessData};
2 changes: 2 additions & 0 deletions src/HealthChecks.UI/client/components/LivenessDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import 'react-vertical-timeline-component/style.min.css';
import { ExecutionHistory, Check } from '../typings/models';
import { Status } from './Status';
import { LivenessData } from "./LivenessData";
import moment from 'moment';

interface LivenessDetailsProps {
Expand All @@ -22,6 +23,7 @@ const LivenessDetail: FunctionComponent<LivenessDetailsProps> = props => {
<h2>{props.healthcheck.name}</h2>
<Status status={props.healthcheck.status}></Status>
</header>
<LivenessData healthcheck={props.healthcheck} />
<div className="hc-liveness-detail__body">
{props.executionHistory.length > 0 && (
<VerticalTimeline className="hc-timeline">
Expand Down
1 change: 1 addition & 0 deletions src/HealthChecks.UI/client/typings/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Check {
status: string;
description: string;
duration: string;
data: string;
tags: string[];
}

Expand Down
8 changes: 8 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "1.0.3",
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}