mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
added plugin config api
This commit is contained in:
@@ -2,5 +2,49 @@
|
||||
* To change this template, choose Tools | Templates
|
||||
* 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.group.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="plugins/sonia.plugin.js"></script>
|
||||
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
|
||||
var debug = true;
|
||||
var state = null;
|
||||
|
||||
// functions called after login
|
||||
var authCallbacks = [];
|
||||
|
||||
// config form panels
|
||||
var repositoryConfigPanels = [];
|
||||
|
||||
var repositoryTypeStore = new Ext.data.JsonStore({
|
||||
id: 1,
|
||||
fields: [ 'displayName', 'name' ]
|
||||
|
||||
@@ -59,26 +59,27 @@ Ext.onReady(function(){
|
||||
tabPanel
|
||||
]});
|
||||
|
||||
function addGroupPanel(){
|
||||
function addTabPanel(id, xtype, title){
|
||||
tabPanel.add({
|
||||
id: 't_group',
|
||||
xtype: 'groupGrid',
|
||||
title: 'Groups',
|
||||
id: id,
|
||||
xtype: xtype,
|
||||
title: title,
|
||||
closable: true,
|
||||
autoScroll: true
|
||||
});
|
||||
tabPanel.setActiveTab('t_group');
|
||||
tabPanel.setActiveTab(id);
|
||||
}
|
||||
|
||||
function addGroupPanel(){
|
||||
addTabPanel('t_group', 'groupGrid', 'Groups');
|
||||
}
|
||||
|
||||
function addRepositoryPanel(){
|
||||
tabPanel.add({
|
||||
id: 't_repository',
|
||||
xtype: 'repositoryGrid',
|
||||
title: 'Repositories',
|
||||
closable: true,
|
||||
autoScroll: true
|
||||
});
|
||||
tabPanel.setActiveTab('t_repository');
|
||||
addTabPanel('t_repository', 'repositoryGrid', 'Repositories');
|
||||
}
|
||||
|
||||
function addConfigPanel(){
|
||||
addTabPanel('t_config', 'configPanel', 'Repository Config');
|
||||
}
|
||||
|
||||
function createMainMenu(){
|
||||
@@ -99,7 +100,7 @@ Ext.onReady(function(){
|
||||
fn: function(){ console.debug( 'General Config' ); }
|
||||
},{
|
||||
label: 'Repository Types',
|
||||
fn: function(){ console.debug( 'Repository Type Config' ); }
|
||||
fn: addConfigPanel
|
||||
},{
|
||||
label: 'Server',
|
||||
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