ssh-keys.xhtml 3.46 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?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:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:bw="http://www.scc.kit.edu/bwfacelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:of="http://omnifaces.org/functions">
<head>
<title></title>
</head>
<body>

<f:view>
<f:metadata>
	<f:event type="javax.faces.event.PreRenderViewEvent"
           listener="#{userSshKeyManagementBean.preRenderView}" />
</f:metadata>

<ui:composition template="/template/default.xhtml">
	<ui:param name="title" value="#{messages.title}"/>

	<ui:define name="content">
michael.simon's avatar
michael.simon committed
26
	<h:form id="form">
michael.simon's avatar
michael.simon committed
27
		<p:panel id="panel" header="#{messages.my_ssh_keys}">
28
			
29
			<div><p:messages showDetail="true" /></div>
30

michael.simon's avatar
michael.simon committed
31
32
       		<p:dataTable var="key" value="#{userSshKeyManagementBean.keyList.toArray()}">
				<p:column>
michael.simon's avatar
michael.simon committed
33
       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_name}:"/></f:facet>
34
        			<h:outputText value="#{key.pubKeyEntity.name}"/>
35
36
37
38
        		</p:column>
				<p:column>
       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_type}:"/></f:facet>
        			<h:outputText value="#{key.pubKeyEntity.keyType}"/>
michael.simon's avatar
michael.simon committed
39
40
41
        		</p:column>
        		<p:column>
        			<h:outputText value="#{key.publicKey}" rendered="#{not empty key.publicKey}" />
michael.simon's avatar
michael.simon committed
42
        			<h:outputText value="#{messages.ssh_key_type_unknown}" rendered="#{empty key.publicKey}" />
michael.simon's avatar
michael.simon committed
43
44
45
46
        		</p:column>
				<p:column>
       				<f:facet name="header"><h:outputText value="#{messages.expires}:"/></f:facet>
        			<h:outputText value="#{of:formatDate(key.pubKeyEntity.expiresAt, 'dd.MM.yyyy HH:mm')}"/>
michael.simon's avatar
michael.simon committed
47
48
        		</p:column>
        		<p:column> 
49
					<p:commandLink id="delete" action="#{userSshKeyManagementBean.deleteKey(key.pubKeyEntity.name)}" value="#{messages.delete}" immediate="true" update="@form">
michael.simon's avatar
michael.simon committed
50
51
52
53
						<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
					</p:commandLink>
				</p:column>
        	</p:dataTable>
54

michael.simon's avatar
michael.simon committed
55
			<p:panelGrid id="baseData" columns="2">
michael.simon's avatar
michael.simon committed
56
		        <bw:inputText id="sshKeyName" label="#{messages.ssh_key_name}:" 
57
58
			        	value="#{userSshKeyManagementBean.newName}" required="true"/>			

michael.simon's avatar
michael.simon committed
59
		        <h:outputText value="#{messages.ssh_key}:"/>
michael.simon's avatar
michael.simon committed
60
		        <p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 400px; height: 100px;" 
61
62
63
64
65
66
67
68
69
70
71
72
		        	autoResize="false" />
			</p:panelGrid>
			<p:commandButton id="add" action="#{userSshKeyManagementBean.deployKey()}" value="#{messages.add}" update="@form" />
			<p:ajaxStatus id="ajaxStatusPanel" style="display: inline-block; margin-left: 8px; vertical-align: baseline;">
				<f:facet name="start">  
					<h:graphicImage value="#{resource['/img/ajax-loader.gif']}" alt="#{messages.loading}"/>
				</f:facet>  
				<f:facet name="complete">  
					<h:outputText value="" />
				</f:facet>  				
			</p:ajaxStatus>  
		</p:panel>
michael.simon's avatar
michael.simon committed
73
74
75
76
77

	    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
	        <p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes" />
	        <p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no" />
	    </p:confirmDialog>    
78
79
80
81
82
83
	</h:form>
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>