mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
added auto configuration button to mercurial config panel
This commit is contained in:
@@ -78,6 +78,27 @@ public class HgConfigResource
|
|||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param uriInfo
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("auto-configuration")
|
||||||
|
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
|
||||||
|
public HgConfig autoConfiguration(@Context UriInfo uriInfo)
|
||||||
|
{
|
||||||
|
handler.setConfig(null);
|
||||||
|
handler.doAutoConfiguration();
|
||||||
|
|
||||||
|
return handler.getConfig();
|
||||||
|
}
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -101,11 +101,8 @@ public class HgRepositoryHandler
|
|||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
public void doAutoConfiguration()
|
||||||
public void loadConfig()
|
|
||||||
{
|
{
|
||||||
super.loadConfig();
|
|
||||||
|
|
||||||
HgInstaller installer = null;
|
HgInstaller installer = null;
|
||||||
|
|
||||||
if (SystemUtil.isWindows())
|
if (SystemUtil.isWindows())
|
||||||
@@ -163,6 +160,17 @@ public class HgRepositoryHandler
|
|||||||
storeConfig();
|
storeConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void loadConfig()
|
||||||
|
{
|
||||||
|
super.loadConfig();
|
||||||
|
doAutoConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
registerConfigPanel({
|
registerConfigPanel({
|
||||||
|
id: 'hgConfigForm',
|
||||||
xtype : 'configForm',
|
xtype : 'configForm',
|
||||||
title : 'Mercurial Settings',
|
title : 'Mercurial Settings',
|
||||||
items : [{
|
items : [{
|
||||||
@@ -56,6 +57,14 @@ registerConfigPanel({
|
|||||||
name: 'useOptimizedBytecode',
|
name: 'useOptimizedBytecode',
|
||||||
fieldLabel: 'Optimized Bytecode (.pyo)',
|
fieldLabel: 'Optimized Bytecode (.pyo)',
|
||||||
inputValue: 'true'
|
inputValue: 'true'
|
||||||
|
},{
|
||||||
|
xtype: 'button',
|
||||||
|
text: 'Load Auto-Configuration',
|
||||||
|
fieldLabel: 'Auto-Configuration',
|
||||||
|
handler: function(){
|
||||||
|
var self = Ext.getCmp('hgConfigForm');
|
||||||
|
self.loadConfig( self.el, 'config/repositories/hg/auto-configuration.json', 'POST' );
|
||||||
|
}
|
||||||
}],
|
}],
|
||||||
|
|
||||||
onSubmit: function(values){
|
onSubmit: function(values){
|
||||||
@@ -76,10 +85,14 @@ registerConfigPanel({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onLoad: function(el){
|
onLoad: function(el){
|
||||||
|
this.loadConfig(el, 'config/repositories/hg.json', 'GET');
|
||||||
|
},
|
||||||
|
|
||||||
|
loadConfig: function(el, url, method){
|
||||||
var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100);
|
var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100);
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: restUrl + 'config/repositories/hg.json',
|
url: restUrl + url,
|
||||||
method: 'GET',
|
method: method,
|
||||||
scope: this,
|
scope: this,
|
||||||
disableCaching: true,
|
disableCaching: true,
|
||||||
success: function(response){
|
success: function(response){
|
||||||
|
|||||||
Reference in New Issue
Block a user