Commit 0d3641ee authored by Damien PIQUET's avatar Damien PIQUET Committed by Dietmar Maurer

bugfix #301 Add container hostname validation in GUI

Signed-off-by: 's avatarDamien PIQUET <piqudam@gmail.com>
parent 28bd65f7
...@@ -87,7 +87,14 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -87,7 +87,14 @@ Ext.define('PVE.openvz.CreateWizard', {
value: '', value: '',
fieldLabel: 'Hostname', fieldLabel: 'Hostname',
skipEmptyText: true, skipEmptyText: true,
allowBlank: true allowBlank: true,
validator: function(value) {
var hostnamere = /^[a-zA-Z0-9\-.]+$/;
if (value && !hostnamere.test(value)) {
return "Hostname contains invalid characters !";
}
return true;
}
} }
], ],
column2: [ column2: [
...@@ -124,7 +131,7 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -124,7 +131,7 @@ Ext.define('PVE.openvz.CreateWizard', {
validator: function(value) { validator: function(value) {
var pw = me.down('field[name=password]').getValue(); var pw = me.down('field[name=password]').getValue();
if (pw !== value) { if (pw !== value) {
return "Passowords does not match!"; return "Passwords does not match!";
} }
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment