ci / test (postgres) (push) Successful in 6m25s
ci / test (sqlite) (push) Successful in 4m1s
ci / test (postgres) (pull_request) Failing after 6m4s
ci / image (push) Canceled after 0s
ci / test (sqlite) (pull_request) Successful in 4m34s
ci / image (pull_request) Skipped
The 48-hour soak run at home kept being cut short by the host, never by Anubis.
The user will instead run a release for as long as they like and paste back a
report, so the bot now records what that report needs (ADR 0013).
- Every 5 minutes and at each start, a process sample goes to diagnostic_samples:
memory, GC, threads, handles, CPU, exceptions, database size, log warnings and
errors, and outbound HTTP calls by destination with duration buckets, read from
the System.Net.Http meter without any new package.
- Every scheduled job run goes to job_runs. Both tables keep 30 days.
- The Markdown report (at most 60 KB, redacted, user folders masked) adds
findings, the soak checks, starts and silences, jobs, calls, grouped log
warnings and errors, and resources over time with their slopes. It comes from
"anubis diagnostics", GET /api/diagnostica.md and a button in Diario e sistema.
- New {long} column token: SQLite STRICT tables reject BIGINT.
- "tasks release-win" builds the trial zip with a start script, a script that
writes the report, and Italian instructions. Version 0.7.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
164 lines
7.1 KiB
Plaintext
164 lines
7.1 KiB
Plaintext
@inherits LoadedComponent
|
|
@page "/diario"
|
|
@inject AnubisHost Host
|
|
@inject ShellData Shell
|
|
|
|
<PageTitle>Diario e sistema · Anubis</PageTitle>
|
|
|
|
@{
|
|
var d = _diary;
|
|
var s = _system;
|
|
}
|
|
<div class="journal-columns">
|
|
<section class="panel journal" aria-labelledby="diario">
|
|
<div class="journal-head">
|
|
<h2 id="diario">Diario</h2>
|
|
<form class="search journal-search" method="get" action="/diario" role="search">
|
|
@if (d.Filter != "tutto")
|
|
{
|
|
<input type="hidden" name="tipo" value="@d.Filter" />
|
|
}
|
|
<Icon Name="search" Size="16" />
|
|
<label class="visually-hidden" for="cerca-diario">Cerca nel diario</label>
|
|
<input id="cerca-diario" type="search" name="cerca" value="@d.Search" placeholder="Cerca nel diario" maxlength="100" />
|
|
</form>
|
|
</div>
|
|
<nav class="chips" aria-label="Tipo di voce">
|
|
@foreach (var (key, label, _) in DiaryView.Filters)
|
|
{
|
|
<a href="@d.Link(filter: key, range: DiaryView.DefaultRange)" class="chip @(key == d.Filter ? "on" : null)" aria-current="@(key == d.Filter ? "true" : null)">@label</a>
|
|
}
|
|
</nav>
|
|
@if (d.Search is { } search)
|
|
{
|
|
<p class="note journal-found">
|
|
@(d.Days.Sum(x => x.Entries.Count) switch { 0 => "Nessuna voce", 1 => "Una voce", var n => $"{n} voci" }) con «@search»@(d.Truncated ? $", le {DiaryView.MaxSearchResults} più recenti" : "").
|
|
<a href="@(new DiaryView([], d.Filter, null, DiaryView.DefaultRange, false, false).Link())">Togli la ricerca</a>
|
|
</p>
|
|
}
|
|
@if (d.IsEmpty && d.Search is null)
|
|
{
|
|
<p class="note">@(d.Filter == "tutto" ? "Ancora nessuna voce. Qui il bot scrive ogni decisione, ordine e controllo, in parole semplici, appena succede." : "Nessuna voce di questo tipo finora.")</p>
|
|
}
|
|
@foreach (var day in d.Days)
|
|
{
|
|
<h3 class="journal-day">@day.Heading</h3>
|
|
<ol class="journal-list">
|
|
@foreach (var e in day.Entries)
|
|
{
|
|
<li class="@(e.Attention ? "attention-entry" : null)">
|
|
<time datetime="@e.At.ToString("o", CultureInfo.InvariantCulture)">@TimeZoneInfo.ConvertTime(e.At, Shell.Zone).ToString("HH:mm", CultureInfo.InvariantCulture)</time>
|
|
<Icon Name="@e.Icon" Size="18" Class="journal-icon" />
|
|
<div class="journal-text">
|
|
<p>@if (e.Lead is { } lead) {<strong>@lead</strong>}@foreach (var piece in e.Main) {if (piece.Class is { } css) {<strong class="@css">@piece.Text</strong>} else {@piece.Text}}</p>
|
|
@if (e.Rest is { } rest)
|
|
{
|
|
<p class="journal-rest">@rest</p>
|
|
}
|
|
@if (e.Trade is { } trade)
|
|
{
|
|
<a href="/operazioni?cerca=@Uri.EscapeDataString(trade)">Perché l'ho comprata e venduta</a>
|
|
}
|
|
</div>
|
|
<span class="journal-kind">@e.Kind</span>
|
|
</li>
|
|
}
|
|
</ol>
|
|
}
|
|
@if (d.HasOlder)
|
|
{
|
|
<div class="journal-more"><a class="btn" href="@d.Link(range: d.Range + 7)">Mostra i giorni precedenti</a></div>
|
|
}
|
|
</section>
|
|
|
|
<div class="journal-side">
|
|
<section class="panel" aria-labelledby="sistema">
|
|
<div class="panel-head">
|
|
<h2 id="sistema">Come sta il sistema</h2>
|
|
<span class="status-pill @(s.AllWell ? "gain" : "attention")"><Icon Name="@(s.AllWell ? "check" : "alert")" Size="16" />@(s.AllWell ? "Tutto regolare" : "Qualcosa da controllare")</span>
|
|
</div>
|
|
<ul class="system-parts">
|
|
@foreach (var part in s.Parts)
|
|
{
|
|
<li class="@PartClass(part.State)">
|
|
<Icon Name="@PartIcon(part.State)" Size="16" />
|
|
<span><strong>@part.Name</strong><span>@part.Detail</span></span>
|
|
</li>
|
|
}
|
|
</ul>
|
|
</section>
|
|
|
|
<section class="panel" aria-labelledby="lavori">
|
|
<h2 id="lavori">Lavori in programma</h2>
|
|
@if (s.Jobs.Count == 0)
|
|
{
|
|
<p class="note">Nessun lavoro in programma: il pianificatore parte con il motore.</p>
|
|
}
|
|
else
|
|
{
|
|
<ul class="moves job-list">
|
|
@foreach (var job in s.Jobs)
|
|
{
|
|
<li><span class="move-time">@job.Time</span><span>@job.Text</span></li>
|
|
}
|
|
</ul>
|
|
}
|
|
</section>
|
|
|
|
<section class="plain host" aria-labelledby="computer">
|
|
<h2 id="computer">Il computer che lo ospita</h2>
|
|
@foreach (var r in s.Resources)
|
|
{
|
|
<div class="limit">
|
|
<div class="limit-line"><span>@r.Label</span><span><strong>@r.Value</strong>@if (r.Of is { } of) {<span class="muted"> su @of</span>}</span></div>
|
|
<span class="usage @(r.Share >= 0.85m ? "high" : null)"><span style="width: @Css(r.Share * 100m)%"></span></span>
|
|
</div>
|
|
}
|
|
<p class="note">@s.Running</p>
|
|
<a class="btn" href="/api/registri.zip" download><Icon Name="download" Size="18" />Scarica i registri tecnici</a>
|
|
<a class="btn" href="/api/diagnostica.md" download><Icon Name="download" Size="18" />Scarica i dati per l'analisi</a>
|
|
<p class="note">I dati per l'analisi sono un testo da incollare a chi segue lo sviluppo: risorse, lavori, chiamate ed errori, senza chiavi né password.</p>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
private DiaryView _diary = null!;
|
|
private SystemView _system = null!;
|
|
|
|
[CascadingParameter]
|
|
public HttpContext? HttpContext { get; set; }
|
|
|
|
[SupplyParameterFromQuery(Name = "tipo")]
|
|
public string? Tipo { get; set; }
|
|
|
|
[SupplyParameterFromQuery(Name = "cerca")]
|
|
public string? Cerca { get; set; }
|
|
|
|
[SupplyParameterFromQuery(Name = "giorni")]
|
|
public string? Giorni { get; set; }
|
|
|
|
protected override async Task LoadAsync()
|
|
{
|
|
var ct = HttpContext?.RequestAborted ?? CancellationToken.None;
|
|
_diary = await DiaryView.LoadAsync(Host.Services!.Db, Tipo, Cerca, Giorni, Shell.Now, Shell.Zone, ct);
|
|
_system = await SystemView.LoadAsync(Host, Shell, ct);
|
|
}
|
|
|
|
private static string PartClass(PartState state) => state switch
|
|
{
|
|
PartState.Ok => "ok",
|
|
PartState.Warn => "warn",
|
|
_ => "off",
|
|
};
|
|
|
|
private static string PartIcon(PartState state) => state switch
|
|
{
|
|
PartState.Ok => "tick",
|
|
PartState.Warn => "alert",
|
|
_ => "clock",
|
|
};
|
|
|
|
private static string Css(decimal value) => Math.Round(value, 3).ToString("0.###", CultureInfo.InvariantCulture);
|
|
}
|