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, {
|
Ext.apply(Ext.form.field.VTypes, {
|
||||||
IPAddress: function(v) {
|
IPAddress: function(v) {
|
||||||
return (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/).test(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) {
|
StorageId: function(v) {
|
||||||
return (/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i).test(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!
|
// 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', {
|
Ext.define('PVE.dc.LanguageEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'PVE.window.Edit',
|
||||||
|
|
||||||
@ -67,8 +92,15 @@ Ext.define('PVE.dc.OptionView', {
|
|||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
http_proxy: {
|
http_proxy: {
|
||||||
header: '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