ssh-keys.xhtml 4.3 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
        			<b><h:outputText value="#{key.pubKeyEntity.name}"/></b> (<h:outputText value="#{key.pubKeyEntity.keyType}"/>)
michael.simon's avatar
michael.simon committed
35
36
        		</p:column>
        		<p:column>
37
       				<f:facet name="header"><h:outputText value="#{messages.fingerprint}:"/></f:facet>
38
        			<h:outputText value="#{key.fingerprint}" rendered="#{not empty key.publicKey}" />
michael.simon's avatar
michael.simon committed
39
        			<h:outputText value="#{messages.ssh_key_type_unknown}" rendered="#{empty key.publicKey}" />
michael.simon's avatar
michael.simon committed
40
41
42
43
        		</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')}"/>
44
45
46
47
        		</p:column> 
				<p:column>
       				<f:facet name="header"><h:outputText value="#{messages.services}:"/></f:facet>
					<p:repeat var="reg" value="#{key.pubKeyEntity.sshPubKeyRegistries}">
48
49
50
51
52
53
54
	        			<div>
		        			<h:outputText value="#{reg.registry.service.name}"/> 
		        			<h:panelGroup id="interactiveId" rendered="#{reg.usageType == 'INTERACTIVE'}"><i class="fa fa-fw fa-user"></i></h:panelGroup>
		        			<p:tooltip for="interactiveId" value="#{messages.ssh_pub_key_interactiv}" position="top"/>
		        			<h:panelGroup id="commandId" rendered="#{reg.usageType == 'COMMAND'}"><i class="fa fa-fw fa-database"></i></h:panelGroup>
		        			<p:tooltip for="commandId" value="#{messages.ssh_pub_key_command}" position="top"/>
	        			</div>
55
					</p:repeat>
michael.simon's avatar
michael.simon committed
56
        		</p:column>
57
58
59
60
        		
        		<p:column width="5%"> 
					<p:commandLink id="delete" action="#{userSshKeyManagementBean.deleteKey(key.pubKeyEntity.name)}" immediate="true" update="@form">
						<h:panelGroup styleClass="ui-icon ui-icon-trash" />
michael.simon's avatar
michael.simon committed
61
62
63
64
						<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
					</p:commandLink>
				</p:column>
        	</p:dataTable>
65

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

michael.simon's avatar
michael.simon committed
70
		        <h:outputText value="#{messages.ssh_key}:"/>
michael.simon's avatar
michael.simon committed
71
		        <p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 400px; height: 100px;" 
72
73
74
75
76
77
78
79
80
81
82
83
		        	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
84

85
	    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" closable="false" closeOnEscape="true">
michael.simon's avatar
michael.simon committed
86
87
88
	        <p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes" />
	        <p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no" />
	    </p:confirmDialog>    
89
90
91
92
93
94
	</h:form>
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>