Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-1404 Deselect tickboxes on failure #1467

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ public static void getHazelcastClusterMembers(HandlerContext handlerCtx) {
@HandlerInput(name = "rows", type = List.class, required = true),
@HandlerInput(name = "command", type = String.class, required = true)},
output = {
@HandlerOutput(name = "result", type = String.class)
@HandlerOutput(name = "response", type = Map.class)
})
public static void sendAsadminCommandToSelectedInstances(HandlerContext handlerCtx) {
String parentEndpoint = (String) handlerCtx.getInputValue("parentEndpoint");
String endpoint = parentEndpoint.endsWith("/") ? parentEndpoint + "send-asadmin-command" : parentEndpoint
+ "/" + "send-asadmin-command";
List<HashMap> rows = (List<HashMap>) handlerCtx.getInputValue("rows");
String command = (String) handlerCtx.getInputValue("command");

// Check that the text box isn't empty
if (command != null) {
// Get the selected rows
Expand Down Expand Up @@ -156,7 +156,8 @@ public static void sendAsadminCommandToSelectedInstances(HandlerContext handlerC
attrsMap.put("logOutput", "true");

try{
RestUtil.restRequest(endpoint, attrsMap, "POST", handlerCtx, false, true);
Map response = RestUtil.restRequest(endpoint, attrsMap, "POST", handlerCtx, false, false);
handlerCtx.setOutputValue("response", response);
} catch (Exception ex) {
GuiUtil.handleException(handlerCtx, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@

getAllSingleMapRows(TableRowGroup="${tableRowGroup}" Rows="#{requestScope.rows}");
py.sendAsadminCommandToSelectedInstances(parentEndpoint="#{pageSession.parentUrl}",
rows="#{requestScope.rows}", command="#{pageSession.command}");

rows="#{requestScope.rows}", command="#{pageSession.command}",
response="#{pageSession.commandResponse}");

if("#{pageSession.commandResponse.data['exit_code']} = FAILURE") {
prepareAlertMsg(type="error", detail="#{pageSession.commandResponse.data.message}",
summary="An error has occurred");
gf.redirect(page="#{request.contextPath}/hazelcast/hazelcastMembersDomain.jsf?&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}");
}

py.prepareSuccessfulCommandMsg();
gf.redirect(page="#{request.contextPath}/hazelcast/hazelcastMembersDomain.jsf?&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}");
/>
Expand Down