mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 02:06:18 +01:00
Merge with 25f2d9577da05c6e5fa53eb1e0c6c4b70751bd8a
This commit is contained in:
@@ -56,7 +56,9 @@ import java.net.URL;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBContext;
|
import javax.xml.bind.JAXBContext;
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
@@ -199,7 +201,18 @@ public class DefaultPluginManager implements PluginManager
|
|||||||
{
|
{
|
||||||
SecurityUtil.assertIsAdmin(securityContextProvicer);
|
SecurityUtil.assertIsAdmin(securityContextProvicer);
|
||||||
|
|
||||||
return getPluginCenter().getPlugins();
|
Set<PluginInformation> availablePlugins = new HashSet<PluginInformation>();
|
||||||
|
Set<PluginInformation> centerPlugins = getPluginCenter().getPlugins();
|
||||||
|
|
||||||
|
for (PluginInformation info : centerPlugins)
|
||||||
|
{
|
||||||
|
if (!installedPlugins.containsKey(info.getId()))
|
||||||
|
{
|
||||||
|
availablePlugins.add(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return availablePlugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ Sonia.plugin.InstalledGrid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
var config = {
|
var config = {
|
||||||
autoExpandColumn: 'description',
|
autoExpandColumn: 'description',
|
||||||
store: pluginStore,
|
store: pluginStore,
|
||||||
colModel: pluginColModel
|
colModel: pluginColModel,
|
||||||
|
emptyText: 'No plugin is installed'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -100,6 +101,32 @@ Sonia.plugin.InstalledGrid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
// register xtype
|
// register xtype
|
||||||
Ext.reg('installedPluginsGrid', Sonia.plugin.InstalledGrid);
|
Ext.reg('installedPluginsGrid', Sonia.plugin.InstalledGrid);
|
||||||
|
|
||||||
|
// loading window
|
||||||
|
|
||||||
|
Sonia.plugin.LoadingWindow = Ext.extend(Ext.Window,{
|
||||||
|
|
||||||
|
initComponent: function(){
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
layout:'fit',
|
||||||
|
width:300,
|
||||||
|
height:150,
|
||||||
|
closable: false,
|
||||||
|
resizable: false,
|
||||||
|
plain: true,
|
||||||
|
border: false,
|
||||||
|
modal: true,
|
||||||
|
items: [{
|
||||||
|
xtype: 'progress'
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||||
|
Sonia.login.Window.superclass.initComponent.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
// available plugins grid
|
// available plugins grid
|
||||||
|
|
||||||
Sonia.plugin.AvailableGrid = Ext.extend(Sonia.rest.Grid,{
|
Sonia.plugin.AvailableGrid = Ext.extend(Sonia.rest.Grid,{
|
||||||
@@ -129,7 +156,8 @@ Sonia.plugin.AvailableGrid = Ext.extend(Sonia.rest.Grid,{
|
|||||||
var config = {
|
var config = {
|
||||||
autoExpandColumn: 'description',
|
autoExpandColumn: 'description',
|
||||||
store: pluginStore,
|
store: pluginStore,
|
||||||
colModel: pluginColModel
|
colModel: pluginColModel,
|
||||||
|
emptyText: 'No plugin available'
|
||||||
};
|
};
|
||||||
|
|
||||||
this.on('cellclick', this.cellClick);
|
this.on('cellclick', this.cellClick);
|
||||||
@@ -153,6 +181,37 @@ Sonia.plugin.AvailableGrid = Ext.extend(Sonia.rest.Grid,{
|
|||||||
if ( debug ){
|
if ( debug ){
|
||||||
console.debug( 'install plugin ' + pluginId );
|
console.debug( 'install plugin ' + pluginId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var loadingBox = Ext.MessageBox.show({
|
||||||
|
title: 'Please wait',
|
||||||
|
msg: 'Installing Plugin.',
|
||||||
|
width: 300,
|
||||||
|
wait: true,
|
||||||
|
animate: true,
|
||||||
|
progress: true,
|
||||||
|
closable: false
|
||||||
|
});
|
||||||
|
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url: restUrl + 'plugins/available/' + pluginId + '.json',
|
||||||
|
method: 'POST',
|
||||||
|
scope: this,
|
||||||
|
success: function(){
|
||||||
|
if ( debug ){
|
||||||
|
console.debug('plugin successfully installed');
|
||||||
|
}
|
||||||
|
loadingBox.hide();
|
||||||
|
Ext.MessageBox.alert('Plugin successfully installed',
|
||||||
|
'Restart the applicationserver to activate the plugin.');
|
||||||
|
},
|
||||||
|
failure: function(){
|
||||||
|
if ( debug ){
|
||||||
|
console.debug('plugin installation failed');
|
||||||
|
}
|
||||||
|
alert( 'failure' );
|
||||||
|
loadingBox.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
var config = {
|
var config = {
|
||||||
autoExpandColumn: 'description',
|
autoExpandColumn: 'description',
|
||||||
store: repositoryStore,
|
store: repositoryStore,
|
||||||
colModel: repositoryColModel
|
colModel: repositoryColModel,
|
||||||
|
emptyText: 'No repository is configured'
|
||||||
};
|
};
|
||||||
|
|
||||||
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
|
|||||||
urlTemplate: '<a href="{0}" target="_blank">{0}</a>',
|
urlTemplate: '<a href="{0}" target="_blank">{0}</a>',
|
||||||
mailtoTemplate: '<a href="mailto: {0}">{0}</a>',
|
mailtoTemplate: '<a href="mailto: {0}">{0}</a>',
|
||||||
checkboxTemplate: '<input type="checkbox" disabled="true" {0}/>',
|
checkboxTemplate: '<input type="checkbox" disabled="true" {0}/>',
|
||||||
|
emptyText: 'No items available',
|
||||||
|
|
||||||
initComponent: function(){
|
initComponent: function(){
|
||||||
|
|
||||||
@@ -82,7 +83,11 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
|
|||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
loadMask: true,
|
loadMask: true,
|
||||||
sm: selectionModel
|
sm: selectionModel,
|
||||||
|
viewConfig: {
|
||||||
|
deferEmptyText: false,
|
||||||
|
emptyText: this.emptyText
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||||
|
|||||||
@@ -134,13 +134,17 @@ Ext.onReady(function(){
|
|||||||
fn: function(){
|
fn: function(){
|
||||||
addTabPanel('repositoryConfig', 'repositoryConfig', 'Repository Config');
|
addTabPanel('repositoryConfig', 'repositoryConfig', 'Repository Config');
|
||||||
}
|
}
|
||||||
},{
|
}]
|
||||||
label: 'Installed Plugins',
|
},{
|
||||||
|
id: 'navPlugins',
|
||||||
|
title: 'Plugins',
|
||||||
|
items: [{
|
||||||
|
label: 'Installed',
|
||||||
fn: function(){
|
fn: function(){
|
||||||
addTabPanel('installedPlugins', 'installedPluginsGrid', 'Installed Plugins')
|
addTabPanel('installedPlugins', 'installedPluginsGrid', 'Installed Plugins')
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
label: 'Available Plugins',
|
label: 'Available',
|
||||||
fn: function(){
|
fn: function(){
|
||||||
addTabPanel('availablePlugins', 'availablePluginsGrid', 'Available Plugins')
|
addTabPanel('availablePlugins', 'availablePluginsGrid', 'Available Plugins')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user