Merge "Show plugin status in web ui"
This commit is contained in:
@@ -108,9 +108,11 @@ public interface AdminConstants extends Constants {
|
|||||||
|
|
||||||
String plugins();
|
String plugins();
|
||||||
String pluginTabInstalled();
|
String pluginTabInstalled();
|
||||||
|
String pluginDisabled();
|
||||||
|
|
||||||
String columnPluginName();
|
String columnPluginName();
|
||||||
String columnPluginVersion();
|
String columnPluginVersion();
|
||||||
|
String columnPluginStatus();
|
||||||
|
|
||||||
String noGroupSelected();
|
String noGroupSelected();
|
||||||
String errorNoMatchingGroups();
|
String errorNoMatchingGroups();
|
||||||
|
|||||||
@@ -88,8 +88,10 @@ projectAdminTabAccess = Access
|
|||||||
|
|
||||||
plugins = Plugins
|
plugins = Plugins
|
||||||
pluginTabInstalled = Installed
|
pluginTabInstalled = Installed
|
||||||
|
pluginDisabled = Disabled
|
||||||
columnPluginName = Plugin Name
|
columnPluginName = Plugin Name
|
||||||
columnPluginVersion = Version
|
columnPluginVersion = Version
|
||||||
|
columnPluginStatus = Status
|
||||||
|
|
||||||
noGroupSelected = (No group selected)
|
noGroupSelected = (No group selected)
|
||||||
errorNoMatchingGroups = No Matching Groups
|
errorNoMatchingGroups = No Matching Groups
|
||||||
|
|||||||
@@ -60,10 +60,12 @@ public class PluginListScreen extends PluginScreen {
|
|||||||
PluginTable() {
|
PluginTable() {
|
||||||
table.setText(0, 1, Util.C.columnPluginName());
|
table.setText(0, 1, Util.C.columnPluginName());
|
||||||
table.setText(0, 2, Util.C.columnPluginVersion());
|
table.setText(0, 2, Util.C.columnPluginVersion());
|
||||||
|
table.setText(0, 3, Util.C.columnPluginStatus());
|
||||||
|
|
||||||
final FlexCellFormatter fmt = table.getFlexCellFormatter();
|
final FlexCellFormatter fmt = table.getFlexCellFormatter();
|
||||||
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
|
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
|
||||||
fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
|
fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
|
||||||
|
fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(final PluginMap plugins) {
|
void display(final PluginMap plugins) {
|
||||||
@@ -80,16 +82,24 @@ public class PluginListScreen extends PluginScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void populate(final int row, final PluginInfo plugin) {
|
void populate(final int row, final PluginInfo plugin) {
|
||||||
table.setWidget(
|
if (plugin.isDisabled()) {
|
||||||
row,
|
table.setText(row, 1, plugin.name());
|
||||||
1,
|
} else {
|
||||||
new Anchor(plugin.name(), Gerrit.selfRedirect("/plugins/"
|
table.setWidget(
|
||||||
+ plugin.name() + "/")));
|
row,
|
||||||
|
1,
|
||||||
|
new Anchor(plugin.name(), Gerrit.selfRedirect("/plugins/"
|
||||||
|
+ plugin.name() + "/")));
|
||||||
|
}
|
||||||
table.setText(row, 2, plugin.version());
|
table.setText(row, 2, plugin.version());
|
||||||
|
if (plugin.isDisabled()) {
|
||||||
|
table.setText(row, 3, Util.C.pluginDisabled());
|
||||||
|
}
|
||||||
|
|
||||||
final FlexCellFormatter fmt = table.getFlexCellFormatter();
|
final FlexCellFormatter fmt = table.getFlexCellFormatter();
|
||||||
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
|
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
|
||||||
fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
|
fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
|
||||||
|
fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
|
||||||
|
|
||||||
setRowItem(row, plugin);
|
setRowItem(row, plugin);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public class PluginInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public final native String name() /*-{ return this.name; }-*/;
|
public final native String name() /*-{ return this.name; }-*/;
|
||||||
public final native String version() /*-{ return this.version; }-*/;
|
public final native String version() /*-{ return this.version; }-*/;
|
||||||
|
public final native boolean isDisabled()
|
||||||
|
/*-{ return this.disabled ? true : false; }-*/;
|
||||||
|
|
||||||
protected PluginInfo() {
|
protected PluginInfo() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import com.google.gwtjsonrpc.common.AsyncCallback;
|
|||||||
/** Plugins available from {@code /plugins/}. */
|
/** Plugins available from {@code /plugins/}. */
|
||||||
public class PluginMap extends NativeMap<PluginInfo> {
|
public class PluginMap extends NativeMap<PluginInfo> {
|
||||||
public static void all(AsyncCallback<PluginMap> callback) {
|
public static void all(AsyncCallback<PluginMap> callback) {
|
||||||
new RestApi("/plugins/")
|
new RestApi("/plugins/").addParameterTrue("all")
|
||||||
.send(NativeMap.copyKeysIntoChildren(callback));
|
.send(NativeMap.copyKeysIntoChildren(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user