Commit 1a1c0208 authored by Dietmar Maurer's avatar Dietmar Maurer

implement datacenter http_proxy editor

parent c3df148f
......@@ -25,7 +25,7 @@ Ext.Ajax.on('beforerequest', function(conn, options) {
}
});
// custom Vtype for vtype:'IPAddress'
// custom Vtypes
Ext.apply(Ext.form.field.VTypes, {
IPAddress: function(v) {
return (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/).test(v);
......@@ -57,7 +57,12 @@ Ext.apply(Ext.form.field.VTypes, {
StorageId: function(v) {
return (/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i).test(v);
},
StorageIdText: "ID contains illegal characters (allowed characters: 'a-z', '0-9', '-', '_' and '.')"
StorageIdText: "ID contains illegal characters (allowed characters: 'a-z', '0-9', '-', '_' and '.')",
HttpProxy: function(v) {
return (/^http:\/\/.*$/).test(v);
},
HttpProxyText: "Must confirm to schema 'http://.*' (example: 'http://username:password\@host:port/')"
});
// we dont want that a displayfield set the form dirty flag!
......
Ext.define('PVE.dc.HttpProxyEdit', {
extend: 'PVE.window.Edit',
initComponent : function() {
var me = this;
Ext.applyIf(me, {
title: "Edit HTTP proxy settings",
items: {
xtype: 'pvetextfield',
name: 'http_proxy',
vtype: 'HttpProxy',
emptyText: 'Do not use any proxy',
deleteEmpty: true,
value: '',
fieldLabel: 'HTTP proxy'
}
});
me.callParent();
me.load();
}
});
Ext.define('PVE.dc.LanguageEdit', {
extend: 'PVE.window.Edit',
......@@ -67,8 +92,15 @@ Ext.define('PVE.dc.OptionView', {
required: true
},
http_proxy: {
header: 'HTTP proxy',
required: true
header: 'HTTP proxy',
editor: 'PVE.dc.HttpProxyEdit',
required: true,
renderer: function(value) {
if (!value) {
return "Do not use any proxy";
}
return value;
}
}
};
......
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