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:
commit
d24df1de72
4 changed files with 17 additions and 5 deletions
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
|
@ -11,7 +11,9 @@
|
||||||
"preLaunchTask": "build",
|
"preLaunchTask": "build",
|
||||||
// Se i framework di destinazione sono stati modificati, assicurarsi di aggiornare il percorso del programma.
|
// 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",
|
"program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper/bin/Debug/net8.0/cv4pve-pepper.dll",
|
||||||
"args": [],
|
"args": [
|
||||||
|
"@Parm.parm"
|
||||||
|
],
|
||||||
"cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper",
|
"cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper",
|
||||||
// Per ulteriori informazioni sul campo 'console', vedere https://aka.ms/VSCode-CS-LaunchJson-Console
|
// Per ulteriori informazioni sul campo 'console', vedere https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||||
"console": "internalConsole",
|
"console": "internalConsole",
|
||||||
|
|
1
.vscode/settings.json
vendored
Normal file
1
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Version>1.7.0</Version>
|
<Version>1.7.2</Version>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<AssemblyName>cv4pve-pepper</AssemblyName>
|
<AssemblyName>cv4pve-pepper</AssemblyName>
|
||||||
<Company>Corsinvest Srl</Company>
|
<Company>Corsinvest Srl</Company>
|
||||||
|
@ -15,7 +15,9 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
|
<!-- <ProjectReference
|
||||||
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="8.2.0" />
|
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>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.CommandLine;
|
using System.CommandLine;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
@ -65,7 +66,13 @@ app.SetHandler(async (ctx) =>
|
||||||
if (app.DebugIsActive()) { await Console.Out.WriteLineAsync($"VM is {vm.Status}."); }
|
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)
|
if (success)
|
||||||
{
|
{
|
||||||
//proxy force
|
//proxy force
|
||||||
|
|
Loading…
Reference in a new issue