mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
added plugin config api
This commit is contained in:
@@ -2,5 +2,49 @@
|
|||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
repositoryConfigPanels.push({
|
||||||
|
style: 'margin: 10px',
|
||||||
|
trackResetOnLoad : true,
|
||||||
|
autoScroll : true,
|
||||||
|
border : false,
|
||||||
|
frame : false,
|
||||||
|
collapsible : false,
|
||||||
|
collapsed : false,
|
||||||
|
layoutConfig : {
|
||||||
|
labelSeparator : ''
|
||||||
|
},
|
||||||
|
items : [{
|
||||||
|
xtype : 'fieldset',
|
||||||
|
checkboxToggle : false,
|
||||||
|
title : 'Mercurial Settings',
|
||||||
|
collapsible : true,
|
||||||
|
autoHeight : true,
|
||||||
|
labelWidth : 140,
|
||||||
|
buttonAlign: 'left',
|
||||||
|
layoutConfig : {
|
||||||
|
labelSeparator : ''
|
||||||
|
},
|
||||||
|
items : [{
|
||||||
|
xtype : 'textfield',
|
||||||
|
fieldLabel : 'HG Binary',
|
||||||
|
name : 'hgBinary',
|
||||||
|
allowBlank : false
|
||||||
|
},{
|
||||||
|
xtype: 'textfield',
|
||||||
|
name: 'hgRepoDirectroy',
|
||||||
|
fieldLabel: 'Repository directory',
|
||||||
|
allowBlank : false
|
||||||
|
},{
|
||||||
|
xtype: 'textfield',
|
||||||
|
name: 'hgBaseUrl',
|
||||||
|
fieldLabel: 'Base URL',
|
||||||
|
allowBlank : false
|
||||||
|
}],
|
||||||
|
buttons: [{
|
||||||
|
text: 'Save'
|
||||||
|
},{
|
||||||
|
text: 'Cancel'
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
|
||||||
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<script type="text/javascript" src="resources/js/sonia.login.js"></script>
|
<script type="text/javascript" src="resources/js/sonia.login.js"></script>
|
||||||
<script type="text/javascript" src="resources/js/sonia.group.js"></script>
|
<script type="text/javascript" src="resources/js/sonia.group.js"></script>
|
||||||
<script type="text/javascript" src="resources/js/sonia.repository.js"></script>
|
<script type="text/javascript" src="resources/js/sonia.repository.js"></script>
|
||||||
|
<script type="text/javascript" src="resources/js/sonia.config.js"></script>
|
||||||
<script type="text/javascript" src="resources/js/layout.js"></script>
|
<script type="text/javascript" src="resources/js/layout.js"></script>
|
||||||
<script type="text/javascript" src="plugins/sonia.plugin.js"></script>
|
<script type="text/javascript" src="plugins/sonia.plugin.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,13 @@
|
|||||||
|
|
||||||
var debug = true;
|
var debug = true;
|
||||||
var state = null;
|
var state = null;
|
||||||
|
|
||||||
|
// functions called after login
|
||||||
var authCallbacks = [];
|
var authCallbacks = [];
|
||||||
|
|
||||||
|
// config form panels
|
||||||
|
var repositoryConfigPanels = [];
|
||||||
|
|
||||||
var repositoryTypeStore = new Ext.data.JsonStore({
|
var repositoryTypeStore = new Ext.data.JsonStore({
|
||||||
id: 1,
|
id: 1,
|
||||||
fields: [ 'displayName', 'name' ]
|
fields: [ 'displayName', 'name' ]
|
||||||
|
|||||||
@@ -59,26 +59,27 @@ Ext.onReady(function(){
|
|||||||
tabPanel
|
tabPanel
|
||||||
]});
|
]});
|
||||||
|
|
||||||
function addGroupPanel(){
|
function addTabPanel(id, xtype, title){
|
||||||
tabPanel.add({
|
tabPanel.add({
|
||||||
id: 't_group',
|
id: id,
|
||||||
xtype: 'groupGrid',
|
xtype: xtype,
|
||||||
title: 'Groups',
|
title: title,
|
||||||
closable: true,
|
closable: true,
|
||||||
autoScroll: true
|
autoScroll: true
|
||||||
});
|
});
|
||||||
tabPanel.setActiveTab('t_group');
|
tabPanel.setActiveTab(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addGroupPanel(){
|
||||||
|
addTabPanel('t_group', 'groupGrid', 'Groups');
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRepositoryPanel(){
|
function addRepositoryPanel(){
|
||||||
tabPanel.add({
|
addTabPanel('t_repository', 'repositoryGrid', 'Repositories');
|
||||||
id: 't_repository',
|
}
|
||||||
xtype: 'repositoryGrid',
|
|
||||||
title: 'Repositories',
|
function addConfigPanel(){
|
||||||
closable: true,
|
addTabPanel('t_config', 'configPanel', 'Repository Config');
|
||||||
autoScroll: true
|
|
||||||
});
|
|
||||||
tabPanel.setActiveTab('t_repository');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMainMenu(){
|
function createMainMenu(){
|
||||||
@@ -99,7 +100,7 @@ Ext.onReady(function(){
|
|||||||
fn: function(){ console.debug( 'General Config' ); }
|
fn: function(){ console.debug( 'General Config' ); }
|
||||||
},{
|
},{
|
||||||
label: 'Repository Types',
|
label: 'Repository Types',
|
||||||
fn: function(){ console.debug( 'Repository Type Config' ); }
|
fn: addConfigPanel
|
||||||
},{
|
},{
|
||||||
label: 'Server',
|
label: 'Server',
|
||||||
fn: function(){ console.debug( 'Server Config' ); }
|
fn: function(){ console.debug( 'Server Config' ); }
|
||||||
|
|||||||
30
scm-webapp/src/main/webapp/resources/js/sonia.config.js
Normal file
30
scm-webapp/src/main/webapp/resources/js/sonia.config.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Ext.ns("Sonia.config");
|
||||||
|
|
||||||
|
Sonia.config.ConfigPanel = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
|
initComponent: function(){
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
region: 'center',
|
||||||
|
bodyCssClass: 'x-panel-mc',
|
||||||
|
trackResetOnLoad: true,
|
||||||
|
autoScroll: true,
|
||||||
|
border: false,
|
||||||
|
frame: false,
|
||||||
|
collapsible: false,
|
||||||
|
collapsed: false,
|
||||||
|
items: repositoryConfigPanels
|
||||||
|
}
|
||||||
|
|
||||||
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||||
|
Sonia.config.ConfigPanel.superclass.initComponent.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Ext.reg("configPanel", Sonia.config.ConfigPanel);
|
||||||
Reference in New Issue
Block a user