-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61933e0
commit 67c81c4
Showing
13 changed files
with
279 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Sherlog.Server/Migrations/20240909164415_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Sherlog.Server.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class Initial : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "LogEntries", | ||
columns: table => new | ||
{ | ||
LogEntryId = table.Column<int>(type: "INTEGER", nullable: false) | ||
.Annotation("Sqlite:Autoincrement", true), | ||
Tenant = table.Column<string>(type: "TEXT", nullable: false), | ||
RecipientGroups = table.Column<string>(type: "TEXT", nullable: false), | ||
LogType = table.Column<string>(type: "TEXT", nullable: false), | ||
Project = table.Column<string>(type: "TEXT", nullable: false), | ||
Message = table.Column<string>(type: "TEXT", nullable: false), | ||
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_LogEntries", x => x.LogEntryId); | ||
}); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "LogEntries"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// <auto-generated /> | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
using Sherlog.Server; | ||
|
||
#nullable disable | ||
|
||
namespace Sherlog.Server.Migrations | ||
{ | ||
[DbContext(typeof(LogbookContext))] | ||
partial class LogbookContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); | ||
|
||
modelBuilder.Entity("Sherlog.Server.LogEntry", b => | ||
{ | ||
b.Property<int>("LogEntryId") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("INTEGER"); | ||
b.Property<DateTime>("CreatedAt") | ||
.HasColumnType("TEXT"); | ||
b.Property<string>("LogType") | ||
.IsRequired() | ||
.HasColumnType("TEXT"); | ||
b.Property<string>("Message") | ||
.IsRequired() | ||
.HasColumnType("TEXT"); | ||
b.Property<string>("Project") | ||
.IsRequired() | ||
.HasColumnType("TEXT"); | ||
b.Property<string>("RecipientGroups") | ||
.IsRequired() | ||
.HasColumnType("TEXT"); | ||
b.Property<string>("Tenant") | ||
.IsRequired() | ||
.HasColumnType("TEXT"); | ||
b.HasKey("LogEntryId"); | ||
b.ToTable("LogEntries"); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@page | ||
@model LogbookModel | ||
@{ | ||
ViewData["Title"] = "DevOps Logbook"; | ||
} | ||
<h1>@ViewData["Title"]</h1> | ||
|
||
<p>This page shows sent log events:</p> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Date/Time</th> | ||
<th>Tenant</th> | ||
<th>Project</th> | ||
<th>Type</th> | ||
<th>Recipient Groups</th> | ||
<th>Message</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var le in Model.LogEntries) | ||
{ | ||
<tr> | ||
<td>@le.CreatedAt.ToString("U")</td> | ||
<td>@le.Tenant</td> | ||
<td>@le.Project</td> | ||
<td>@le.LogType</td> | ||
<td>@le.RecipientGroups</td> | ||
<td>@le.Message</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Sherlog.Server.Pages; | ||
|
||
public class LogbookModel : PageModel | ||
{ | ||
private readonly ILogger<LogbookModel> _logger; | ||
|
||
public LogbookModel(ILogger<LogbookModel> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public async Task OnGetAsync() | ||
{ | ||
var db = new LogbookContext(); | ||
LogEntries = await db.LogEntries.ToListAsync(); | ||
} | ||
|
||
public List<LogEntry> LogEntries { get; set; } | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters