The checks engine, the path and the cards: me-web? 0.1 reads the connection
MeWeb.Core runs seven checks concurrently and reports each as it settles:
online or behind a login page, this connection, the public IPv4 and IPv6
seen from v4./v6.meweb, the provider from a built-in map, the router
(UPnP IGD, NAT-PMP and PCP, read-only), address sharing (router WAN
against the echo, TTL hops only as a hint), and the history kept on the
device. The app draws the path from this device to the internet and lights
it node by node, with a card per check and a sheet listing every host it
contacts.
The provider map is iptoasn's table compressed to 2.1 MB by
tools/knowledge.cs and built before every app release; eleven Italian
provider profiles carry each fact with who said it, the source and the
month. The server gains a download page (en, it) and /download/{platform}
from the latest Gitea release.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
1 parent
16a1cecaae
commit
0dffbc27d6
61 files changed
+3750
-149
No files matched your search
@@ -8,6 +8,7 @@ using MeWeb.App;
|
||||
using MeWeb.App.Services;
|
||||
using MeWeb.App.ViewModels;
|
||||
using MeWeb.App.Views;
|
||||
using MeWeb.Core.Checks;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -16,31 +17,43 @@ var codes = args.Length > 1 ? args[1].Split(',', StringSplitOptions.RemoveEmptyE
|
||||
Directory.CreateDirectory(output);
|
||||
|
||||
var session = HeadlessUnitTestSession.StartNew(typeof(ScreenshotEntry));
|
||||
await session.Dispatch(() =>
|
||||
await session.Dispatch(async () =>
|
||||
{
|
||||
foreach (var (width, height, label) in new[] { (1100, 760, "desktop"), (400, 820, "phone") })
|
||||
var run = await App.Services.GetRequiredService<CheckRunner>().Run((_, _) => { }, CancellationToken.None);
|
||||
Console.WriteLine($"run: {string.Join(", ", run.Findings.Select(f => $"{f.Id}={f.Outcome}"))}");
|
||||
foreach (var (width, height, label) in new[] { (1100, 1500, "desktop"), (400, 2600, "phone") })
|
||||
{
|
||||
foreach (var code in codes)
|
||||
{
|
||||
Localizer.Instance.SetLanguage(Languages.Find(code) ?? Languages.Fallback);
|
||||
var model = App.Services.GetRequiredService<MainViewModel>();
|
||||
var window = new Window { Width = width, Height = height, Content = new MainView { DataContext = model } };
|
||||
window.Show();
|
||||
Dispatcher.UIThread.RunJobs();
|
||||
var frame = window.CaptureRenderedFrame();
|
||||
var path = Path.Combine(output, $"main-{label}-{code}.png");
|
||||
if (frame is not null)
|
||||
{
|
||||
using var file = File.Create(path);
|
||||
frame.Save(file, new PngBitmapEncoderOptions());
|
||||
}
|
||||
Console.WriteLine($"{path} {(frame is null ? "no frame" : "ok")}");
|
||||
window.Close();
|
||||
Shoot(width, height, $"main-{label}-{code}", model => model.Replay(run));
|
||||
if (label == "desktop") Shoot(width, 900, $"contacts-{code}", model => model.ShowContacts = true);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}, CancellationToken.None);
|
||||
Environment.Exit(0);
|
||||
|
||||
void Shoot(int width, int height, string name, Action<MainViewModel> prepare)
|
||||
{
|
||||
var model = App.Services.GetRequiredService<MainViewModel>();
|
||||
var view = new MainView { DataContext = model };
|
||||
var window = new Window { Width = width, Height = height, Content = view };
|
||||
window.Show();
|
||||
model.AvailableWidth = width;
|
||||
prepare(model);
|
||||
for (var i = 0; i < 6; i++) Dispatcher.UIThread.RunJobs();
|
||||
var frame = window.CaptureRenderedFrame();
|
||||
var path = Path.Combine(output, $"{name}.png");
|
||||
if (frame is not null)
|
||||
{
|
||||
using var file = File.Create(path);
|
||||
frame.Save(file, new PngBitmapEncoderOptions());
|
||||
}
|
||||
Console.WriteLine($"{path} {(frame is null ? "no frame" : "ok")}");
|
||||
window.Close();
|
||||
}
|
||||
|
||||
public static class ScreenshotEntry
|
||||
{
|
||||
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<MeWeb.App.App>()
|
||||
|
||||
Reference in new issue
Block a user