ssh-keys.xhtml 5.67 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
			<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>
			        		<h:outputText value="#{key.fingerprint}" rendered="#{not empty key.publicKey}"/>
			        		<h:outputText value="#{messages.unknown}" rendered="#{empty key.publicKey}"/>
		        		</h:panelGroup>
		        		
		        	</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
59
60
       		<p:dataTable var="key" value="#{userSshKeyManagementBean.keyList.toArray()}">
				<p:column>
michael.simon's avatar
michael.simon committed
61
       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_name}:"/></f:facet>
62
        			<b><h:outputText value="#{key.pubKeyEntity.name}"/></b> (<h:outputText value="#{key.pubKeyEntity.keyType}"/>)
michael.simon's avatar
michael.simon committed
63
64
        		</p:column>
        		<p:column>
65
       				<f:facet name="header"><h:outputText value="#{messages.fingerprint}:"/></f:facet>
66
        			<h:outputText value="#{key.fingerprint}" rendered="#{not empty key.publicKey}" />
michael.simon's avatar
michael.simon committed
67
        			<h:outputText value="#{messages.ssh_key_type_unknown}" rendered="#{empty key.publicKey}" />
michael.simon's avatar
michael.simon committed
68
69
70
71
        		</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')}"/>
72
73
74
75
        		</p:column> 
				<p:column>
       				<f:facet name="header"><h:outputText value="#{messages.services}:"/></f:facet>
					<p:repeat var="reg" value="#{key.pubKeyEntity.sshPubKeyRegistries}">
76
77
78
79
80
81
82
	        			<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>
83
					</p:repeat>
michael.simon's avatar
michael.simon committed
84
        		</p:column>
85
86
87
88
        		
        		<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
89
90
91
92
						<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
					</p:commandLink>
				</p:column>
        	</p:dataTable>
michael.simon's avatar
michael.simon committed
93
94
 -->
		<p:panel id="panel" header="#{messages.add_ssh_pub_key}">
michael.simon's avatar
michael.simon committed
95
			<p:panelGrid id="baseData" columns="2">
michael.simon's avatar
michael.simon committed
96
		        <bw:inputText id="sshKeyName" label="#{messages.ssh_key_name}:" 
97
98
			        	value="#{userSshKeyManagementBean.newName}" required="true"/>			

michael.simon's avatar
michael.simon committed
99
		        <h:outputText value="#{messages.ssh_key}:"/>
michael.simon's avatar
michael.simon committed
100
		        <p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 400px; height: 100px;" 
101
102
103
104
105
106
107
108
109
110
111
112
		        	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
113

114
	    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" closable="false" closeOnEscape="true">
michael.simon's avatar
michael.simon committed
115
116
117
	        <p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes" />
	        <p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no" />
	    </p:confirmDialog>    
118
119
120
121
122
123
	</h:form>
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>