diff --git a/src/Nyanlabs.Umogen.Server/Pages/Contracts.razor b/src/Nyanlabs.Umogen.Server/Pages/Contracts.razor new file mode 100644 index 0000000..0a94e73 --- /dev/null +++ b/src/Nyanlabs.Umogen.Server/Pages/Contracts.razor @@ -0,0 +1,54 @@ +@page "/contracts" +@using Umogen.Core; +@using Umogen.Core.Models; +@inject IJSRuntime js + +Umowy + +

Umowy

+ +
+ +
+
+ +
+
+ +
+ + +
+
OUT: @output
+
+ + + +@code { + private string _prompt, _person, _value; + private string output = ""; + + private async Task Process() + { + output = string.Empty; + using UmoEngine eng = new("/home/nya/Dev/csharp/umogen/umogenkey.secret"); + UmoProcess proc = new(eng); + Thread.Yield(); + await foreach (var str in proc.Ask(_prompt)) + { + output += str; + Console.Write(str); + this.StateHasChanged(); + } + + var anal = System.Text.Json.JsonSerializer.Deserialize(output, Umogen.JSON_OPTS); + UmoDocumentResult res = new(null, new Person("Kotek", "Miauczyński", "CBS4327563", "04281308999", new DateTime(2004, 08, + 13)), + new Person("Kotek", "Miauczyński", "CBS4327563", "04281308999", new DateTime(2004, 08, 13)), ValidTime.Invalid, 2137, + anal); + + var bytes = await res.ProcessPdf(Path.Combine("/home/nya/Dev/csharp/umogen/", + $"templates/{anal.Doctype.TemplateDoc()}")); + await js.InvokeVoidAsync("blobby", bytes); + } +} diff --git a/src/Nyanlabs.Umogen.Server/Pages/People.razor b/src/Nyanlabs.Umogen.Server/Pages/People.razor new file mode 100644 index 0000000..acfb104 --- /dev/null +++ b/src/Nyanlabs.Umogen.Server/Pages/People.razor @@ -0,0 +1,20 @@ +@page "/people" + +Osoby + +

Osoby

+ + +@if (addVis) +{ + +} + +@code { + private bool addVis = false; + + private void Toggle() + { + addVis = !addVis; + } +} diff --git a/src/Nyanlabs.Umogen.Server/Pages/_Host.cshtml b/src/Nyanlabs.Umogen.Server/Pages/_Host.cshtml index a90635d..fa06e99 100644 --- a/src/Nyanlabs.Umogen.Server/Pages/_Host.cshtml +++ b/src/Nyanlabs.Umogen.Server/Pages/_Host.cshtml @@ -10,9 +10,12 @@ + + diff --git a/src/Nyanlabs.Umogen.Server/Shared/MainLayout.razor b/src/Nyanlabs.Umogen.Server/Shared/MainLayout.razor index 0b0e4ab..0cecf7b 100644 --- a/src/Nyanlabs.Umogen.Server/Shared/MainLayout.razor +++ b/src/Nyanlabs.Umogen.Server/Shared/MainLayout.razor @@ -2,9 +2,7 @@ umogen - +
diff --git a/src/Nyanlabs.Umogen.Server/Shared/Navi.razor b/src/Nyanlabs.Umogen.Server/Shared/Navi.razor index ba94b6d..5003a2e 100644 --- a/src/Nyanlabs.Umogen.Server/Shared/Navi.razor +++ b/src/Nyanlabs.Umogen.Server/Shared/Navi.razor @@ -1,3 +1,22 @@ -
-

umogen

-
+ diff --git a/src/Nyanlabs.Umogen.Server/Shared/Navi.razor.css b/src/Nyanlabs.Umogen.Server/Shared/Navi.razor.css index 9b01f19..c4739b4 100644 --- a/src/Nyanlabs.Umogen.Server/Shared/Navi.razor.css +++ b/src/Nyanlabs.Umogen.Server/Shared/Navi.razor.css @@ -1,3 +1,3 @@ -h2 { +h1 { text-align: center; } diff --git a/src/Nyanlabs.Umogen.Server/Shared/PersonAddForm.razor b/src/Nyanlabs.Umogen.Server/Shared/PersonAddForm.razor new file mode 100644 index 0000000..d486438 --- /dev/null +++ b/src/Nyanlabs.Umogen.Server/Shared/PersonAddForm.razor @@ -0,0 +1,38 @@ +

Dodaj osobę

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ +@code { + [Parameter] + public required Action OnSubmit { get; set; } + + private string _name = string.Empty, + _surname = string.Empty, + _pesel = string.Empty, + _id = string.Empty; + + private void Submit() + { + Core.Models.Person p = new(_name, _surname, _id, _pesel); + OnSubmit.Invoke(); + } +} diff --git a/src/Nyanlabs.Umogen.Server/wwwroot/penis.js b/src/Nyanlabs.Umogen.Server/wwwroot/penis.js new file mode 100644 index 0000000..3c7598d --- /dev/null +++ b/src/Nyanlabs.Umogen.Server/wwwroot/penis.js @@ -0,0 +1,20 @@ +//I lost ;w; + +function blobby(arr) { + const url = window.URL.createObjectURL( + new Blob([arr], { type: "application/pdf" }) + ); + + var downloadLink = document.createElement("a"); + downloadLink.target = "_blank"; + downloadLink.download = "umo.pdf"; + + // set object URL as the anchor's href + downloadLink.href = url; + + // append the anchor to document body + document.body.append(downloadLink); + + // fire a click event on the anchor + downloadLink.click(); +}