]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
fix #1175: make error messages more verbose
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 20 Oct 2016 11:51:43 +0000 (13:51 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Oct 2016 15:25:57 +0000 (17:25 +0200)
the error messages for several input fields (e.g. snapshot name)
did not correctly reflect the regex which was checked

this patch adds additional information about the required format

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Toolkit.js

index 6e30589703e219909c94fe2be2f3091c551d1dbe..e23985e8e866622a727953dc8a543f52b8f53ca6 100644 (file)
@@ -68,8 +68,10 @@ Ext.apply(Ext.form.field.VTypes, {
     InterfaceName: function(v) {
         return (/^[a-z][a-z0-9_]{1,20}$/).test(v);
     },
-    InterfaceNameText: gettext('Format') + ': [a-z][a-z0-9_]{1,20}',
-
+    InterfaceNameText: gettext("Allowed characters") + ": 'a-z', '0-9', '_'" + "<br />" +
+                      gettext("Minimum characters") + ": 2" + "<br />" +
+                      gettext("Maximum characters") + ": 21" + "<br />" +
+                      gettext("Must start with") + ": 'a-z'",
 
     QemuStartDate: function(v) {
        return (/^(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)$/).test(v);
@@ -79,12 +81,17 @@ Ext.apply(Ext.form.field.VTypes, {
     StorageId:  function(v) {
         return (/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i).test(v);
     },
-    StorageIdText: gettext("Allowed characters") + ":  'A-Z', 'a-z', '0-9', '-', '_', '.'",
+    StorageIdText: gettext("Allowed characters") + ":  'A-Z', 'a-z', '0-9', '-', '_', '.'" + "<br />" +
+                  gettext("Minimum characters") + ": 2" + "<br />" +
+                  gettext("Must start with") + ": 'A-Z', 'a-z'<br />" +
+                  gettext("Must end with") + ": 'A-Z', 'a-z', '0-9'<br />",
 
     ConfigId:  function(v) {
         return (/^[a-z][a-z0-9\_]+$/i).test(v);
     },
-    ConfigIdText: gettext("Allowed characters") + ": 'A-Z', 'a-z', '0-9', '_'",
+    ConfigIdText: gettext("Allowed characters") + ": 'A-Z', 'a-z', '0-9', '_'" + "<br />" +
+                 gettext("Minimum characters") + ": 2" + "<br />" +
+                 gettext("Must start with") + ": " + gettext("letter"),
 
     HttpProxy:  function(v) {
         return (/^http:\/\/.*$/).test(v);