Skip to content
Snippets Groups Projects
Commit ec1278a3 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Added a login site.

parent 3ed66dd7
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,8 @@ import javax.annotation.PreDestroy; ...@@ -27,6 +27,8 @@ import javax.annotation.PreDestroy;
import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped; 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. * 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 { ...@@ -48,7 +50,7 @@ public final class UserBean implements Serializable {
/** /**
* This field contains the name of the user. * 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". * Creates a new instance of this class. The user name is set to "Guest".
...@@ -74,4 +76,23 @@ public final class UserBean implements Serializable { ...@@ -74,4 +76,23 @@ public final class UserBean implements Serializable {
return this.userName; 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;
}
} }
<?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
...@@ -33,5 +33,10 @@ ...@@ -33,5 +33,10 @@
<pattern value="/Kieker.WebGUI/cockpit" /> <pattern value="/Kieker.WebGUI/cockpit" />
<view-id value="/faces/Cockpit.xhtml" /> <view-id value="/faces/Cockpit.xhtml" />
</url-mapping> </url-mapping>
<url-mapping id="login">
<pattern value="/Kieker.WebGUI/login" />
<view-id value="/faces/Login.xhtml" />
</url-mapping>
</pretty-config> </pretty-config>
\ No newline at end of file
@charset "UTF-8";
.ui-panel {
font-size: 12px;
}
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
<f:selectItem itemLabel="Choose Theme" itemValue="" /> <f:selectItem itemLabel="Choose Theme" itemValue="" />
<f:selectItems value="#{themeSwitcherBean.themes}" /> <f:selectItems value="#{themeSwitcherBean.themes}" />
</p:themeSwitcher> </p:themeSwitcher>
<h:outputText value="Language:"/>
<p:selectOneMenu effectDuration="20" style="width:150px">
<f:selectItem itemLabel="English"/>
</p:selectOneMenu>
</h:panelGrid> </h:panelGrid>
<hr/> <hr/>
<div style="text-align: right"> <div style="text-align: right">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment