module connection in progress

This commit is contained in:
gaz8860 Gary 2023-03-06 13:39:38 +00:00
parent 5cd33a9220
commit 668da73db7
18 changed files with 495 additions and 371 deletions

View File

@ -1,16 +1,26 @@
using System;
using System.Net.Http;
using System.Text.Json;
using System.Collections.Generic;
public static class Diagnostics {
public static List<Memory> GetMemory() {
var memoryReport = new List<Memory>();
// public MemoryReport GetMemory() {
memoryReport.Add(new Memory {label="Memory used", value=32});
memoryReport.Add(new Memory {label="Memory free", value=16});
memoryReport.Add(new Memory {label="Memory cache", value=12});
memoryReport.Add(new Memory {label="Memory buffer", value=4});
// protected override async Task OnInitializedAsync()
// {
// var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:8080");
// var client = ClientFactory.CreateClient();
// var response = await client.SendAsync(request);
return memoryReport;
}
// if (response.IsSuccessStatusCode)
// {
// await using var responseStream = await
// response.Content.ReadAsStreamAsync();
// MemoryReport report = System.Text.Json.JsonSerializer.Deserialize<Memory>(responseStream);
// }
// }
// return memoryReport;
// }
}

View File

@ -1,7 +1,13 @@
using System;
public class Memory {
public int used { get; set; }
public int free { get; set; }
public int cache { get; set; }
public int buffer { get; set; }
}
public string label {get; set;}
public decimal value {get; set;}
public class MemoryReport {
public string label { get; set; }
public int value { get; set; }
}

View File

@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="Blazor-ApexCharts" Version="0.9.17-beta" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
</ItemGroup>
</Project>

View File

@ -1,4 +1,7 @@
@page "/diagnostics"
@using System.Text.Json
@using System.Text.Json.Serialization
@inject IHttpClientFactory ClientFactory
@* <div style="max-width:350px">
<ApexGauge Percentage=33 Label="Storage used" Title="Storage"/>
@ -9,7 +12,7 @@
<ApexChart TItem="Memory" Title="Memory Usage">
<ApexPointSeries TItem="Memory"
Items="MemoryReport"
SeriesType="SeriesType.Donut"
SeriesType="SeriesType.RadialBar"
Name="memory Usage"
XValue="@(f => f.label)"
YValue="@(f => f.value)"/>
@ -19,5 +22,5 @@
@code
{
private List<Memory> MemoryReport { get; set;} = Diagnostics.GetMemory();
}

View File

@ -8,7 +8,8 @@
".NETCoreApp,Version=v6.0": {
"FrontendApp/1.0.0": {
"dependencies": {
"Blazor-ApexCharts": "0.9.17-beta"
"Blazor-ApexCharts": "0.9.17-beta",
"System.Net.Http.Json": "3.2.1"
},
"runtime": {
"FrontendApp.dll": {}
@ -128,7 +129,13 @@
}
}
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {}
"System.Net.Http.Json/3.2.1": {
"dependencies": {
"System.Text.Json": "4.7.2"
}
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {},
"System.Text.Json/4.7.2": {}
}
},
"libraries": {
@ -235,12 +242,26 @@
"path": "system.io.pipelines/6.0.2",
"hashPath": "system.io.pipelines.6.0.2.nupkg.sha512"
},
"System.Net.Http.Json/3.2.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-KkevRTwX9uMYxuxG2/wSql8FIAItB89XT36zoh6hraQkFhf2yjotDswpAKzeuaEuMhAia6c50oZMkP1PJoYufQ==",
"path": "system.net.http.json/3.2.1",
"hashPath": "system.net.http.json.3.2.1.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
"path": "system.runtime.compilerservices.unsafe/6.0.0",
"hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
},
"System.Text.Json/4.7.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==",
"path": "system.text.json/4.7.2",
"hashPath": "system.text.json.4.7.2.nupkg.sha512"
}
}
}

View File

