implement datacenter http_proxy editor
This commit is contained in:
parent
c3df148fca
commit
1a1c020896
@ -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!
|
||||
|
@ -1,3 +1,28 @@
|
||||
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',
|
||||
|
||||
@ -68,7 +93,14 @@ Ext.define('PVE.dc.OptionView', {
|
||||
},
|
||||
http_proxy: {
|
||||
header: 'HTTP proxy',
|
||||
required: true
|
||||
editor: 'PVE.dc.HttpProxyEdit',
|
||||
required: true,
|
||||
renderer: function(value) {
|
||||
if (!value) {
|
||||
return "Do not use any proxy";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user