io.imunity.console.views.services.ServicesView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-console Show documentation
Show all versions of unity-server-console Show documentation
Task oriented web based administration UI
/*
* Copyright (c) 2019 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.console.views.services;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.router.Route;
import io.imunity.console.ConsoleMenu;
import io.imunity.console.views.services.base.ServicesViewBase;
import io.imunity.vaadin.elements.Breadcrumb;
import io.imunity.vaadin.elements.NotificationPresenter;
import io.imunity.vaadin.elements.grid.SingleActionHandler;
import io.imunity.vaadin.auth.services.ServiceDefinition;
import io.imunity.vaadin.auth.services.ServiceEditorComponent.ServiceEditorTab;
import jakarta.annotation.security.PermitAll;
import pl.edu.icm.unity.base.message.MessageSource;
/**
* Shows services list
*
* @author P.Piernik
*
*/
@PermitAll
@Breadcrumb(key = "WebConsoleMenu.services")
@Route(value = "/services", layout = ConsoleMenu.class)
public class ServicesView extends ServicesViewBase
{
@Autowired
ServicesView(MessageSource msg, ServicesController controller, NotificationPresenter notificationPresenter)
{
super(msg, notificationPresenter, controller, NewServiceView.class, EditServiceView.class);
initUI();
}
protected List> getActionsHandlers()
{
SingleActionHandler editGeneral = SingleActionHandler.builder(ServiceDefinition.class)
.withCaption(msg.getMessage("ServicesView.generalConfig")).withIcon(VaadinIcon.COGS)
.withHandler(r -> gotoEdit(r.iterator().next(), ServiceEditorTab.GENERAL)).build();
SingleActionHandler editAuth = SingleActionHandler.builder(ServiceDefinition.class)
.withCaption(msg.getMessage("ServicesView.authenticationConfig")).withIcon(VaadinIcon.SIGN_IN)
.withHandler(r -> gotoEdit(r.iterator().next(), ServiceEditorTab.AUTHENTICATION)).build();
return Arrays.asList(editGeneral, editAuth);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy