Skip to content

Commit 4513d3b

Browse files
committed
noVNC: make show dot configurable
1 parent 2c1aad4 commit 4513d3b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public interface ConsoleProxyManager extends Manager, ConsoleProxyService {
5656
ConfigKey<Boolean> NoVncConsoleSourceIpCheckEnabled = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Boolean.class, "novnc.console.sourceip.check.enabled", "false",
5757
"If true, The source IP to access novnc console must be same as the IP in request to management server for console URL. Needs to reconnect CPVM to management server when this changes (via restart CPVM, or management server, or cloud service in CPVM)", false);
5858

59+
ConfigKey<Boolean> NoVncConsoleShowDot = new ConfigKey<>(Boolean.class, "novnc.console.default", ConfigKey.CATEGORY_ADVANCED, "true",
60+
"If true, in noVNC console a dot cursor will be shown when the remote server provides no local cursor, or provides a fully-transparent (invisible) cursor.",
61+
true, ConfigKey.Scope.Zone, null);
62+
5963
ConfigKey<String> ConsoleProxyServiceOffering = new ConfigKey<>(String.class, "consoleproxy.service.offering", "Console Proxy", null,
6064
"Uuid of the service offering used by console proxy; if NULL - system offering will be used", true, ConfigKey.Scope.Zone, null);
6165

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ public String getConfigComponentName() {
15721572
public ConfigKey<?>[] getConfigKeys() {
15731573
return new ConfigKey<?>[] { ConsoleProxySslEnabled, NoVncConsoleDefault, NoVncConsoleSourceIpCheckEnabled, ConsoleProxyServiceOffering,
15741574
ConsoleProxyCapacityStandby, ConsoleProxyCapacityScanInterval, ConsoleProxyCmdPort, ConsoleProxyRestart, ConsoleProxyUrlDomain, ConsoleProxySessionMax, ConsoleProxySessionTimeout, ConsoleProxyDisableRpFilter, ConsoleProxyLaunchMax,
1575-
ConsoleProxyManagementLastState, ConsoleProxyServiceManagementState };
1575+
ConsoleProxyManagementLastState, ConsoleProxyServiceManagementState, NoVncConsoleShowDot };
15761576
}
15771577

15781578
protected ConsoleProxyStatus parseJsonToConsoleProxyStatus(String json) throws JsonParseException {

server/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManagerImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
import com.google.gson.Gson;
9090
import com.google.gson.GsonBuilder;
9191

92+
import static com.cloud.consoleproxy.ConsoleProxyManager.NoVncConsoleShowDot;
93+
9294
public class ConsoleAccessManagerImpl extends ManagerBase implements ConsoleAccessManager {
9395

9496
@Inject
@@ -565,8 +567,9 @@ protected String generateConsoleAccessUrl(String rootUrl, ConsoleProxyClientPara
565567
if (param.getHypervHost() != null || !ConsoleProxyManager.NoVncConsoleDefault.value()) {
566568
sb.append("/ajax?token=").append(token);
567569
} else {
570+
String showDot = NoVncConsoleShowDot.valueIn(vm.getDataCenterId()) ? "true" : "false";
568571
sb.append("/resource/noVNC/vnc.html")
569-
.append("?autoconnect=true&show_dot=true")
572+
.append("?autoconnect=true&show_dot=").append(showDot)
570573
.append("&port=").append(vncPort)
571574
.append("&token=").append(token);
572575
if (requiresVncOverWebSocketConnection(vm, hostVo) && StringUtils.isNotBlank(locale)) {

0 commit comments

Comments
 (0)