-
+
IP address or hostname only (without port number)
@@ -1311,7 +1315,28 @@ PulseApp.ui.settings = (() => {
if (input.type === 'checkbox') {
input.checked = config[configKey] !== 'false';
} else {
- input.value = config[configKey];
+ let value = config[configKey];
+
+ // Clean host values that contain protocol or port
+ if (configKey.includes('PROXMOX_HOST_') && value) {
+ // Remove protocol (http:// or https://)
+ value = value.replace(/^https?:\/\//, '');
+ // Extract port if it's included in the host
+ const portMatch = value.match(/^([^:]+)(:(\d+))?$/);
+ if (portMatch) {
+ value = portMatch[1];
+ // If we extracted a port and there's no explicit port config, set it
+ if (portMatch[3]) {
+ const portKey = configKey.replace('HOST_', 'PORT_');
+ const portInput = newEndpoint.querySelector(`[name="${portKey}"]`);
+ if (portInput && !config[portKey]) {
+ portInput.value = portMatch[3];
+ }
+ }
+ }
+ }
+
+ input.value = value;
}
}
});
@@ -1347,7 +1372,28 @@ PulseApp.ui.settings = (() => {
if (input.type === 'checkbox') {
input.checked = config[configKey] !== 'false';
} else {
- input.value = config[configKey];
+ let value = config[configKey];
+
+ // Clean host values that contain protocol or port
+ if (configKey.includes('PBS_HOST_') && value) {
+ // Remove protocol (http:// or https://)
+ value = value.replace(/^https?:\/\//, '');
+ // Extract port if it's included in the host
+ const portMatch = value.match(/^([^:]+)(:(\d+))?$/);
+ if (portMatch) {
+ value = portMatch[1];
+ // If we extracted a port and there's no explicit port config, set it
+ if (portMatch[3]) {
+ const portKey = configKey.replace('HOST_', 'PORT_');
+ const portInput = newEndpoint.querySelector(`[name="${portKey}"]`);
+ if (portInput && !config[portKey]) {
+ portInput.value = portMatch[3];
+ }
+ }
+ }
+ }
+
+ input.value = value;
}
}
});