diff --git a/README.md b/README.md index 9615c62..20d6884 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ Options: All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. If specify http://[host]:[port] then replace proxy option in file .vv. E.g. for reverse proxy. - --viewer Executable SPICE client remote viewer + --viewer Executable SPICE client remote viewer. + --viewer-options Send options directly SPICE Viewer (quote value). Commands: app-check-update Check update application @@ -69,6 +70,7 @@ this software aims to simplify run SPICE client from Proxmox VE using command li * Support multiple host for HA in --host parameter es. host[:port],host1[:port],host2[:port] * Check-Update and Upgrade application * Use Api token --api-token parameter +* Send options directly to viewer ## Api token @@ -107,6 +109,11 @@ root@debian:~# cv4pve-pepper --host=192.168.0.100 --username=root@pam --password * Linux /usr/bin/remote-viewer * Windows C:\Program Files\VirtViewer v?.?-???\bin\remote-viewer.exe +## Options of remove viewer + +Use --viewer-options to send options to viewer. +E.g. --viewer-options "-f" for full screen. + ## Error * **no spice port**: This error appears when you have not configured the display hardware on SPICE. diff --git a/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj b/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj index c98a198..9c33dbc 100644 --- a/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj +++ b/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj @@ -1,8 +1,8 @@  Exe - 1.4.0 - netcoreapp3.1 + 1.5 .0 + net5.0 cv4pve-pepper Corsinvest Srl Daniele Corsini @@ -19,9 +19,9 @@ - + - + diff --git a/src/Corsinvest.ProxmoxVE.Pepper/Program.cs b/src/Corsinvest.ProxmoxVE.Pepper/Program.cs index aeb0571..db81559 100644 --- a/src/Corsinvest.ProxmoxVE.Pepper/Program.cs +++ b/src/Corsinvest.ProxmoxVE.Pepper/Program.cs @@ -35,12 +35,12 @@ namespace Corsinvest.ProxmoxVE.Pepper " If specify http://[host]:[port] then replace proxy option in file .vv. E.g. for reverse proxy.", CommandOptionType.SingleValue); - var optRemoteViewer = app.Option("--viewer", - "Executable SPICE client remote viewer", - CommandOptionType.SingleValue) + var optRemoteViewer = app.Option("--viewer", "Executable SPICE client remote viewer.", CommandOptionType.SingleValue) .DependOn(app, CommandOptionExtension.HOST_OPTION_NAME); optRemoteViewer.Accepts().ExistingFile(); + var optViewerOptions = app.Option("--viewer-options", "Send options directly SPICE Viewer (quote value).", CommandOptionType.SingleValue); + app.OnExecute(() => { var client = app.ClientTryLogin(); @@ -83,15 +83,17 @@ namespace Corsinvest.ProxmoxVE.Pepper RedirectStandardOutput = false, }; + var viewerOpts = optViewerOptions.Value() + ""; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { startInfo.FileName = "/bin/bash"; - startInfo.Arguments = $"-c \"{optRemoteViewer.Value()} {fileName}\""; + startInfo.Arguments = $"-c \"{optRemoteViewer.Value()} {fileName} {viewerOpts}\""; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { startInfo.FileName = StringHelper.Quote(optRemoteViewer.Value()); - startInfo.Arguments = StringHelper.Quote(fileName); + startInfo.Arguments = $"\"{fileName}\" {viewerOpts}"; } var process = new Process diff --git a/src/Corsinvest.ProxmoxVE.Pepper/build.ps1 b/src/Corsinvest.ProxmoxVE.Pepper/build.ps1 index 394c821..294007b 100644 --- a/src/Corsinvest.ProxmoxVE.Pepper/build.ps1 +++ b/src/Corsinvest.ProxmoxVE.Pepper/build.ps1 @@ -23,17 +23,20 @@ Write-Output " == Build System =========================================================" -$pathNet = "Bin\Release\netcoreapp3.1" +$pathNet = "Bin\Release\net5.0" Remove-Item -Path ".\$pathNet" -Recurse -Force $rids = @("linux-x64", "linux-arm", "linux-arm64", "osx-x64", "win-x86", "win-x64", "win-arm", "win-arm64") foreach ($rid in $rids) { - dotnet publish -r $rid -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true + Write-Output "=========================================" + Write-Output "== $rid" + Write-Output "=========================================" + dotnet publish -r $rid -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeNativeLibrariesForSelfExtract=true $path = "$pathNet\$rid\publish\" $fileName = Get-ChildItem $path -Exclude *.pdb -name - $fileDest = "$pathNet\$fileName-$rid.zip" + $fileDest = "$pathNet\$fileName-$rid.zip" Remove-Item $fileDest -ErrorAction SilentlyContinue Compress-Archive $path\$fileName $fileDest } \ No newline at end of file