ssh-keys.xhtml 4.51 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">
27
			<div><p:messages showDetail="true" /></div>
28

michael.simon's avatar
michael.simon committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
			<p:dataGrid var="key" value="#{userSshKeyManagementBean.keyList.toArray()}" columns="1" 
					layout="grid" style="margin-bottom: 16px;">
		        <f:facet name="header">#{messages.my_ssh_keys}</f:facet>
		        <p:panel styleClass="grayback" style="margin-bottom: 0px;">
		        	<f:facet name="header">
		        		<i class="fa fa-fw fa-key"></i>
		        		<b><h:outputText value="#{key.pubKeyEntity.name}"/></b>
		        	</f:facet>
		        	
		        	<h:panelGrid columns="2">

		        		<p:outputLabel for="@next" value="#{messages.ssh_key_type}:"/>
		        		<h:outputText value="#{key.pubKeyEntity.keyType}"/>
		        		
		        		<p:outputLabel for="@next" value="#{messages.fingerprint} (SHA256):"/>
		        		<h:panelGroup>
45
46
			        		<h:outputText value="#{key.fingerprint}" rendered="#{not empty key.fingerprint}"/>
			        		<h:outputText value="#{messages.unknown}" rendered="#{empty key.fingerprint}"/>
michael.simon's avatar
michael.simon committed
47
48
		        		</h:panelGroup>
		        		
michael.simon's avatar
michael.simon committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
		        		<h:outputText value="#{messages.expires}:"/>
		        		<h:outputText value="#{of:formatDate(key.pubKeyEntity.expiresAt, 'dd.MM.yyyy HH:mm')}"/>
		        		
		        		<h:outputText value="#{messages.services}:"/>
						<p:repeat var="reg" value="#{key.pubKeyEntity.sshPubKeyRegistries}">
		        			<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>
						</p:repeat>
		        		
michael.simon's avatar
michael.simon committed
63
64
65
66
67
68
69
70
71
		        	</h:panelGrid>

					<p:commandLink id="delete" action="#{userSshKeyManagementBean.deleteKey(key.pubKeyEntity.name)}" immediate="true" update="@form">
						<h:panelGroup styleClass="ui-icon ui-icon-trash" />
						<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
					</p:commandLink>
		        	
       			</p:panel>
			</p:dataGrid>
michael.simon's avatar
michael.simon committed
72

michael.simon's avatar
michael.simon committed
73
		<p:panel id="panel" header="#{messages.add_ssh_pub_key}">
michael.simon's avatar
michael.simon committed
74
			<p:panelGrid id="baseData" columns="2">
michael.simon's avatar
michael.simon committed
75
		        <bw:inputText id="sshKeyName" label="#{messages.ssh_key_name}:" 
76
77
			        	value="#{userSshKeyManagementBean.newName}" required="true"/>			

michael.simon's avatar
michael.simon committed
78
		        <h:outputText value="#{messages.ssh_key}:"/>
michael.simon's avatar
michael.simon committed
79
		        <p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 400px; height: 100px;" 
80
81
82
83
84
85
86
87
88
89
90
91
		        	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
92

93
	    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" closable="false" closeOnEscape="true">
michael.simon's avatar
michael.simon committed
94
95
96
	        <p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes" />
	        <p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no" />
	    </p:confirmDialog>    
97
98
99
100
101
102
	</h:form>
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>