Skip to content
Open
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 @@ -115,6 +115,13 @@ private static class Actions extends HorizontalLayout {
private final long rolloutId;
private final Grid<MgmtRolloutResponseBody> grid;
private final transient HawkbitMgmtClient hawkbitClient;
/**
* Mirrored from RolloutManagement.ROLLOUT_STATUS_STOPPABLE
* @see org.eclipse.hawkbit.repository.jpa.management.JpaRolloutManagement
*/
private static final List<String> ROLLOUT_STATUS_STOPPABLE = List.of(
"creating", "ready", "waiting_for_approval", "starting", "running",
"paused", "approval_denied");

private Actions(final MgmtRolloutResponseBody rollout, final Grid<MgmtRolloutResponseBody> grid,
final HawkbitMgmtClient hawkbitClient) {
Expand Down Expand Up @@ -156,15 +163,33 @@ private void init(final MgmtRolloutResponseBody rollout) {
}
}, "Resume"));
}
if (ROLLOUT_STATUS_STOPPABLE.contains(rollout.getStatus())) {
add(Utils.tooltip(new Button(VaadinIcon.STOP.create()) {
{
addClickListener(v -> Utils.confirmDialog("Confirm Stopping",
"Are you sure you want to stop the selected rollout? This action cannot be undone.",
"Stop",
() -> {
hawkbitClient.getRolloutRestApi().stop(rollout.getId());
grid.getDataProvider().refreshAll();
}).open()
);
}
}, "Stop"));
}
add(Utils.tooltip(new Button(VaadinIcon.TRASH.create()) {

{
addClickListener(v -> {
hawkbitClient.getRolloutRestApi().delete(rollout.getId());
grid.getDataProvider().refreshAll();
});

addClickListener(v -> Utils.confirmDialog("Confirm deletion",
"Are you sure you want to delete the selected rollout? This action cannot be undone.",
"Delete",
() -> {
hawkbitClient.getRolloutRestApi().delete(rollout.getId());
grid.getDataProvider().refreshAll();
}).open()
);
}
}, "Cancel and Remove"));
}, "Cancel and remove"));
}

private void refresh() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
import org.eclipse.hawkbit.ui.view.util.TableView;
import org.eclipse.hawkbit.ui.view.util.Utils;

import java.util.*;
import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;

Expand All @@ -59,6 +63,10 @@
@RolesAllowed({ "TARGET_READ" })
@Uses(Icon.class)
public class TargetFilterQueryView extends TableView<TargetFilterQueryView.TargetFilterQueryGridItem, Long> {

@Serial
private static final long serialVersionUID = 1L;

public TargetFilterQueryView(final HawkbitMgmtClient hawkbitClient) {
super(
new TargetFilterQueryFilter(),
Expand Down Expand Up @@ -203,7 +211,7 @@ private void init(final MgmtTargetFilterQuery filter) {
}
Button deleteButton = new Button(VaadinIcon.TRASH.create());
deleteButton.addClickListener(e -> {
ConfirmDialog dialog = Utils.confirmDialog("Delete Target Filter Query",
ConfirmDialog dialog = Utils.confirmDialog("Confirm Deletion",
"Are you sure you want to delete the target filter query '" + filter.getName() + "'?",
"Delete",
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.checkbox.CheckboxGroup;
import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.confirmdialog.ConfirmDialog;
import com.vaadin.flow.component.datetimepicker.DateTimePicker;
import com.vaadin.flow.component.dependency.Uses;
import com.vaadin.flow.component.formlayout.FormLayout;
Expand Down
Loading