diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java index 6d7f16c85cedb22e3592125240222074a43dadba..3a3bd1ce463b9cb8af817a844c59505709d7b614 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java @@ -27,6 +27,8 @@ import javax.annotation.PreDestroy; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; +import kieker.webgui.common.Global; + /** * This bean will later contain information about the user of this session (like user name and authorization). For the moment every user will be a guest user. * @@ -48,7 +50,7 @@ public final class UserBean implements Serializable { /** * This field contains the name of the user. */ - private final String userName; + private String userName; /** * Creates a new instance of this class. The user name is set to "Guest". @@ -74,4 +76,23 @@ public final class UserBean implements Serializable { return this.userName; } + /** + * Sets the new user name of the current session. + * + * @param name + * The new user name. + */ + public void setUserName(final String name) { + this.userName = name; + } + + /** + * Tries to login. + * + * @return The new page. + */ + public String login() { + return Global.PAGE_PROJECT_OVERVIEW; + } + } diff --git a/Kieker.WebGUI/src/main/webapp/Login.xhtml b/Kieker.WebGUI/src/main/webapp/Login.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..599fa868c738e9b2c9f8088e17f0d4306fc164fb --- /dev/null +++ b/Kieker.WebGUI/src/main/webapp/Login.xhtml @@ -0,0 +1,60 @@ +<?xml version='1.0' encoding='UTF-8' ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:p="http://primefaces.org/ui" + xmlns:c="http://java.sun.com/jsp/jstl/core"> + + <h:head> + <title>Kieker.WebGUI</title> + <link rel="stylesheet" type="text/css" href="../css/Common.css" /> + <link rel="stylesheet" type="text/css" href="../css/Login.css" /> + <style> + .col1 { + width: fit-content !important; + } + + .col2 { + width: 100% !important; + } + + .input { + width: 100% !important; + } + + .grid { + width: 100% !important; + } + + .login-panel { + width: 30%; + text-align: center + } + </style> + </h:head> + + <h:body> + <img src="../img/kieker-logo-transparent.png" /><br/> + <p:spacer width="0" height="100"/> + <h:form> + <div align="center"> + <p:panel header="Welcome to the Kieker.WebGUI" styleClass="login-panel"> + <h:panelGrid columnClasses="col1 , col2" styleClass="grid" columns="2" cellpadding="5"> + <h:outputLabel for="username" value="Username:" /> + <p:inputText styleClass="input" id="username" required="true" value="#{userBean.userName}" label="username"/> + + <h:outputLabel for="password" value="Password:" /> + <p:password styleClass="input" id="password" required="false" label="password" /> + </h:panelGrid> + <hr/> + <div align="right"> + <p:commandButton value="Login" ajax="false" action="#{userBean.login}" /> + </div> + </p:panel> + </div> + </h:form> + + </h:body> +</html> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml index 6c25f06f5efb55a8b7721f2ab17c68dd7249a63d..411d288065ae4fc6c1ff69c7ff724e81b3e63bbd 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml @@ -33,5 +33,10 @@ <pattern value="/Kieker.WebGUI/cockpit" /> <view-id value="/faces/Cockpit.xhtml" /> </url-mapping> + + <url-mapping id="login"> + <pattern value="/Kieker.WebGUI/login" /> + <view-id value="/faces/Login.xhtml" /> + </url-mapping> </pretty-config> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/css/Login.css b/Kieker.WebGUI/src/main/webapp/css/Login.css new file mode 100644 index 0000000000000000000000000000000000000000..8d52f57c5736644ae39b3861ce594d76b899f8f0 --- /dev/null +++ b/Kieker.WebGUI/src/main/webapp/css/Login.css @@ -0,0 +1,5 @@ +@charset "UTF-8"; + +.ui-panel { + font-size: 12px; +} diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml index 719db0c1e099324ad583acf64a03995e7b5d1346..168b95e4d2e6a7c0593d44f00272268e3f7020d6 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml @@ -15,6 +15,11 @@ <f:selectItem itemLabel="Choose Theme" itemValue="" /> <f:selectItems value="#{themeSwitcherBean.themes}" /> </p:themeSwitcher> + + <h:outputText value="Language:"/> + <p:selectOneMenu effectDuration="20" style="width:150px"> + <f:selectItem itemLabel="English"/> + </p:selectOneMenu> </h:panelGrid> <hr/> <div style="text-align: right">