Skip to content

Commit 8a1fafe

Browse files
committed
Adding global setting to scale noVNC console display
1 parent f38db8a commit 8a1fafe

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public interface ConsoleProxyManager extends Manager, ConsoleProxyService {
4141
public static final ConfigKey<Boolean> NoVncConsoleDefault = new ConfigKey<Boolean>("Advanced", Boolean.class, "novnc.console.default", "true",
4242
"If true, noVNC console will be default console for virtual machines", true);
4343

44+
public static final ConfigKey<Boolean> NoVncConsoleFullscreen = new ConfigKey<Boolean>("Advanced", Boolean.class, "novnc.console.fullscreen",
45+
"true", "If true, noVNC console will be scaled to the browser resolution, making it fullscreen", true);
46+
4447
public void setManagementState(ConsoleProxyManagementState state);
4548

4649
public ConsoleProxyManagementState getManagementState();

server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ public String getConfigComponentName() {
17551755

17561756
@Override
17571757
public ConfigKey<?>[] getConfigKeys() {
1758-
return new ConfigKey<?>[] { NoVncConsoleDefault };
1758+
return new ConfigKey<?>[] { NoVncConsoleDefault, NoVncConsoleFullscreen };
17591759
}
17601760

17611761
}

server/src/main/java/com/cloud/servlet/ConsoleProxyServlet.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ private String composeConsoleAccessUrl(String rootUrl, VirtualMachine vm, HostVO
486486
} else {
487487
sb.append("/resource/noVNC/vnc_lite.html?port=" + ConsoleProxyManager.DEFAULT_NOVNC_PORT + "&token="
488488
+ encryptor.encryptObject(ConsoleProxyClientParam.class, param));
489+
if (ConsoleProxyManager.NoVncConsoleFullscreen.value()) {
490+
sb.append("&scale=true");
491+
}
489492
}
490493

491494
// for console access, we need guest OS type to help implement keyboard

0 commit comments

Comments
 (0)