added git config to the web user interface

This commit is contained in:
Sebastian Sdorra
2010-09-26 17:11:58 +02:00
parent aec9590999
commit b45953ba0a
3 changed files with 172 additions and 1 deletions

View File

@@ -0,0 +1,63 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
registerConfigPanel({
xtype : 'configForm',
title : 'Git Settings',
items : [{
xtype : 'textfield',
fieldLabel : 'Git Binary',
name : 'gitBinary',
allowBlank : false
},{
xtype: 'textfield',
name: 'repositoryDirectory',
fieldLabel: 'Repository directory',
allowBlank : false
},{
xtype: 'textfield',
name: 'baseUrl',
fieldLabel: 'Base URL',
allowBlank : false
}],
onSubmit: function(values){
this.el.mask('Submit ...');
Ext.Ajax.request({
url: restUrl + 'config/repositories/git.json',
method: 'POST',
jsonData: values,
scope: this,
disableCaching: true,
success: function(response){
this.el.unmask();
},
failure: function(){
this.el.unmask();
}
});
},
onLoad: function(el){
var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100);
Ext.Ajax.request({
url: restUrl + 'config/repositories/git.json',
method: 'GET',
scope: this,
disableCaching: true,
success: function(response){
var obj = Ext.decode(response.responseText);
this.load(obj);
clearTimeout(tid);
el.unmask();
},
failure: function(){
el.unmask();
clearTimeout(tid);
alert('failure');
}
});
}
});