@@ -2088,6 +2088,18 @@
var storageType = "=get_storage_fstype($arrConfig['template']['storage']);?>";
var storageLoc = "=$arrConfig['template']['storage']?>";
+function checkVNCPorts() {
+ const port = $("#port").val();
+ const wsport = $("#wsport").val();
+ if (port < 5900 || port > 65535 || wsport < 5900 || wsport > 65535 || port == wsport) {
+ swal({
+ title: "_(Invalid Port)_",
+ text: "_(VNC/SPICE ports must be between 5900 and 65535, and cannot be equal to each other)_",
+ type: "error",
+ confirmButtonText: "_(Ok)_"
+ });
+ }
+}
function updateMAC(index, port) {
var wlan0 = '=$mac?>'; // mac address of wlan0
var mac = $('input[name="nic['+index+'][mac]"');