diff --git a/K8sFileBrowser/K8sFileBrowser.csproj b/K8sFileBrowser/K8sFileBrowser.csproj index 441bf59..6a0e830 100644 --- a/K8sFileBrowser/K8sFileBrowser.csproj +++ b/K8sFileBrowser/K8sFileBrowser.csproj @@ -1,7 +1,7 @@  WinExe - net9.0 + net10.0 enable true app.manifest @@ -9,8 +9,9 @@ Debug;Release AnyCPU Assets/app.ico - 0.1.4 + 1.7.0 win-x64;linux-x64;osx-arm64 + default TRACE @@ -22,21 +23,21 @@ - - - - - + + + + + - - + - + + - + diff --git a/K8sFileBrowser/Program.cs b/K8sFileBrowser/Program.cs index c59d0d8..51987d3 100644 --- a/K8sFileBrowser/Program.cs +++ b/K8sFileBrowser/Program.cs @@ -1,7 +1,8 @@ using Avalonia; -using Avalonia.ReactiveUI; + using System; using Avalonia.Logging; +using ReactiveUI.Avalonia; using Serilog; namespace K8sFileBrowser; diff --git a/K8sFileBrowser/Services/KubernetesService.cs b/K8sFileBrowser/Services/KubernetesService.cs index 5b6fbb1..414cb13 100644 --- a/K8sFileBrowser/Services/KubernetesService.cs +++ b/K8sFileBrowser/Services/KubernetesService.cs @@ -68,7 +68,7 @@ public class KubernetesService : IKubernetesService try { var execResult = new KubernetesFileInformationResult(path); - var resultCode = _kubernetesClient + _kubernetesClient .NamespacedPodExecAsync( podName, namespaceName, containerName, new[] { "find", path, "-maxdepth", "1", "-exec", "stat", "-c", "%F|%n|%s|%Y", "{}", ";" }, @@ -128,10 +128,15 @@ public class KubernetesService : IKubernetesService } using var streamReader = new StreamReader(stdError); - while (streamReader.EndOfStream == false) + var error = string.Empty; + while (await streamReader.ReadLineAsync(cancellationToken) is { } line) { - var error = await streamReader.ReadToEndAsync(cancellationToken); - Log.Error("Remote error: {Error}",error); + error += line.Trim() + Environment.NewLine; + } + + if (string.IsNullOrEmpty(error)) + { + Log.Error("Remote error: {Error}",error); } }); diff --git a/K8sFileBrowser/ViewLocator.cs b/K8sFileBrowser/ViewLocator.cs index fe9bb1f..e6048e3 100644 --- a/K8sFileBrowser/ViewLocator.cs +++ b/K8sFileBrowser/ViewLocator.cs @@ -7,9 +7,10 @@ namespace K8sFileBrowser; public class ViewLocator : IDataTemplate { - public Control Build(object data) + public Control Build(object? data) { - var name = data.GetType().FullName!.Replace("ViewModel", "View"); + var name = data?.GetType().FullName!.Replace("ViewModel", "View"); + if (name == null) return new TextBlock { Text = "Not Found: " + name }; var type = Type.GetType(name); if (type != null) @@ -20,7 +21,7 @@ public class ViewLocator : IDataTemplate return new TextBlock { Text = "Not Found: " + name }; } - public bool Match(object data) + public bool Match(object? data) { return data is ViewModelBase; } diff --git a/K8sFileBrowser/app.manifest b/K8sFileBrowser/app.manifest index 6f66f95..3d6e014 100644 --- a/K8sFileBrowser/app.manifest +++ b/K8sFileBrowser/app.manifest @@ -3,7 +3,7 @@ - + diff --git a/build/Build.cs b/build/Build.cs index a7cd21e..be422bd 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -12,7 +12,7 @@ class Build : NukeBuild [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; - [Parameter] readonly string Version = "1.6.0"; + [Parameter] readonly string Version = "1.7.0"; AbsolutePath SourceDirectory => RootDirectory / "K8sFileBrowser"; AbsolutePath OutputDirectory => RootDirectory / "output"; @@ -47,12 +47,12 @@ class Build : NukeBuild .SetConfiguration(Configuration) .SetOutput(WinOutputDirectory) .EnableSelfContained() - .SetFramework("net9.0") + .SetFramework("net10.0") .SetRuntime("win-x64") .EnablePublishSingleFile() .EnablePublishReadyToRun() .SetAuthors("Andreas Billmann") - .SetCopyright("Copyright (c) 2023") + .SetCopyright("Copyright (c) 2025") .SetVersion(Version) .SetProcessAdditionalArguments("-p:IncludeNativeLibrariesForSelfExtract=true")); @@ -72,12 +72,12 @@ class Build : NukeBuild .SetConfiguration(Configuration) .SetOutput(LinuxOutputDirectory) .EnableSelfContained() - .SetFramework("net9.0") + .SetFramework("net10.0") .SetRuntime("linux-x64") .EnablePublishSingleFile() .EnablePublishReadyToRun() .SetAuthors("Andreas Billmann") - .SetCopyright("Copyright (c) 2023") + .SetCopyright("Copyright (c) 2025") .SetVersion(Version) .SetProcessAdditionalArguments("-p:IncludeNativeLibrariesForSelfExtract=true")); @@ -96,12 +96,12 @@ class Build : NukeBuild .SetConfiguration(Configuration) .SetOutput(OsxOutputDirectory) .EnableSelfContained() - .SetFramework("net9.0") + .SetFramework("net10.0") .SetRuntime("osx-arm64") .EnablePublishSingleFile() .EnablePublishReadyToRun() .SetAuthors("Andreas Billmann") - .SetCopyright("Copyright (c) 2023") + .SetCopyright("Copyright (c) 2025") .SetVersion(Version) .SetProcessAdditionalArguments("-p:IncludeNativeLibrariesForSelfExtract=true")); diff --git a/build/_build.csproj b/build/_build.csproj index d765605..7e4b4e8 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 CS0649;CS0169 .. diff --git a/global.json b/global.json index 93398a3..e184eb5 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.0", + "version": "10.0.0", "rollForward": "latestFeature", "allowPrerelease": false }