@ -8,53 +8,53 @@ build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = FrontendApp
build_property.RootNamespace = FrontendApp
build_property.ProjectDir = C:\Users\user\Documents\Panoptes\2023-ca400-murphg62-byrnm257\src\FrontendApp\
build_property.ProjectDir = c:\Users\user\Documents\Panoptes\2023-ca400-murphg62-byrnm257\src\FrontendApp\
build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = C:\Users\user\Documents\Panoptes\2023-ca400-murphg62-byrnm257\src\FrontendApp
build_property.MSBuildProjectDirectory = c:\Users\user\Documents\Panoptes\2023-ca400-murphg62-byrnm257\src\FrontendApp
build_property._RazorSourceGeneratorDebug =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/App.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/App.razor]
build_metadata.AdditionalFiles.TargetPath = QXBwLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/FetchData.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/FetchData.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcRmV0Y2hEYXRhLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/Index.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/Index.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXgucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/ServerDiagnostics.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/ServerDiagnostics.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcU2VydmVyRGlhZ25vc3RpY3MucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Shared/SurveyPrompt.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Shared/SurveyPrompt.razor]
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXFN1cnZleVByb21wdC5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/_Imports.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/_Imports.razor]
build_metadata.AdditionalFiles.TargetPath = X0ltcG9ydHMucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Shared/MainLayout.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Shared/MainLayout.razor]
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXE1haW5MYXlvdXQucmF6b3I=
build_metadata.AdditionalFiles.CssScope = b-xu3rpd7qnv
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Shared/NavMenu.razor]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Shared/NavMenu.razor]
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXE5hdk1lbnUucmF6b3I=
build_metadata.AdditionalFiles.CssScope = b-usg45fia0j
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/Error.cshtml]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/Error.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcRXJyb3IuY3NodG1s
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/_Host.cshtml]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/_Host.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcX0hvc3QuY3NodG1s
build_metadata.AdditionalFiles.CssScope =
[C:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/_Layout.cshtml]
[c:/Users/user/Documents/Panoptes/2023-ca400-murphg62-byrnm257/src/FrontendApp/Pages/_Layout.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcX0xheW91dC5jc2h0bWw=
build_metadata.AdditionalFiles.CssScope =

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,10 @@
"Blazor-ApexCharts": {
"target": "Package",
"version": "[0.9.17-beta, )"
},
"System.Net.Http.Json": {
"target": "Package",
"version": "[3.2.1, )"
}
},
"imports": [

View File

@ -228,6 +228,22 @@
"buildTransitive/netcoreapp3.1/_._": {}
}
},
"System.Net.Http.Json/3.2.1": {
"type": "package",
"dependencies": {
"System.Text.Json": "4.7.2"
},
"compile": {
"lib/netstandard2.0/System.Net.Http.Json.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard2.0/System.Net.Http.Json.dll": {
"related": ".xml"
}
}
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"type": "package",
"compile": {
@ -243,6 +259,19 @@
"build": {
"buildTransitive/netcoreapp3.1/_._": {}
}
},
"System.Text.Json/4.7.2": {
"type": "package",
"compile": {
"lib/netcoreapp3.0/System.Text.Json.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netcoreapp3.0/System.Text.Json.dll": {
"related": ".xml"
}
}
}
}
},
@ -553,6 +582,26 @@
"useSharedDesignerContext.txt"
]
},
"System.Net.Http.Json/3.2.1": {
"sha512": "KkevRTwX9uMYxuxG2/wSql8FIAItB89XT36zoh6hraQkFhf2yjotDswpAKzeuaEuMhAia6c50oZMkP1PJoYufQ==",
"type": "package",
"path": "system.net.http.json/3.2.1",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net461/System.Net.Http.Json.dll",
"lib/net461/System.Net.Http.Json.xml",
"lib/netstandard2.0/System.Net.Http.Json.dll",
"lib/netstandard2.0/System.Net.Http.Json.xml",
"system.net.http.json.3.2.1.nupkg.sha512",
"system.net.http.json.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"sha512": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
"type": "package",
@ -577,11 +626,34 @@
"system.runtime.compilerservices.unsafe.nuspec",
"useSharedDesignerContext.txt"
]
},
"System.Text.Json/4.7.2": {
"sha512": "TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==",
"type": "package",
"path": "system.text.json/4.7.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net461/System.Text.Json.dll",
"lib/net461/System.Text.Json.xml",
"lib/netcoreapp3.0/System.Text.Json.dll",
"lib/netcoreapp3.0/System.Text.Json.xml",
"lib/netstandard2.0/System.Text.Json.dll",
"lib/netstandard2.0/System.Text.Json.xml",
"system.text.json.4.7.2.nupkg.sha512",
"system.text.json.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
}
},
"projectFileDependencyGroups": {
"net6.0": [
"Blazor-ApexCharts >= 0.9.17-beta"
"Blazor-ApexCharts >= 0.9.17-beta",
"System.Net.Http.Json >= 3.2.1"
]
},
"packageFolders": {
@ -624,6 +696,10 @@
"Blazor-ApexCharts": {
"target": "Package",
"version": "[0.9.17-beta, )"
},
"System.Net.Http.Json": {
"target": "Package",
"version": "[3.2.1, )"
}
},
"imports": [

View File

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "ZdXc1ZKwOzw69RwonKpld9cGdIEUbhE9aZdqhwEvRO9V49X6Bs5DIig533UsMLdxl3igik+WRhz772PGceg6Bw==",
"dgSpecHash": "iq5uQmnNzfA7wKGXu6HgTtEEC0rMMJNrlSEJGZuZPytRCEH6jjAqJRvJCeXAmMyu44CU/UYV7iUpugx8KEytnQ==",
"success": true,
"projectFilePath": "C:\\Users\\user\\Documents\\Panoptes\\2023-ca400-murphg62-byrnm257\\src\\FrontendApp\\FrontendApp.csproj",
"expectedPackageFiles": [
@ -18,7 +18,9 @@
"C:\\Users\\user\\.nuget\\packages\\microsoft.extensions.primitives\\6.0.0\\microsoft.extensions.primitives.6.0.0.nupkg.sha512",
"C:\\Users\\user\\.nuget\\packages\\microsoft.jsinterop\\6.0.3\\microsoft.jsinterop.6.0.3.nupkg.sha512",
"C:\\Users\\user\\.nuget\\packages\\system.io.pipelines\\6.0.2\\system.io.pipelines.6.0.2.nupkg.sha512",
"C:\\Users\\user\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
"C:\\Users\\user\\.nuget\\packages\\system.net.http.json\\3.2.1\\system.net.http.json.3.2.1.nupkg.sha512",
"C:\\Users\\user\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512",
"C:\\Users\\user\\.nuget\\packages\\system.text.json\\4.7.2\\system.text.json.4.7.2.nupkg.sha512"
],
"logs": []
}

View File

@ -8,3 +8,4 @@
2.0
2.0
2.0
2.0