1
0
Fork 0
mirror of https://github.com/Corsinvest/cv4pve-pepper.git synced 2025-02-12 10:01:53 +00:00

Merge pull request #33 from franklupo/30-spiceproxy-not-implemented

Fix #32
This commit is contained in:
Daniele Corsini 2024-06-07 10:04:42 +02:00 committed by GitHub
commit d24df1de72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 5 deletions

4
.vscode/launch.json vendored
View file

@ -11,7 +11,9 @@
"preLaunchTask": "build",
// Se i framework di destinazione sono stati modificati, assicurarsi di aggiornare il percorso del programma.
"program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper/bin/Debug/net8.0/cv4pve-pepper.dll",
"args": [],
"args": [
"@Parm.parm"
],
"cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper",
// Per ulteriori informazioni sul campo 'console', vedere https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",

1
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.7.0</Version>
<Version>1.7.2</Version>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>cv4pve-pepper</AssemblyName>
<Company>Corsinvest Srl</Company>
@ -15,7 +15,9 @@
</PropertyGroup>
<ItemGroup>
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="8.2.0" />
<!-- <ProjectReference
Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj"
/> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="8.2.1" />
</ItemGroup>
</Project>

View file

@ -5,6 +5,7 @@
using System;
using System.CommandLine;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
@ -65,7 +66,13 @@ app.SetHandler(async (ctx) =>
if (app.DebugIsActive()) { await Console.Out.WriteLineAsync($"VM is {vm.Status}."); }
}
var (success, reasonPhrase, content) = await client.Nodes[vm.Node].Qemu[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy);
var (success, reasonPhrase, content) = vm.VmType switch
{
VmType.Qemu => await client.Nodes[vm.Node].Qemu[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy),
VmType.Lxc => await client.Nodes[vm.Node].Lxc[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy),
_ => throw new InvalidEnumArgumentException(),
};
if (success)
{
//proxy force