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